-
-
Save mjdietzx/0ff77af5ae60622ce6ed8c4d9b419f45 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda | |
# install cuDNN v6.0 | |
CUDNN_TAR_FILE="cudnn-8.0-linux-x64-v6.0.tgz" | |
wget http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/${CUDNN_TAR_FILE} | |
tar -xzvf ${CUDNN_TAR_FILE} | |
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-8.0/include | |
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64/ | |
sudo chmod a+r /usr/local/cuda-8.0/lib64/libcudnn* | |
# set environment variables | |
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} | |
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} |
Unable to uninstall cuda 9.0 completely and install 8.0 instead
Now Cuda 9.0 is installed, you have to specify the version to apt. If you don't, cuda9 is installed :
sudo apt-get install cuda-8-0
I get it from here.
Thanks for the gist! Definitely saved my Tensorflow life today...
My paths were already well set but after I tried to echo your suggested LD_LIBRARY_PATH
, I realised I had extra }} in it (maybe caused by the backwards slash?). Just using the following should suffice:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
i have installed cuda 9.0 and operating system is centos 7. I just want to know which version of tensor flow will support cuda 9 and centos 7. Also please let me know which version of cudnn should I install?
At last i found a resource that really works. Thanks for this. Please remove the unnecessary backslash from last line.
@EICT321 You might be moving too fast... it might work, but I don't think they official support 9 yet. https://www.tensorflow.org/install/install_sources list tensorflow versions and their tested configurations.
Cuda 9.0 is installed instead of 8.0
In case running nvidia-smi
throws the following error, just try rebooting. That seemed to work for me.
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running
This script works by the way! Ubuntu 16.04.3 represent here. I successfully installed Cuda 8.0 and cuDNN 6.0, without running into any problems with the display/graphics like I usually used to. I highly recommend using the package manager installation over the runfile method.
Thanks!
This script is not suitable for default graphic card is not nvidia card, such as " dell precision tower 7910", after I run this script and reboot ubuntu, system could not login. And now tensorflow can only support cuda8, but this script will install cuda9.1
For Ubuntu 16.04 users only:
change the the following line in the script
sudo apt-get -y install cuda
to sudo apt-get -y install cuda-8-0
GPU TensorFlow now requires cudnn 9.0
. Anyone have an updated link for 9.0
?
If you are still facing installation issues, try out this guide: https://medium.com/@anujonthemove/deep-learning-environment-setup-on-ubuntu-16-04-83078e1cba1f
GPU TensorFlow now requires
cudnn 9.0
. Anyone have an updated link for9.0
?
@JohnAllen Did you find a updated script for GPU tensorflow?
4040 error on ubuntu 20
--2022-01-23 17:43:34-- http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.1-linux-x64-v6.0.tgz
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.20.126
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.20.126|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.1-linux-x64-v6.0.tgz [following]
--2022-01-23 17:43:34-- https://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.1-linux-x64-v6.0.tgz
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.20.126|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-01-23 17:43:35 ERROR 404: Not Found.
tar (child): cudnn-8.1-linux-x64-v6.0.tgz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
cp: cannot stat 'cuda/include/cudnn.h': No such file or directory
cp: cannot stat 'cuda/lib64/libcudnn*': No such file or directory
chmod: cannot access '/usr/local/cuda-8.0/lib64/libcudnn*': No such file or directory
Check CUDA toolkit versions
https://developer.nvidia.com/cuda-toolkit-archive