Google Code Block

2016年12月1日

Setup CUDA / CUDNN and Chainer for deep learning on Ubuntu 16.04



。Install CUDA / CUDNN and Chainer with GPU enabled

1 . Install CUDA 8.0 ( Ubuntu 14.04 )
    1. download http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
    2. sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
    3. sudo apt-get update
    4. sudo apt-get install cuda
2 . Install CUDNN 5.1 for CUDA 8.0
    1. Download https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v5.1/prod/8.0/cudnn-8.0-linux-x64-v5.1-tgz
    2. Extract tgz file
    3. sudo cp lib64/* /usr/local/cuda/lib64/
    4. sudo cp include/* /usr/local/cuda/include/
3. Set environment to build Chainer
    1. export CFLAGS=-I/usr/local/cuda/include
    2. export LDFLAGS=-L/usr/local/cuda/lib64
    3. export LD_LIBRARY_PATH=/usr/local/cuda/lib64
4. pip install chainer --no-cache-dir -vvvv


5. Don't forget to setup the nvcc path
nano ~/.bashrc ( or nano ~/.zshrc if you use zsh :p )
add the following line to the end of the rc file
export PATH=/usr/local/cuda/bin:$PATH


。If you need image processing library on Python ...
pip install Pillow


。Install ffmpeg
tar xvf ffmpeg-release-64bit-static.tar

sudo cp ffmpeg-3.2-64bit-static/* /usr/local/bin/ 

1 則留言:

張貼留言