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

Detailed tutorial for downloading and installing mysql8.0.21

Official website address: https://www.mysql.com/ ...

CSS sample code to achieve circular gradient progress bar effect

Implementation ideas The outermost is a big circl...

Tomcat common exceptions and solution code examples

The company project was developed in Java and the...

Detailed explanation of how a SQL statement is executed in MySQL

Overview I have recently started learning MySQL r...

Docker builds jenkins+maven code building and deployment platform

Table of contents Docker Basic Concepts Docker in...

A brief discussion on the solution of Tomcat garbled code and port occupation

Tomcat server is a free and open source Web appli...

HTML reuse techniques

HTML reuse is a term that is rarely mentioned. Tod...

Detailed explanation of MySQL execution plan

The EXPLAIN statement provides information about ...

A detailed discussion of components in Vue

Table of contents 1. Component Registration 2. Us...

A brief discussion on this.$store.state.xx.xx in Vue

Table of contents Vue this.$store.state.xx.xx Get...

How to clean up the disk space occupied by Docker

Docker takes up a lot of space. Whenever we run c...

CSS3 creates web animation to achieve bouncing ball effect

Basic preparation For this implementation, we nee...

JavaScript implements random generation of verification code and verification

This article shares the specific code of JavaScri...