Complete Guide for GPU setup on Ubuntu system for deep learning. Installation of NVIDIA-Driver,NVCC,CUDA, CUDNN.

Gandham Vignesh Babu
4 min readMar 16, 2021

Incase of any queries mail to machinelearningdeeplearning628@gmail.com

We have 4 major components to be completed for the installation.

  1. Installation of NIVIDIA-DRIVER
  2. Installation of NVCC
  3. Installation Of CUDA
  4. Installation of CUDNN

What is NVIDIA-DRIVER ??

  • The NVIDIA Driver is the software driver for NVIDIA Graphics GPU installed on the PC.
  • It is a program used to communicate from the OS to the device.
  • This software is required in most cases for the hardware device to function properly.

What is NVCC ??

  • The GPU code is implemented as a collection of functions in a language that is essentially C++.
  • For Compilation we use NVCC. It is Nvidia Cuda Compiler.

What is Cuda ??

  • Compute Unified Device Architecture proposed by NVIDIA for general purpose programming using GPU.
  • It is a parallel computing platform and API from NVIDIA that lets developers use languages they are familiar with — C, C++ to build general purpose applications for graphics processing units.

What is CUDNN ??

  • NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural networks.
  • It allows them to focus on training neural networks and developing software applications rather than spending time on low-level GPU performance

Major Doubt —

Nvidia-smi shows CUDA version, but CUDA is not installed ??

  • Be aware that the CUDA VERSION displayed by nvidia-smi associated with newer drivers is the DRIVER API COMPATIBILITY VERSION.
  • It does not indicate anything at all about what CUDA version is actually installed.
  • For example: A 410.72 driver will display CUDA VERSION 10.0 even when no CUDA toolkit is installed.
  1. For NVIDIA-DRIVER installation :

Command : sudo apt install nvidia-driver-455

Most of the cases it comes default with the installation of OS. If not we can also install from the Ubuntu Software manager . Generally its better install the latest version based on the compatibility. Once the driver is installed restart the system.

command : nvidia-smi

This command should work now.

2. For NVCC installation :

Command : sudo apt-get install nvidia-tool-kit

After the installation,

Comamand : nvcc — — version

  • Above command is nvcc double hiphen.

Should work giving the version of the compiler being used.

3. Cuda installation:

  • You will find these post installation instructions . Execute these commands.

CUDNN Installation :-

  • Click on Download CuDNN.
  • Login to the page. Set the login things up . Those are simple. You can also login with google account.
  • You will get this page . Click on the download you want. Iam using ubuntu 20 clicking on the first Download link.
  • Download these three. These will change on your ubuntu version. Search based on your os version and install.
  • sudo dpkg -i libcudnn8_8.1.1.33–1+cuda11.2_amd64.deb
  • Run this command for the run time version for de-packaging debian file.
  • The above command will change in your case based on the os version file you have installed.
  • sudo dpkg -i libcudnn8-dev_8.1.1.33–1+cuda11.2_amd64.deb
  • Run this command for the developer version for de-packaging debian file.
  • The above command will change in your case based on the os version file you have installed.

Restart the system . Everything should work fine. Incase any queries send a email . Or post a response here.

--

--