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

28 Famous Blog Redesign Examples

1. WebDesignerWall 2. Veerle's Blog 3. Tutori...

Implementation of TCPWrappers access control in Centos

1. TCP Wrappers Overview TCP Wrappers "wraps...

Analysis of SQL integrity constraint statements in database

Integrity constraints Integrity constraints are f...

Detailed tutorial for installing ffmpeg under Linux

1. Install ffmpeg under centos linux 1. Download ...

Four categories of CSS selectors: basic, combination, attribute, pseudo-class

What is a selector? The role of the selector is t...

Installation tutorial of MySQL 5.7.17 zip package version under win10

The installation tutorial of mysql5.7.17 is share...

Docker compose custom network to achieve fixed container IP address

Due to the default bridge network, the IP address...

Tools to convert static websites into RSS

<br /> This article is translated from allwe...

How to enable remote access permissions in MYSQL

1. Log in to MySQL database mysql -u root -p View...

Several CSS3 tag shorthands (recommended)

border-radius: CSS3 rounded corners Syntax: borde...

JavaScript single thread and asynchronous details

Table of contents 1. Task Queue 2. To explain som...