Debian

How to Install the Latest NVIDIA Drivers on Debian 11 Desktop

An older version of the official NVIDIA drivers (version 470.161.03 on Debian 11 at the time of this writing) is available in the official package repository of Debian 11. If you need to install the latest version of the official NVIDIA drivers (version 525.89.02 at the time of this writing) on your Debian 11 desktop operating system, download it from the official website of NVIDIA and install it on your Debian 11 desktop machine.

In this article, we will show you how to download the latest version of the official NVIDIA drivers for Debian 11 and install it on a Debian 11 desktop operating system.

Topic of Contents:

  1. Remove the Old NVIDIA Drivers from Debian 11
  2. Enable the Official Contrib Repository on Debian 11
  3. Enable the Official Non-Free Repository on Debian 11
  4. Update the APT Package Repository Cache of Debian 11
  5. Install the Required Dependencies for the Latest Version of the Official NVIDIA Drivers on Debian 11
  6. Download the Latest Version of the Official NVIDIA Drivers for Debian 11 Desktop
  7. Make the Official NVIDIA Installer File Executable
  8. Switch the Default Debian 11 Target to Multi-User
  9. Login to Debian 11 from the Interactive Terminal Interface
  10. Disable the Open-Source Nouveau Drivers from Debian 11
  11. Install the Latest Version of the Official NVIDIA Drivers on Debian 11
  12. Switch the Default Debian 11 Target to Graphical
  13. Check If the Official NVIDIA Drivers Are Installed Correctly on the Debian 11 Desktop
  14. Uninstall the Official NVIDIA Drivers from the Debian 11 Desktop
  15. Conclusion
  16. References

Remove the Old NVIDIA Drivers from Debian 11

Before you attempt to install the latest version of the official NVIDIA drivers on your Debian 11 desktop, uninstall the NVIDIA drivers that you already installed from the official package repository of Debian 11. If you need any assistance on that, read the article on How to Clean Install the NVIDIA Drivers on Debian 11.

Enable the Official Contrib Repository on Debian 11

To install the required dependency packages to install the latest version of the official NVIDIA drivers, enable the official Debian 11 contrib package repository.

Run the following command to enable the official Debian 11 contrib package repository:

$ sudo apt-add-repository contrib

Enable the Official Non-Free Repository on Debian 11

To install the required dependency packages to install the latest version of the official NVIDIA drivers, enable the official Debian 11 “non-free” package repository.

Run the following command to enable the official Debian 11 non-free package repository:

$ sudo apt-add-repository non-free

Update the APT Package Repository Cache of Debian 11

Run the following command to update the APT package repository cache of Debian 11:

$ sudo apt update

The APT package repository cache of Debian 11 should be updated.

Install the Required Dependencies for the Latest Version of the Official NVIDIA Drivers on Debian 11

Run the following command to install the dependency packages that are required to install the latest version of the official NVIDIA drivers on the Debian 11 desktop:

$ sudo apt install linux-headers-$(uname -r) build-essential xorg pkg-config libvulkan1 libglvnd0 libglvnd-dev libvdpau1 firmware-misc-nonfree

To confirm the installation, press Y. Then, press <Enter>.

The APT package manager should start downloading all the required packages from the internet. It takes a while to complete.

The APT package manager should start installing all the required packages. It takes a while to complete.

At this point, all the dependency packages should be installed.

Download the Latest Version of the Official NVIDIA Drivers for Debian 11 Desktop

In this section, we will show you how to download the latest version of the official NVIDIA drivers for Debian 11.

To download the latest version of the official NVIDIA drivers, open a web browser and visit https://nvidia.com/en-us/drivers/unix.

Once the page loads, you should find the latest version of the official NVIDIA drivers in the “Latest Production Branch Version” section. At the time of this writing, the latest version of the official NVIDIA drivers is 525.89.02. To download it, click on the version number as marked in the following screenshot:

You will find all the NVIDIA graphics cards that this driver supports[1] in the “Supported Products” tab.

If your NVIDIA GPU is in the “Supported Products” list, click on “Download” to download it[2].

Click on “Agree & Download”.

Your browser should start downloading the latest version of the official NVIDIA Drivers installer file.

At this point, the latest version of the official NVIDIA drivers installer file should be downloaded.

Make the Official NVIDIA Installer File Executable

The latest version of the official NVIDIA drivers installer file should be downloaded in the ~/Downloads directory (usually the default downloads directory of your web browser) of your Debian 11 desktop.

$ cd ~/Downloads

$ ls -lh

Run the following command to make the NVIDIA drivers installer file executable:

$ chmod +x NVIDIA-Linux-x86_64-525.89.02.run

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The official NVIDIA drivers installer file should be executable.

$ ls -lh

Switch the Default Debian 11 Target to Multi-User

You can’t install the official NVIDIA drivers on your Debian 11 desktop as long as the graphical user interface is running. Disable the graphical user interface and enable the interactive terminal interface to install the official NVIDIA drivers on your Debian 11 desktop.

Run the following command to enable the interactive terminal interface and disable the graphical user interface of Debian 11:

$ sudo systemctl set-default multi-user.target

The default target of Debian 11 should be changed to “multi-user”.

Reboot your Debian 11 machine for the changes to take effect.

$ sudo reboot

The next time your Debian 11 machine boots, you will see an interactive terminal instead of the Debian 11 graphical user interface.

Login to Debian 11 from the Interactive Terminal Interface

To login to your Debian 11 machine from the interactive terminal, type in your login username and press <Enter>.

Then, type in your login password and press <Enter>.

You should be logged in to the interactive terminal of your Debian 11 machine.

Disable the Open-Source Nouveau Drivers from Debian 11

Before you can install the official NVIDIA drivers on your Debian 11 operating system, disable the open-source Nouveau drivers.

To disable the open-source Nouveau drivers on Debian 11, create a new /etc/modprobe.d/nvidia-installer-disable-nouveau.conf file as follows:

$ sudo nano /etc/modprobe.d/nvidia-installer-disable-nouveau.conf

Type in the following lines in the nvidia-installer-disable-nouveau.conf file:

blacklist nouveau

options nouveau modeset=0

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the nvidia-installer-disable-nouveau.conf file.

For the changes to take effect, restart your Debian 11 machine with the following command:

$ sudo reboot

Once the Debian 11 machine machine boots, you should see that the nouveau drivers are not being used anymore.

$ lsmod | grep nouveau

Install the Latest Version of the Official NVIDIA Drivers on Debian 11

At this point, your Debian 11 machine should be ready to install the latest version of the official NVIDIA drivers.

First, navigate to the ~/Downloads directory as follows:

$ cd ~/Downloads

You will find the official NVIDIA installer file here:

$ ls -lh

To install the latest version of the official NVIDIA drivers, run the installer file as follows:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The official NVIDIA drivers installer is being initialized. It takes a few seconds to complete.

The official NVIDIA drivers installer installs the latest version of the official NVIDIA drivers on your Debian 11 machine. It takes a few seconds to complete.

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

The installation should continue.

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

The latest version of the official NVIDIA drivers should be installed on your Debian 11 machine.

Press <Enter>.

For the changes to take effect, restart your Debian 11 machine with the following command:

$ sudo reboot

Once your Debian 11 machine boots, you can verify that the NVIDIA kernel modules are loaded with the following command. If the NVIDIA kernel modules are loaded, you will see similar outputs (as shown in the following screenshot):

$ lsmod | grep nvidia

Switch the Default Debian 11 Target to Graphical

Now, you can disable the interactive terminal interface of your Debian 11 machine and enable the graphical user interface with the following command:

$ sudo systemctl set-default graphical.target

The default target of Debian 11 should be changed to “graphical”.

For the changes to take effect, reboot your Debian 11 machine as follows:

$ sudo reboot

The next time your Debian 11 machine boots, you will see that the graphical user interface of Debian 11 is displayed instead of the interactive terminal interface.

Check If the Official NVIDIA Drivers Are Installed Correctly on the Debian 11 Desktop

To check whether the official NVIDIA drivers are working correctly on your Debian 11 desktop, search for the “NVIDIA X Server Settings” app in the “Application Menu” of your Debian 11 machine. Once you find it, click on the “NVIDIA X Server Settings” app icon to run it.

The “NVIDIA X Server Settings” app should be opened. If the official NVIDIA drivers are working, it correctly shows you all the information about your NVIDIA GPU.

You can also run the “nvidia-smi” command from a “Terminal” app and verify whether the official NVIDIA drivers are working.

$ nvidia-smi

If the official NVIDIA drivers are working, the “nvidia-smi” command shows you the usage information of your NVIDIA GPU and the version number of the installed NVIDIA and NVIDIA CUDA drivers.

Uninstall the Official NVIDIA Drivers from the Debian 11 Desktop

To uninstall the official NVIDIA drivers from your Debian 11 desktop machine, disable the graphical user interface and enable the interactive terminal interface again.

You also need to have the official NVIDIA installer file. If you removed it, you can download it again before enabling the interactive terminal interface.

Once you enable the interactive terminal interface and logged in to your Debian 11 machine from the interactive terminal interface, navigate to the ~/Downloads directory as follows:

$ cd ~/Downloads

You should find the official NVIDIA installer file here:

$ ls -lh

To uninstall the official NVIDIA drivers from your Debian 11 machine, run the official NVIDIA installer file as follows:

$ sudo ./NVIDIA-Linux-x86_64-525.89.02.run --uninstall

NOTE: Replace 525.89.02 with the version number of the NVIDIA drivers that you downloaded.

The NVIDIA drivers installer is being initialized. It takes a while to complete.

Once you see the following window, select “Yes” and press <Enter>.

The official NVIDIA drivers are being uninstalled from Debian 11. It takes a few seconds to complete.

At this point, the official NVIDIA drivers should be removed from your Debian 11 machine.

Select “OK” and press <Enter>.

Now, disable the interactive terminal interface of your Debian 11 machine and enable the graphical user interface. Then, reboot your Debian 11 machine for the changes to take effect.

$ sudo reboot

Conclusion

We showed you how to download the latest version of the official NVIDIA drivers for Debian 11. We also showed you how to install the latest version of the official NVIDIA drivers on a Debian 11 desktop and how to uninstall the latest version of the official NVIDIA drivers from the Debian 11 desktop as well.

References:

  1. Unix Drivers | NVIDIA
  2. NVIDIA Driver Installation Quickstart Guide :: NVIDIA Tesla Documentation
  3. NVIDIA GPU Drivers – Minimum Requirements

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.