Kali Linux

How to Install the NVIDIA Drivers on Kali Linux

If you have an installed NVIDIA GPU on your Kali Linux machine, installing the NVIDIA GPU drivers is the first thing you might want to do to get the best graphics performance.

In this articlewe will show you how to install the official NVIDIA drivers on Kali Linux.

Topic of Contents:

  1. Checking If NVIDIA GPU Is Installed on Kali Linux Machine
  2. Why Use the Official NVIDIA Drivers Instead of Nouveau Drivers
  3. Updating the Kali Linux Packages
  4. Installing the Official NVIDIA Drivers on Kali Linux
  5. Checking If the NVIDIA Drivers Are Installed Correctly on Kali Linux
  6. Conclusion

Checking If NVIDIA GPU Is Installed on Kali Linux Machine

You can check whether your Kali Linux machine has an installed NVIDIA GPU from the command line.

To check whether your Kali Linux machine has an installed NVIDIA GPU, open a Terminal app and run the following command:

$ lspci | egrep -i '3d|vga'

Graphical user interface, text Description automatically generated

As you can see, we have an NVIDIA GeForce GTX 1050 Ti GPU installed on our Kali Linux machine. You will most likely have a different NVIDIA GPU installed on your computer.

Why Use the Official NVIDIA Drivers Instead of Nouveau Drivers

By default, Kali Linux uses the Nouveau drivers instead of the official NVIDIA drivers if you have an installed NVIDIA GPU on your computer.

$ lsmod | grep nvidia

$ lsmod | grep nouveau

A screenshot of a computer Description automatically generated with medium confidence

There are differences between the open-source Nouveau drivers and the official NVIDIA drivers. In terms of performance and features, the official NVIDIA drivers is a better pick.

Updating the Kali Linux Packages

Before you install the NVIDIA drivers on Kali Linux, we recommend you to update the Kali Linux to the latest version. If you need any assistance on that, read the article on How to Update the Kali Linux Packages.

Installing the Official NVIDIA Drivers on Kali Linux

Now that you updated your Kali Linux to the latest version, you are ready to install the official NVIDIA drivers on Kali Linux.

First, update the package repository cache of Kali Linux with the following command:

$ sudo apt update

A screenshot of a computer Description automatically generated

To install the official NVIDIA GPU drivers on Kali Linux, run the following command:

$ sudo apt install nvidia-driver

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

A screenshot of a computer Description automatically generated with medium confidence

The official NVIDIA drivers and the required dependency packages are being downloaded from the internet. It takes a while to complete.

Text Description automatically generated

The official NVIDIA drivers and the required dependency packages are being installed. It takes a while to complete.

A screenshot of a computer Description automatically generated with medium confidence

Once you see the following prompt, press <Tab> to select OK and press <Enter>.

A screenshot of a computer Description automatically generated

The installation should continue.

Text Description automatically generated

At this point, the official NVIDIA drivers should be installed.

A screenshot of a computer Description automatically generated with medium confidence

For the changes to take effect, restart your computer/laptop with the following command:

$ sudo reboot

Graphical user interface, application Description automatically generated

Checking If the NVIDIA Drivers Are Installed Correctly on Kali Linux

There are a few ways to verify whether the official NVIDIA drivers are working on Kali Linux. In this section, we will show you three of the most common methods.

The first method is to check whether the NVIDIA kernel modules are loaded instead of the NOUVEAU kernel modules.

To check whether the NVIDIA kernel modules are loaded instead of the NOUVEAU kernel modules, run the following commands:

$ lsmod | grep nouveau

$ lsmod | grep nvidia

You should see that the NVIDIA kernel modules are loaded instead of the NOUVEAU kernel modules as shown in the following screenshot. This means that the official NVIDIA drivers are working just fine on Kali Linux.

Text Description automatically generated

The second method is to run the nvidia-smi command from the command line and see if it prints the usage information about your NVIDIA GPU. If the official NVIDIA drivers are working, the command should print the NVIDIA GPU usage information correctly.

You can run the nvidia-smi command from the command line of Kali Linux as follows:

$ sudo nvidia-smi

Graphical user interface, text Description automatically generated

As you can see, the nvidia-smi command prints the NVIDIA GPU usage information correctly. So, the official NVIDIA drivers are working just fine.

The third method is to see whether the “NVIDIA X Server Settings” app is available and runs correctly.

You can search for the “NVIDIA X Server Settings” app in the “Application Menu” of Kali Linux. As you can see in the following screenshot, the “NVIDIA X Server Settings” app is available. Click to open it.

A screenshot of a computer Description automatically generated with medium confidence

As you can see, the “NVIDIA X Server Settings” app is running just fine and it shows up all the information about our NVIDIA GPU correctly. So, the official NVIDIA drivers are working just fine on Kali Linux.

Graphical user interface, text Description automatically generated

Conclusion

We showed you how to check whether you have an installed NVIDIA GPU on your Kali Linux machine. We also showed you how to install the official NVIDIA GPU drivers on Kali Linux. Finally, we showed you how to verify if the official NVIDIA GPU drivers are working 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.