Skip to content

Instantly share code, notes, and snippets.

@tzutalin
Last active August 29, 2015 14:25
Show Gist options
  • Save tzutalin/2127eae816bf354194fb to your computer and use it in GitHub Desktop.
Save tzutalin/2127eae816bf354194fb to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo sh -c "echo 'deb http://security.ubuntu.com/ubuntu utopic-security main' >> /etc/apt/sources.list"
sudo apt-get -y update
sudo apt-get -y install build-essential libncurses-dev fakeroot kernel-package
sudo apt-get -y install linux-source
sudo apt-get -y install linux-image-3.16.0-43-generic linux-headers-3.16.0-43 linux-source-3.16.0
cd /usr/src
sudo tar xvjf linux-source-3.16.0.tar.bz2
cd linux-source-3.16.0
sudo wget https://01.org/sites/default/files/disable-batchbuffer-security.patch
sudo patch -b drivers/gpu/drm/i915/i915_gem_execbuffer.c < disable-batchbuffer-security.patch
sudo cp /boot/config-3.16.0-43-generic .config
sudo make oldconfig
#sudo make menuconfig
sudo make-kpkg clean
sudo CONCURRENCY_LEVEL=8 make-kpkg --rootcmd fakeroot --initrd --revision=20150318 kernel_image kernel_headers
# Update your kernel and reboot
#sudo dpkg -i linux-image-*.deb
#sudo dpkg -i linux-headers-*.deb
# Change boot kerenl, refer to https://askubuntu.com/questions/100232/how-do-i-change-the-grub-boot-order/100246#100246
#!/bin/bash
#Add following command to /etc/rc.local
#echo 0 > /sys/module/i915/parameters/enable_cmd_parser
sudo sh -c "echo 0 > /sys/module/i915/parameters/enable_cmd_parser"
git clone git://anongit.freedesktop.org/beignet
cd beignet
git checkout Release_v1.0.0
sudo apt-get install libedit-dev
#Install clang and llvm-3.5 from official web site
wget http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
tar xvf clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
sudo cp -r clang+llvm-3.5.0-x86_64-linux-gnu/* /usr/local/
sudo ldconfig
mkdir build
cd build
cmake ..
make
# After building, runtest
cd utests
cat setenv.sh
[copy all of the export commands, run them in your shell]
./utest_run
# After test, install it to /usr/loca/lib or give a path like usr/lib
sudo make install
#!/bin/bash
sudo apt-get update
#Install ependency on libfreenect2
sudo apt-get -y install git cmake cmake-curses-gui libXmu-dev libXi-dev libgl-dev dos2unix xorg-dev libglu1-mesa-dev libtool automake libudev-dev libgtk2.0-dev pkg-config libjpeg-turbo8-dev libturbojpeg lsb-core libglfw-dev
#Install ependency on beignet
sudo apt-get -y install ocl-icd-dev ocl-icd-libopencl1 libdrm-dev libegl1-mesa-dev libedit-dev cmake
#Install llvm-3.5 from official web site
wget http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
tar xvf clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
sudo cp -r clang+llvm-3.5.0-x86_64-linux-gnu/* /usr/local/
sudo ldconfig
#Download beignet and build
mkdir ~/beignet
cd ~/beignet
wget https://01.org/sites/default/files/beignet-1.0.2-source.tar.gz
tar xvf beignet-1.0.2-source.tar.gz
cd Beignet-1.0.2-Source
mkdir build
cd build
cmake ../
make -j8
sudo make install
# Need to check /etc/OpenCL, there should be a *.icd file indicating libcl.so. e.g:/usr/local/lib/x86_64-linux-gnu/beignet//libcl.so
#!/bin/bash
cd ..
./benchmark/benchmark_run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment