How to Install the Latest NVIDIA Drivers on Debian 11

Choose a different version or distribution

Introduction

Before we begin talking about how to install the latest NVIDIA Drivers on Debian 11, let's briefly understand – What is NVIDIA Drivers?

NVIDIA drivers are software packages that enable the smooth functioning of NVIDIA graphics cards on computers. These drivers act as intermediaries, facilitating communication between the operating system and the hardware.

Regularly updated drivers enhance performance, stability, and compatibility, while also unlocking advanced features and optimizations for various applications and games. By installing the latest NVIDIA drivers, users can ensure an optimal and seamless graphics experience on their systems.

The official package repository for Debian 11 still offers an older version of the NVIDIA drivers (version 470.161.03 as of the time of this writing). The most recent version of the official NVIDIA drivers (version 525.89.02 as of this writing) must be downloaded and installed on a Debian 11 system by going to the NVIDIA official website.

In this tutorial, you will install the latest NVIDIA Drivers on Debian 11. We will also address a few FAQs on how to install the latest NVIDIA Drivers on Debian 11.

Advantages of NVIDIA Drivers

  1. Performance Boost: NVIDIA drivers enhance graphics performance, providing faster rendering and improved gameplay experience.
  2. Stability and Compatibility: With regular updates and optimizations, NVIDIA drivers ensure stability and compatibility with the latest games and applications.
  3. Advanced Graphics Features: NVIDIA drivers enable advanced graphics effects, such as ray tracing and DLSS, delivering realistic visuals and enhanced image quality.
  4. GPU Management Tools: NVIDIA drivers provide tools like NVIDIA Control Panel and GeForce Experience, allowing users to customize settings and optimize their GPU performance.
  5. Support for Multiple Platforms: NVIDIA drivers support various operating systems, including Windows, Linux, and macOS, ensuring compatibility across a wide range of devices and configurations.

Connecting to the Debian 11 Server using SSH

If you have access to the server hardware (where you installed Debian 11), connecting to your Debian 11 server system through SSH is not necessary. The newest version of the official NVIDIA drivers may be downloaded and installed on the server with just a mouse, keyboard, and monitor attached.

To install the most recent version of the official NVIDIA drivers, you must SSH into the Debian 11 server hardware if you don't already have access to it.

You can use the terminal application on your desktop or laptop to run the following command to SSH into your Debian 11 server machine:

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

Make sure to substitute your Debian 11 server machine's login username and hostname or IP address for the relevant values of <username> and <hostname/ip-address>.

Deleting the Old NVIDIA Drivers from the Debian 11 Server

Before you attempt to install the most recent version of the official NVIDIA drivers on your Debian 11 server, you must delete any NVIDIA drivers that you have previously installed from the Debian 11 official package repository.

The nouveau drivers ought to be activated when you remove the NVIDIA drivers from your Debian 11 server:

lsmod | grep nouveau

You must disable the nouveau drivers on your Debian 11 server in order to install the most recent version of the official NVIDIA drivers.

Create a new "nvidia-installer-disable-nouveau.conf" file in the /etc/modprobe.d/ directory as shown below to disable the nouveau drivers on your Debian 11 server:

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

In the "nvidia-installer-disable-nouveau.conf" file, enter the following text:

blacklist nouveau
options nouveau modeset=0

Press <Ctrl> + X, then Y and <Enter>, to save the "nvidia-installer-disable-nouveau.conf" file after you're finished.

Restart your Debian 11 server using the following command for the modifications to take effect:

sudo reboot

You should notice that the nouveau drivers are no longer being used once the Debian 11 server computer has booted.

lsmod | grep nouveau

Method 1: Using SFTP to Download the Most Recent Version of the Official NVIDIA Drivers for Linux and Transferring It to the Debian 11 Server

In this part, we'll demonstrate how to SFTP the installation file to the Debian 11 server and obtain the most recent NVIDIA drivers for Linux.

Use your preferred web browser to go to https://nvidia.com/en-us/drivers/unix to get the most recent NVIDIA drivers for Linux.

When the page loads, the "Latest Production Branch Version" section should have the most recent version of the official NVIDIA drivers. The most recent version of the official NVIDIA drivers is 525.89.02 as of this writing. Click on the version number as indicated in the below screenshot to download it:

You can see a list of every NVIDIA graphics card that this driver supports under the "Supported Products" tab.

Click "Download" if your NVIDIA GPU is listed under "Supported Products".

Select "Agree & Download" by clicking.

Your browser should prompt you to choose the folder or directory where you want to save the installer file for the NVIDIA GPU drivers. Click "Save" after selecting a folder or directory of your choice.

The most recent version of the installer for the official NVIDIA drivers is being downloaded. It may take a while.

The most recent installer file for the official NVIDIA drivers has now been downloaded.

As seen in the accompanying screenshot, we downloaded the official NVIDIA drivers installer file and saved it in the "Downloads" folder.

You now need to upload the most recent version of the official NVIDIA drivers installer file to your Debian 11 server. SFTP is among the simplest methods for transferring the file to your Debian 11 server.

Method 2: Downloading the Most Recent Version of the Official NVIDIA Drivers on the Debian 11 Server via CURL

This section will demonstrate how to update the official NVIDIA drivers on your Debian 11 system using CURL. The most recent official NVIDIA drivers for Debian 11 can also be downloaded using this approach.

You must be aware of the most recent official NVIDIA drivers' version number for this method to function. On the official NVIDIA drivers for Linux download page, you may get this information. The most recent version of the official NVIDIA drivers is 525.89.02 as of this writing. By the time you finish reading this article, the version number may have changed. When reading this article, be sure to change this version number with the most recent NVIDIA drivers version number that is currently available.

If you haven't already, you must install CURL immediately.

First, run the following command to update the cache for the APT package repository:

sudo apt update

Run the following command on your Debian 11 server to install CURL:

sudo apt install curl

Press Y and then <Enter> to approve the installation.

You should install CURL.

In order to simplify and modularize the download process, you must now set a few environment variables.

The BASE_URL environment variable should first be set as follows:

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

The DRIVER_VERSION environment variable should then be set. The version number of the official NVIDIA drivers you intend to download should be the value of this environment variable.

export DRIVER_VERSION=525.89.02

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

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

The installer file for the official NVIDIA drivers should begin downloading thanks to curl. It takes some time to finish.

CURL should now have finished downloading the installer file for the official NVIDIA drivers.

As you can see in the following screenshot, the official NVIDIA drivers installer file needs to be saved in the current working directory:

ls -lh

Installing the Neccessary Dependency Packages for the Most Recent Version of the Official NVIDIA Drivers

You must install the necessary dependency packages on your Debian 11 server in order for the most recent version of the official NVIDIA drivers to function.

Run the following command to install all the dependency packages necessary for the most recent official NVIDIA drivers to function on your Debian 11 server:

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

Press Y to confirm the installation. then click <Enter>.

Downloads of all necessary dependency packages have begun. It takes some time to finish.

All the necessary packages should now be installed.

Installing the Most Recent Version of the Official NVIDIA Drivers on the Debian 11 Server

The current working directory should hold the installer file for the official NVIDIA drivers. But as you can see in the following screenshot, it's not executable by default:

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: The version number of the NVIDIA drivers that you downloaded should be used in lieu of 525.89.02.

The installer file for the official NVIDIA drivers must be executable.

ls -lh

Run the installer file as directed to install the most recent version of the official NVIDIA drivers:

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

Note: The version number of the NVIDIA drivers that you downloaded should be used in lieu of 525.89.02.

The NVIDIA driver installer is starting. It takes a short while to finish.

The most recent official NVIDIA drivers are being installed on your Debian 11 server by the official NVIDIA drivers installer. It takes a short while to finish.

Select Yes and press <Enter> when you see the following window.

The installation should go on.

Select Yes and press <Enter> when you see the following window.

The most recent version of the official NVIDIA drivers should be installed.

Press <Enter>.

Restart your Debian 11 server machine using the following command for the modifications to take effect:

sudo reboot

Verifying If the Most Recent Version of the Official NVIDIA Drivers Is Installed Correctly on the Debian 11 Server

You can run the following command to see if the nvidia kernel modules are used once your Debian 11 server has booted. The most recent version of the official NVIDIA GPU drivers should function just fine if the command displays output similar to those in the accompanying screenshot.

lsmod | grep nvidia

Using the "nvidia-smi" command, you may also learn how your NVIDIA GPU is being used. This command's output also confirms that the most recent official NVIDIA GPU drivers have been appropriately installed.

nvidia-smi

Removing the Most Recent Version of the Official NVIDIA Drivers from the Debian 11 Server

You need the NVIDIA drivers installer file that you used to install the most recent version of the official NVIDIA drivers in order to remove it from your Debian 11 server.

ls -lh

Run the command below on your Debian 11 server to remove the most recent NVIDIA official drivers:

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

Note: The version number of the NVIDIA drivers that you downloaded should be used in lieu of 525.89.02.

The initialization of the NVIDIA drivers installer has begun. It takes some time to finish.

Once you see the next window, click Yes and press <Enter>.

The most recent NVIDIA official drivers are being removed. It takes a short while to finish.

The most recent NVIDIA official drivers must to be taken from your Debian 11 server at this point.

Click OK and press <Enter>.

Restart your Debian 11 server using the following command for the modifications to take effect:

sudo reboot

As you can see in the accompanying screenshot, the nvidia kernel module shouldn't be loaded after your Debian 11 server has started up. This indicates that the most recent NVIDIA official drivers has been removed:

lsmod | grep nvidia

FAQs to Install the Latest NVIDIA Drivers on Debian 11 Servers

How can I determine the version of the NVIDIA drivers currently installed on my Debian 11 server? 

You can use the command nvidia-smi to check the current version of the NVIDIA drivers installed on your Debian 11 server.

What is the recommended method to install the most recent NVIDIA drivers on Debian 11 servers? 

The recommended method is to use the official NVIDIA installer, which can be downloaded from the NVIDIA website. It provides an automated way to install the latest drivers on Debian 11.

Are there any prerequisites or dependencies to consider before installing the most recent NVIDIA drivers?

Before installation, ensure that you have kernel headers, build-essential packages, and necessary dependencies like DKMS (Dynamic Kernel Module Support) installed. These can be obtained through the package manager.

Can I install the NVIDIA drivers on Debian 11 servers using the package manager? 

While it is possible to install NVIDIA drivers through the package manager, it may not always provide the most recent version. Therefore, using the official NVIDIA installer is often recommended.

How can I run the official NVIDIA installer on Debian 11 servers? 

To run the official NVIDIA installer, first, disable the Nouveau driver by adding "nouveau.modeset=0" to the kernel boot parameters. Then, switch to a terminal, stop the display manager, execute the installer script with root privileges, and follow the prompts.

Will the NVIDIA drivers continue to receive updates via the package manager after installation? 

No, it is generally recommended to refrain from updating the NVIDIA drivers through the package manager. Instead, use the official NVIDIA installer or follow their documentation for upgrading to newer versions.

Is it recommended to periodically update the NVIDIA drivers on Debian 11 servers? 

Yes, periodic updates of NVIDIA drivers are recommended as they often include bug fixes, performance enhancements, and compatibility improvements. It ensures ongoing stability and optimal performance for your graphics hardware.

Conclusion

We demonstrated to you how to download the most recent NVIDIA drivers for Debian 11 servers. Along with installing the most recent version of the official NVIDIA drivers on Debian 11 servers, we also demonstrated how to remove it from the Debian 11 servers.

If you have any queries or doubts, please leave them in the comment below. We'll be happy to address them.