Ubuntu 20.04 CUDA & cuDNN Installation Method (Graphical Tutorial)

Ubuntu 20.04 CUDA & cuDNN Installation Method (Graphical 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 Additional Driver, select the corresponding version of the driver and it will be automatically downloaded.

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 Ubuntu 20.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 and you can see that there are two versions, 7 and 9, in the system.

Use update-alternatives to switch versions and enter the following command:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 50


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 bar to remove the option to install the graphics driver, and then select install

Configuring environment variables

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

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, the cuda installation is complete. Enter the nvcc -V command to view the 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 files under cuda/lib64/ to the /usr/local/cuda/lib64 folder, and add read permissions:

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

At this point, cuDNN installation is complete

This is the end of this article about Ubuntu 20.04 CUDA&cuDNN installation method (graphic tutorial). For more information about Ubuntu 20.04 CUDA&cuDNN installation, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed solution to the problem of "Unable to start the program, the system cannot find the specified file" when writing C program or CUDA program in VS2019
  • Installation of CUDA10.0 and problems in Ubuntu
  • Detailed configuration of win10+VS2017+Cuda10.0 environment
  • Detailed explanation of the correspondence between different Tensorflow version requirements and CUDA and CUDNN versions
  • Implementation of installing and uninstalling CUDA and CUDNN in Ubuntu
  • Detailed tutorial on installing CUDA9.0 on Ubuntu16.04
  • Steps to install cuda10.1 on Ubuntu 20.04 (graphic tutorial)
  • Manjaro installation CUDA implementation tutorial analysis

<<:  Example of disabling browser cache configuration in Vue project

>>:  Analysis of the usage of process control functions/statistical functions/grouping queries in MySql

Recommend

Usage and scenario analysis of npx command in Node.js

npx usage tutorial Tonight, when I was learning V...

A brief discussion on how Tomcat breaks the parent delegation mechanism

Table of contents JVM Class Loader Tomcat class l...

Implementation of remote Linux development using vscode

Say goodbye to the past Before vscode had remote ...

Explanation of the new feature of Hadoop 2.X, the recycle bin function

By turning on the Recycle Bin function, you can r...

...

JavaScript Factory Pattern Explained

Table of contents Simple Factory Factory Method S...

Beginners learn some HTML tags (3)

Related articles: Beginners learn some HTML tags ...

20 JS abbreviation skills to improve work efficiency

Table of contents When declaring multiple variabl...

Description of the hr tag in various browsers

Generally, we rarely meet HR, but once we do, it c...

A brief summary of basic web page performance optimization rules

Some optimization rules for browser web pages Pag...

Solution to blank page after Vue packaging

1. Solution to the problem that the page is blank...

Detailed explanation of how a SQL statement is executed in MySQL

Overview I have recently started learning MySQL r...

Analysis of log files in the tomcat logs directory (summary)

Each time tomcat is started, the following log fi...

A brief analysis of the knowledge points of exporting and importing MySQL data

Often, we may need to export local database data ...

How to deploy Vue project using Docker image + nginx

1. Packaging Vue project Enter the following name...