Debian

How to Install the Latest NVIDIA Drivers on Debian 11 Servers

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 Debian 11, you have to download it from the official website of NVIDIA and install it on your Debian 11 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 headless (without an installed graphical user interface) Debian 11 server.

Topic of Contents:

  1. Connecting to the Debian 11 Server via SSH
  2. Removing the Old NVIDIA Drivers from the Debian 11 Server
  3. Disabling the Nouveau Drivers on the Debian 11 Server
  4. Method 1: Downloading the Latest Version of the Official NVIDIA Drivers for Linux and Transfering It to the Debian 11 Server via SFTP
  5. Method 2: Using CURL to Download the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server
  6. Installing the Required Dependency Packages for the Latest Version of the Official NVIDIA Drivers
  7. Installing the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server
  8. Checking If the Latest Version of the official NVIDIA Drivers Is Installed Correctly on the Debian 11 Server
  9. Uninstalling the Latest Version of the Official NVIDIA Drivers from the Debian 11 Server
  10. Conclusion
  11. References

Connecting to the Debian 11 Server via SSH

Connecting to your Debian 11 server machine via SSH is optional if you have an access to the server hardware (where you installed the Debian 11). You can just attach a mouse, a keyboard, and a monitor to the server and download and install the latest version of the official NVIDIA drivers on it.

If you don’t have an access to the Debian 11 server hardware, you need to SSH into it to install the latest version of the official NVIDIA drivers.

To SSH into your Debian 11 server machine, you can run the following command from a terminal app of your desktop/laptop from which you want to access it:

$ ssh <username>@<hostname/ip-address>

Make sure to replace the <username> and <hostname/ip-address> with the login username and domain name or IP address of your Debian 11 server machine, respectively.

If you’re using Windows 10 or Windows 11 and you need any assistance in connecting to your Debian 11 server machine via SSH, read the article on How to SSH into the Linux Servers from Windows 10/11.

Removing the Old NVIDIA Drivers from the Debian 11 Server

Before you attempt to install the latest version of the official NVIDIA drivers on your Debian 11 server, you must 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.

Disabling the Nouveau Drivers on the Debian 11 Server

Once you uninstall the NVIDIA drivers from your Debian 11 server, the nouveau drivers should be activated as you can see in the following screenshot:

$ lsmod | grep nouveau

To install the latest version of the official NVIDIA drivers, you have to disable the nouveau drivers on your Debian 11 server.

To disable the nouveau drivers on your Debian 11 server, create a new “nvidia-installer-disable-nouveau.conf” file in the /etc/modprobe.d/ directory 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 server with the following command:

$ sudo reboot

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

$ lsmod | grep nouveau

Method 1: Downloading the Latest Version of the Official NVIDIA Drivers for Linux and Transfering It to the Debian 11 Server via SFTP

In this section, we will show you how to download the latest version of the official NVIDIA drivers for Linux and transfer the installer file to the Debian 11 server via SFTP.

To download the latest version of the official NVIDIA drivers for Linux, visit https://nvidia.com/en-us/drivers/unix from your favorite web browser.

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:

In the “Supported Products” tab, you will find all the NVIDIA graphics cards that this driver supports.

If your NVIDIA GPU is in the “Supported Products” list, click on “Download”.

Click on “Agree & Download”.

Your browser should ask you to select a folder/directory where you want to save the NVIDIA GPU drivers installer file. Select a folder/directory of your choice and click on “Save”.

The latest version of the official NVIDIA drivers installer file is being downloaded. It takes a while to complete.

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

We saved the official NVIDIA drivers installer file in the “Downloads” folder as you can see in the following screenshot:

Now that the latest version of the official NVIDIA drivers installer file is downloaded, you have to transfer this file to your Debian 11 server. One of the easiest ways to transfer the file to your Debian 11 server is via SFTP. To learn how to transfer the file to your Debian 11 server via SFTP, read the article on How Do I Enable the SFTP on Synology NAS?

Method 2: Using CURL to Download the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server

In this section, we will show you how to download the latest version of the official NVIDIA drivers on your Debian 11 server via CURL. This is another method of downloading the latest version of the official NVIDIA drivers on Debian 11.

For this method to work, you need to know the version number of the latest official NVIDIA drivers. You will find this information on the official NVIDIA drivers for Linux download page. At the time of this writing, the latest version of the official NVIDIA drivers is 525.89.02. The version number may be different by the time you read this article. So, make sure to replace this version number with the available latest NVIDIA drivers version number when you read this article.

Now, you have to install CURL if you don’t have it installed yet.

First, update the APT package repository cache with the following command:

$ sudo apt update

To install CURL on your Debian 11 server, run the following command:

$ sudo apt install curl

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

CURL should be installed.

Now, you have to set some environment variables to make the download process a bit easier and modular.

First, set the BASE_URL environment variable as follows:

$ export BASE_URL=https://us.download.nvidia.com/XFree86/Linux-x86_64

Next, set the DRIVER_VERSION environment variable. The value of this environment variable should be the version number of the official NVIDIA drivers that you want to download.

$ export DRIVER_VERSION=525.89.02

Finally, to download the latest version of the official NVIDIA drivers on your Debian 11 server with CURL, run the following command:

$ curl -fSl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run

CURL should start downloading the official NVIDIA drivers installer file. It takes a while to complete.

At this point, CURL should finish downloading the official NVIDIA drivers installer file.

The official NVIDIA drivers installer file should be saved in the current working directory as you can see in the following screenshot:

$ ls -lh

Installing the Required Dependency Packages for the Latest Version of the Official NVIDIA Drivers

For the latest version of the official NVIDIA drivers to work on your Debian 11 server, you have to install the required dependency packages on your Debian 11 server.

To install all the required dependency packages on your Debian 11 server for the latest version of the official NVIDIA drivers to work, run the following command:

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

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

All the required dependency packages are being downloaded. It takes a while to complete.

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

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

Installing the Latest Version of the Official NVIDIA Drivers on the Debian 11 Server

The official NVIDIA drivers installer file should be saved in the current working directory. But it’s not executable by default as you can see in the following screenshot:

$ ls -lh

To make the NVIDIA drivers installer file executable, run the following command:

$ 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

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 NVIDIA drivers installer is being initialized. It takes a few seconds to complete.

The official NVIDIA drivers installer is installing the latest version of the official NVIDIA drivers on your Debian 11 server. 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.

Press <Enter>.

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

$ sudo reboot

Checking If the Latest Version of the Official NVIDIA Drivers Is Installed Correctly on the Debian 11 Server

Once your Debian 11 server boots, you can verify whether the nvidia kernel modules are used with the following command. If the command displays similar outputs (as shown in the following screenshot), the latest version of the official NVIDIA GPU drivers should be working just fine:

$ lsmod | grep nvidia

You can also find the usage information of your NVIDIA GPU using the “nvidia-smi” command. The output of this command also verifies that the latest version of the official NVIDIA GPU drivers is installed correctly.

$ nvidia-smi

Uninstalling the Latest Version of the Official NVIDIA Drivers from the Debian 11 Server

To uninstall the latest version of the official NVIDIA drivers from your Debian 11 server, you need the NVIDIA drivers installer file which you used to install the latest version of the official NVIDIA drivers.

$ ls -lh

To uninstall the latest version of the official NVIDIA drivers from your Debian 11 server, run the following command:

$ 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 latest version of the official NVIDIA drivers is being uninstalled. It takes a few seconds to complete.

At this point, the latest version of the official NVIDIA drivers should be removed from your Debian 11 server.

Select OK and press <Enter>.

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

$ sudo reboot

Once your Debian 11 server boots, the nvidia kernel module should not be loaded as you can see in the following screenshot. This means the latest version of the official NVIDIA drivers is removed:

$ lsmod | grep nvidia

Conclusion

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

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.