Updating Nvidia Driver
Upgrading nvidia driver

While working on GPU the most painful thing is updating CUDA, Nvidia Driver and cuDNN. Doing the updates and getting all versions in sync can make anyone crazy. But there is a simple and easy process to update them.

In this blog post we will discuss the process to update Nvidia Driver, Cuda and cuDNN and keep all the version in sync.

The order of update would be:

  1. Update Nvidia Driver
  2. Update CUDA
  3. Update cuDNN

To briefly touch:

Cuda is a parallel computing platform and programming model developed by NVIDIA for general computing on graphical processing units (GPUs). With CUDA, developers are able to dramatically speed up computing applications by harnessing the power of GPUs. And cuDNN is a Cuda Deep neural network library which is accelerated on GPU’s. It’s built on underlying Cuda framework. nvcc output you get is for CUDA and nvidia-smi fetches nvidia display driver version and cuda associated with it.

First check available nvidia driver as:

sudo apt search nvidia-driver
How to search the available nvidia driver from command prompt.

Select the driver version you want to pick.

sudo apt install nvidia-driver-510

Once this is complete execute:

sudo reboot

After rebooting confirm the driver version using

nvidia-smi
nvidia-smi output to check updated driver version

Updating CUDA Version

Go to nvidia download to select the appropriate cuda version. I wanted to download cuda-11–6 update 1 for installing deep stream.

Selecting your os, cpu architecture, distribution, version and installer type as ‘runlocal’

Run below command to download the run file:

wget https://developer.download.nvidia.com/compute/cuda/11.6.1/local_installers/cuda_11.6.1_510.47.03_linux.run

And once download is complete execute the below command to start cuda updation:


sudo sh cuda_11.6.1_510.47.03_linux.run

Select continue:

installing cuda

Type Accept:

Unselect driver as it has been updated in step #1 and select install

installing cuda toolkit without driver.

Install cuDNN:

go to nvidia developer download page:
https://developer.nvidia.com/cudnn

Select download cuDNN:

Downloading cuDNN from website.

You have to login to developer program, it’s free incase you haven’t joined it yet.

After logging select T&C and Download appropriate version which you want to download:

Go to the download location of the file and untar the downloaded file:

tar -xvf cudnn-linux-x86_64–8.4.1.50_cuda11.6-archive.tar.xztar.xz

After untar run the following command:

$ sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda/include 
$ sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

So, In this blog we have seen a simple and straight forward way of updating all three drivers which we are required to keep your Deep Learning setup in sync and you can seamlessly use your GPU’s.

I hope this will be useful for you for sometime.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tanveer Khan

Tanveer Khan

41 Followers

Sr. Data Scientist with strong hands-on experience in building Real World Artificial Intelligence Based Solutions using NLP, Computer Vision and Edge Devices.