Tensorflow 1.4.0 binary with CUDA 8 and cuDNN 6 Tensorflow 1.5.0 binary will be with CUDA 9 and cuDNN 7
The following procedure assumes that you use anaconda for python package manager.
- prepare for driver install
- Delete installed drivers by sudo apt purge nvidia*
- Press ctrl + alt + F1 and Login
- Stop X server by sudo service lightdm stop
- Disable the Nouveau kernel driver by creating a new file /etc/modprobe.d/blacklist-nouveau.conf
- The file contents is as follows
blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off
- Then, create another file by echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
- Update by sudo update-initramfs -u
- Then reboot by sudo reboot
- install driver
- install CUDA toolkit
- Download the toolkit installer from here, say cuda_***.run.
- Change the permission by sudo chmod +x cuda_***.run
- Install the toolkit by sudo ./cuda_***.run --toolkit --silent
- Install the samples by sudo ./cuda_***.run --samples --silent
- Add the following lines to the .bashrc
export PATH="$PATH:/usr/local/cuda/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" export CUDA_HOME=/usr/local/cuda
- Update by source ~/.bashrc
- install cuDNN
- Download packed file from here, say cudnn-***.tgz
- Untar the file by tar -xzvf cudnn-***.tgz
- Copy header and lib files by
- sudo cp cuda/lib64/* /usr/local/cuda/lib64/
- sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
- install Tensorflow
- install by pip install tensorflow-gpu
- install Keras
- install by pip install keras