Kali Linux

How to Install NVIDIA CUDA and cuDNN on Kali Linux

CUDA is a parallel computing platform and programming model. It allows the software to use GPUs for general-purpose computing.

CuDNN is CUDA Deep Neural Network. It is a GPU-accelerated library for deep neural networks. CuDNN provides highly tuned functions that arise frequently in deep neural network applications.

CUDA and cuDNN are required for TensorFlow to be able to use the NVIDIA GPU to accelerate the AI/ML codes.

In this article, we will show you how to install NVIDIA CUDA and cuDNN on Kali Linux.

Topic of Contents:

  1. Installing the NVIDIA GPU Drivers on Kali Linux
  2. Updating the APT Package Database Cache on Kali Linux
  3. Installing NVIDIA CUDA on Kali Linux
  4. Installing NVIDIA cuDNN on Kali Linux
  5. Conclusion

Installing the NVIDIA GPU Drivers on Kali Linux

Before you install CUDA and cuDNN on Kali Linux, you must install the NVIDIA GPU drivers on Kali Linux. If you need any assistance in installing the NVIDIA GPU drivers on Kali Linux, read this article.

Updating the APT Package Database Cache on Kali Linux

To update the APT package database cache on Kali Linux, run the following command:

$ sudo apt update

A screenshot of a computer Description automatically generated

Installing NVIDIA CUDA on Kali Linux

To install NVIDIA CUDA on Kali Linux, run the following command:

$ sudo apt install nvidia-cuda-toolkit

To confirm the installation, press Y and then press <Enter>.

CUDA and the required dependency packages are being downloaded from the Kali Linux package repositories. It takes a while to complete.

A screenshot of a computer screen Description automatically generated with medium confidence

CUDA and the required dependency packages are being installed. It takes a while to complete.

A screenshot of a computer Description automatically generated

At this point, CUDA should be installed on Kali Linux.

A screenshot of a computer Description automatically generated

As you can see, CUDA 11.8 is installed on Kali Linux.

$ nvcc --version

Installing NVIDIA cuDNN on Kali Linux

To install NVIDIA cuDNN on Kali Linux, run the following command:

$ sudo apt install nvidia-cudnn

Once you see the following window, press <Enter>.

A picture containing text, electronics, screenshot, multimedia Description automatically generated

Select “I Agree” and click on “OK”.

A picture containing text, screenshot, software, display Description automatically generated

NVIDIA cuDNN is being installed on Kali Linux. It takes a while to complete.

A screenshot of a computer Description automatically generated

The NVIDIA cuDNN libraries are being downloaded from the official website of NVIDIA. It takes a while to complete.

A screenshot of a computer Description automatically generated

The NVIDIA cuDNN libraries are being installed on Kali Linux. It takes a while to complete.

A screenshot of a computer Description automatically generated

At this point, NVIDIA cuDNN should be installed.

A screenshot of a computer screen Description automatically generated with medium confidence

Conclusion

We showed you how to install NVIDIA CUDA on Kali Linux. We also showed you how to install NVIDIA cuDNN on Kali Linux.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.