- kmhofmann / installing_nvidia_driver_cuda_cudnn_linux.md
- This comment has been minimized.
- bgyarbro commented Aug 10, 2020
- This comment has been minimized.
- PSS67 commented Sep 12, 2020
- This comment has been minimized.
- prikmm commented Nov 18, 2020 •
- Update:
- This comment has been minimized.
- aloizo03 commented Nov 23, 2020
- This comment has been minimized.
- emenshoff commented Dec 4, 2020
- This comment has been minimized.
- johndpope commented Dec 18, 2020 •
- This comment has been minimized.
- saidmithilesh commented Jan 22, 2021
- This comment has been minimized.
- aloizo03 commented Jan 22, 2021
- This comment has been minimized.
- kyleawayan commented Feb 19, 2021
- This comment has been minimized.
- hrithikppawar commented Mar 8, 2021
- This comment has been minimized.
- SakibFarhad commented Mar 9, 2021
- This comment has been minimized.
- hrithikppawar commented Mar 9, 2021
- This comment has been minimized.
- tyuvraj commented May 22, 2021 •
- Update:
kmhofmann / installing_nvidia_driver_cuda_cudnn_linux.md
Installing the NVIDIA driver, CUDA and cuDNN on Linux (Ubuntu 20.04)
This is a companion piece to my instructions on building TensorFlow from source. In particular, the aim is to install the following pieces of software
on an Ubuntu Linux system, in particular Ubuntu 20.04.
At the time of writing (2020-08-06), these were the latest available versions. As a disclaimer, please note that I am not interested in running an outdated Ubuntu version or installing a CUDA/cuDNN version that is not the latest. Therefore, the below instructions may or may not be useful to you. Please also note that the instructions are likely outdated, since I only update them occasionally. Don’t just copy these instructions, but check what the respective latest versions are and use these instead!
Installing the NVIDIA driver
Download and install the latest NVIDIA graphics driver from here: https://www.nvidia.com/en-us/drivers/unix/. Note that every CUDA version requires a minimum version of the driver; check this beforehand.
Ubuntu 20.04 currently offers installation of the NVIDIA driver version 440.100 through its built-in ‘Additional Drivers’ mechanism, which should be sufficient for CUDA 10.2. CUDA 11.0 appears to require a newer version of the NVIDIA driver, so we’re going to install this manually.
Download and install the latest NVIDIA graphics driver from here: https://www.nvidia.com/en-us/drivers/unix/.
The CUDA runfile also includes a version of the NVIDIA graphics driver, but I like to separate installing either, as the version supplied with CUDA Is not necessarily the latest version of the driver.
Download the latest CUDA version here. For example, I downloaded:
Thankfully, CUDA 11 currently supports the up-to-date Ubuntu version, 20.04, so we don’t need to jump through hoops to deal with an unsupported GNU version error as in previous versions of this document. Simply install as per the official instructions:
You may need to confirm that the display driver is already installed, and de-select installation of the display driver.
Once finished, you should see a summary like this:
Do what the instructions given in the summary say and add the given directories to your PATH and LD_LIBRARY_PATH . For example by adding the following lines to your .bashrc , .zshrc , or whatever shell you are using:
Just go here and follow the instructions. You’ll have to log in, so downloading of the right cuDNN binary packages cannot be easily automated. Meh.
Once downloaded, un-tar the file and copy the contents to their respective locations:
This comment has been minimized.
Copy link Quote reply
bgyarbro commented Aug 10, 2020
Thank you for this tutorial! This is awesome info. I was able to get it setup easily.
This comment has been minimized.
Copy link Quote reply
PSS67 commented Sep 12, 2020
Thanks. Do you know if this will work on WSL2 (with Ubuntu 20.04)?
This comment has been minimized.
Copy link Quote reply
prikmm commented Nov 18, 2020 •
Update:
Hey, I downloaded using package manager. Everything went great and i was able to use tensorflow on gpu. But, while running ldconfig, I see the following error:
/sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn.so.8 is not a symbolic link
To check I went to:
/usr/local/cuda-11.0/targets/x86_64-linux/lib
and did:
ls -ln
Among all the symlinks I got as my ouput, I saw:
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so.8
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so.8.0.5
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so.8
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so.8.0.5
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so.8
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so.8.0.5
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so.8
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so.8.0.5
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so.8
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so.8.0.5
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so.8
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so.8.0.5
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so.8
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so.8.0.5
I got confused whether this files are to be completely removed or symlinks are to be created for then, and while copy pasting they got messed.
While searching on the web for this answer I came across one command for checking cudnn:
/sbin/ldconfig -N -v $(sed ‘s/:/ /’ /dev/null | grep libcudnn
I ran the above command (I don’t know what it means, thought of understanding how it works after seeing the output, but got even more confused), and got something like below:
sed: -e expression #1, char 1: unknown command: ‘�’
libcudnn_ops_train.so.8 -> libcudnn_ops_train.so.8.0.5
libcudnn_ops_infer.so.8 -> libcudnn_ops_infer.so.8.0.5
libcudnn_adv_train.so.8 -> libcudnn_adv_train.so.8.0.5
libcudnn_cnn_infer.so.8 -> libcudnn_cnn_infer.so.8.0.5
libcudnn_cnn_train.so.8 -> libcudnn_cnn_train.so.8.0.5
libcudnn_adv_infer.so.8 -> libcudnn_adv_infer.so.8.0.5
libcudnn.so.8 -> libcudnn.so.8.0.5
Now, I don’t know what to do whether to generate symlinks or remove libcudnn* files from /usr/local/cuda-11.0/targets/x86_64-linux/lib.
Kindly help me.
Thank you in advance 🙂
PS: If I have to create symlinks, then it would be helpful if I can get an example using one of the ones that have to be created, I just started using linux and am not to familiar with it. 🙂
This comment has been minimized.
Copy link Quote reply
aloizo03 commented Nov 23, 2020
Hello i want to install cuda 11 in Ubuntu 18.04 this installation tutorial i will be okay ?
This comment has been minimized.
Copy link Quote reply
emenshoff commented Dec 4, 2020
Hello i want to install cuda 11 in Ubuntu 18.04 this installation tutorial i will be okay ?
It works fine, but I, personaly was not able to build working version of tensorflow in Uabuntu 18.04 with cuda 11
This comment has been minimized.
Copy link Quote reply
johndpope commented Dec 18, 2020 •
you may find more solace in using POP-OS — latest nvidia drivers out of the box. https://pop.system76.com/
I added a request to create a new distro for ML — https://github.com/pop-os/iso/issues/270 / we should be able to get something off the shelf like AWS / AMI.
CHECK LATEST CUDNN versions on https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html
sudo apt-get install libcudnn8=8.0.5.39-1+cuda11.1
sudo apt-get install libcudnn8-dev=8.0.5.39-1+cuda11.1
This comment has been minimized.
Copy link Quote reply
saidmithilesh commented Jan 22, 2021
Hello i want to install cuda 11 in Ubuntu 18.04 this installation tutorial i will be okay ?
This comment has been minimized.
Copy link Quote reply
aloizo03 commented Jan 22, 2021
Hello i want to install cuda 11 in Ubuntu 18.04 this installation tutorial i will be okay ?
Thanks for the help i solve this problem 2 months ago the issue was at the nvidia driver and the cuda version
This comment has been minimized.
Copy link Quote reply
kyleawayan commented Feb 19, 2021
Thanks for this guide! Unfortunately on Ubuntu 20.04.2 LTS, the tar file installation didn’t really work as there were missing files (at least when using dlib ). I downloaded the two runtime and developer deb files for Ubuntu 20.04 from NVIDIA, installed them using sudo dpkg -i libcudnn8_8.1.0.77-1+cuda11.2_amd64.deb and sudo dpkg -i libcudnn8-dev_8.1.0.77-1+cuda11.2_amd64.deb , and it worked with dlib .
This comment has been minimized.
Copy link Quote reply
hrithikppawar commented Mar 8, 2021
Hello!
I am going to start a project on Object Detection so I want to use the Tensorflow framework but can Tesorflow supports Cuda-11.0 or I need to install any other version on Cuda.
Can anyone brief me about how I should set up my development environment? I am using Ubuntu-20.10 with Nvidia’s GPU.
This comment has been minimized.
Copy link Quote reply
SakibFarhad commented Mar 9, 2021
Hello!
I am going to start a project on Object Detection so I want to use the Tensorflow framework but can Tesorflow supports Cuda-11.0 or I need to install any other version on Cuda.
Can anyone brief me about how I should set up my development environment? I am using Ubuntu-20.10 with Nvidia’s GPU.
You can use cuda-11.0, It is supported now as per this https://www.tensorflow.org/install/source#gpu
This comment has been minimized.
Copy link Quote reply
hrithikppawar commented Mar 9, 2021
Hello!
I am going to start a project on Object Detection so I want to use the Tensorflow framework but can Tesorflow supports Cuda-11.0 or I need to install any other version on Cuda.
Can anyone brief me about how I should set up my development environment? I am using Ubuntu-20.10 with Nvidia’s GPU.
Thank you for your response!
I successfully installed the cuda-11.0 and it is working great with tensorflow.
I think the best configuration is:
This worked for me
This comment has been minimized.
Copy link Quote reply
tyuvraj commented May 22, 2021 •
Update:
Hey, I downloaded using package manager. Everything went great and i was able to use tensorflow on gpu. But, while running ldconfig, I see the following error:
/sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 is not a symbolic link /sbin/ldconfig.real: /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcudnn.so.8 is not a symbolic link
To check I went to:
/usr/local/cuda-11.0/targets/x86_64-linux/lib
and did:
ls -ln
Among all the symlinks I got as my ouput, I saw:
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so.8
-rwxr-xr-x 1 0 0 98957080 Nov 18 13:54 libcudnn_adv_infer.so.8.0.5
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so.8
-rwxr-xr-x 1 0 0 65344120 Nov 18 13:54 libcudnn_adv_train.so.8.0.5
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so.8
-rwxr-xr-x 1 0 0 1288305728 Nov 18 13:55 libcudnn_cnn_infer.so.8.0.5
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so.8
-rwxr-xr-x 1 0 0 58705816 Nov 18 13:55 libcudnn_cnn_train.so.8.0.5
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so.8
-rwxr-xr-x 1 0 0 251390696 Nov 18 13:55 libcudnn_ops_infer.so.8.0.5
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so.8
-rwxr-xr-x 1 0 0 26002104 Nov 18 13:55 libcudnn_ops_train.so.8.0.5
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so.8
-rwxr-xr-x 1 0 0 158264 Nov 18 13:55 libcudnn.so.8.0.5
I got confused whether this files are to be completely removed or symlinks are to be created for then, and while copy pasting they got messed.
While searching on the web for this answer I came across one command for checking cudnn:
/sbin/ldconfig -N -v $(sed ‘s/:/ /’ /dev/null | grep libcudnn
I ran the above command (I don’t know what it means, thought of understanding how it works after seeing the output, but got even more confused), and got something like below:
sed: -e expression #1, char 1: unknown command: ‘�’
libcudnn_ops_train.so.8 -> libcudnn_ops_train.so.8.0.5
libcudnn_ops_infer.so.8 -> libcudnn_ops_infer.so.8.0.5
libcudnn_adv_train.so.8 -> libcudnn_adv_train.so.8.0.5
libcudnn_cnn_infer.so.8 -> libcudnn_cnn_infer.so.8.0.5
libcudnn_cnn_train.so.8 -> libcudnn_cnn_train.so.8.0.5
libcudnn_adv_infer.so.8 -> libcudnn_adv_infer.so.8.0.5
libcudnn.so.8 -> libcudnn.so.8.0.5
Now, I don’t know what to do whether to generate symlinks or remove libcudnn* files from /usr/local/cuda-11.0/targets/x86_64-linux/lib.
Kindly help me.
Thank you in advance 🙂
PS: If I have to create symlinks, then it would be helpful if I can get an example using one of the ones that have to be created, I just started using linux and am not to familiar with it. 🙂
Источник