Skip to content

Instantly share code, notes, and snippets.

@tzutalin
Last active August 29, 2015 14:25
Show Gist options
  • Save tzutalin/d37f3d0b685129f852f6 to your computer and use it in GitHub Desktop.
Save tzutalin/d37f3d0b685129f852f6 to your computer and use it in GitHub Desktop.
#/bin/sh
cd ~
git clone https://github.com/viennacl/viennacl-dev.git
cd viennacl-dev
mkdir build && cd build
cmake ..
make
ubunut_version=`lsb_release --release | cut -f2`
echo $ubunut_version
if [ "$ubunut_version" = "12.04" ]; then
# Make sure your gcc and g++ verison is 4.8 or higher
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
# Make sure your boost version
sudo add-apt-repository ppa:boost-latest/ppa
sudo apt-get update
sudo apt-get install libboost1.54-dev
sudo apt-get install libboost1.54-*
fi
cd ~
git clone https://github.com/naibaf7/caffe.git
cd caffe
chmod +x src/caffe/greentea/cl_kernels.sh
cp Makefile.config.example Makefile.config
# Enable the OpenCL/Greentea backend
# USE_GREENTEA := 1 and USE_CUDA := 0
# Set viennacl headers
# VIENNACL_DIR = /home/darrenl/viennacl-dev/include
make -j4 all
# Test
./build/tools/caffe device_query
# Do device_query, it will show device id
./build/tools/caffe time -model=models/bvlc_alexnet/deploy.prototxt -gpu=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment