(see: https://www.codingforentrepreneurs.com/blog/install-tensorflow-gpu-windows-cuda-cudnn/)
- You will have to download a 2Gb file
- Nvidia Dev Network (for cuDNN) !!!
- First, check that your Nvidia card is installed.
# Ubuntu
nvidia-smi
- Install
tensorflow-gpu
pip install tensorflow-gpu --upgrade
- Try to run and fail (at this stage, it's "normal") :
python -c 'import tensorflow'
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
- Go to Nvidia Archive https://developer.nvidia.com/cuda-toolkit-archive and choose the correct version !
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda-toolkit-9-0
- Install
tensorflow-gpu
pip install tensorflow-gpu --upgrade
- Try to run and fail (...) :
python -c 'import tensorflow'
Install
cuDNN
: fuck you nvidia! Just follow the steps... grrrr- Reinstall updated driver...
sudo apt purge nvidia-*
Removes:
libcuda1-378* nvidia-378* nvidia-381* nvidia-opencl-icd-378* nvidia-opencl-icd-381* nvidia-prime* nvidia-settings*
Then:
sudo apt install nvidia-opencl-icd-390
Installs:
libcuda1-390 nvidia-390 nvidia-opencl-icd-390 nvidia-prime nvidia-settings xserver-xorg-legacy
REBOOT
- Install
tensorflow-gpu
pip uninstall tensorflow
pip install tensorflow-gpu