Ubuntu 20.04 CUDA&cuDNN installation method (graphic tutorial)

CUDA installation download cuda

Enter the nvidia-smi command to view the supported cuda version

If you cannot view it, it means that the nvidia driver has not been installed. Click on the additional driver and select the corresponding version of the driver to download it automatically.

Download the corresponding version of cuda from https://developer.nvidia.com/cuda-toolkit-archive and select the 18.04 version.

gcc downgrade

The gcc version that comes with Ubuntu20.04 is 9.7.0, you need to add gcc7 to install cuda10.2, enter the command to install gcc7

apt-get install gcc-7 g++-7

Check the gcc version, you can see that there are two versions 7 and 9 in the current system

Use update-alternatives for version switching, enter the following command:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-950

At this time, enter the sudo update-alternatives –config gcc command to view the default version of gcc. You can see that the current default gcc version is 7, which means the switch is successful.

Install cuda

Enter the command to install

sudo sh cuda_10.2.89_440.33.01_linux.run

Click continue

Enter accept

The cuda installation package comes with its own graphics driver, so in this step press the space to remove the option to install the graphics driver, and then select install

Configure environment variables

Enter gedit ~/.bashrc command to open the file, enter the following statement at the end of the file, and save.

export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Update environment variable configuration

source ~/.bashrc

At this point cuda installation is complete, enter nvcc -V command to view cuda information

Install cuDNN

Download the corresponding version of cudnn from https://developer.nvidia.com/cudnn, you need to log in.

After downloading and decompressing, copy the cuda/include/cudnn.h file to the usr/local/cuda/include folder, copy all the files under cuda/lib64/ to the /usr/local/cuda/lib64 folder, and add read Get permissions:

sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

So far cuDNN installation is complete!

Recommended Posts

Ubuntu 20.04 CUDA&cuDNN installation method (graphic tutorial)
ubuntu19.04 installation tutorial (graphic steps)
Ubuntu 16.04 installation graphic tutorial under VMware 12
Virtual machine Linux Ubuntu installation tutorial
ubuntu20.04 Chinese input method installation steps
Ubuntu 20.04 Shuangpin input method installation steps
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Ubuntu16.04 mirror complete installation tutorial under VMware
Centos 7 64-bit desktop version installation graphic tutorial
Ubuntu18.04 Server version installation and use (graphic)
The implementation of the Ubuntu18.04 installation Pycharm tutorial
Ubuntu20.04 steps to install cuda10.1 (graphic tutorial)
Ubuntu18.04 install Nvidia graphics driver tutorial (graphic)
UBUNTU 16.04 installation diary
Python2.7 [Installation Tutorial]
ubuntu 1804 installation details
Ubuntu system installation
Ubuntu installation record
ubuntu 18.04 installation (UEFI+GBT)
ubuntu installation error
Windows10 install ubuntu20.04 dual system detailed graphic tutorial
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Kaldi installation and configuration graphic tutorials under Ubuntu
Manual for Ubuntu Installation
Ubuntu16.04 mirror complete installation and configuration tutorial under VMware
Ubuntu16.04 installation partition settings
ubuntu redis php installation
Install nvidia graphics driver under Ubuntu (easy installation method)
Linux system-Centos7 installation tutorial
Ubuntu and RHEL dual Linux operating system installation tutorial
Ubuntu introduction and installation
Centos8 (minimal installation) a new installation of Python3.8+pip method tutorial
ubuntu nice font installation
Ubuntu CEPH quick installation
foreman ubuntu16 quick installation
Ubuntu 17.10 installation toss record
Ubuntu dual system installation
Docker CentOS installation method
Linux CentOS 7 installation tutorial
ubuntu14.04 install jdk1.8 tutorial
Github Project-OpenPose installation on Ubuntu
Android phone running Ubuntu tutorial
Ubuntu 20.04 Chinese input method support
ubuntu 18.04 set static ip method
ubuntu view python installation path
Ubuntu16.04 installation and simple configuration
Detailed ubuntu 20.04 LTS installation record
Hyper-V + CentOS7 installation video tutorial
CSI Tools installation Intel 5300 + Ubuntu 14.04
5.1. CentOS@ install JDK1.8 graphic tutorial
Centos7.4 environment installation lamp-php7.0 tutorial
Ubuntu PostgreSQL installation and configuration
ubuntu offline installation python environment
Ubuntu16.04 build GitLab server tutorial