Installing the latest NVIDIA drivers on Debian 11 desktop allows you to unlock the full potential of your NVIDIA GPU. However, the default open-source Nouveau drivers that come pre-installed with Debian 11 are usually quite old. In this comprehensive guide, we will walk you through the entire process of installing the latest official NVIDIA drivers on a Debian 11 desktop step-by-step.
Prerequisites
Before you proceed, make sure your system meets the following requirements:
- Debian 11 operating system installed
- An NVIDIA GPU installed on your machine
- Secure Boot disabled in BIOS settings
- Internet connection to download packages
Step 1 – Remove Old NVIDIA Drivers (If Any)
If you already have the NVIDIA drivers installed from Debian 11 repositories, uninstall them first:
sudo apt remove --purge ‘^nvidia-‘
sudo apt autoremove
This will remove all the existing NVIDIA packages from your system.
Step 2 – Enable Contrib and Non-Free Repositories
The latest NVIDIA drivers require some packages from the contrib
and non-free
repositories of Debian. So you need to enable them first:
sudo apt install software-properties-common
sudo add-apt-repository contrib
sudo add-apt-repository non-free
This will enable both contrib
and non-free
repositories permanently.
Step 3 – Update Package Index
With the repositories enabled, update the APT package index to reflect the changes:
sudo apt update
Step 4 – Install Compiler Toolchain and Dependencies
To compile and install NVIDIA drivers, you need to install the compiler toolchain and required dependencies:
sudo apt install build-essential dkms linux-headers-$(uname -r)
The compiler toolchain includes GCC, make and other essential packages required for building kernel modules.
Step 5 – Download Latest NVIDIA Drivers
Now head over to the NVIDIA Driver Downloads page and select the latest driver version that supports your GPU from the drop-down list.
For example, if you have an RTX 3080 Ti, select the latest Game Ready driver listed there. Finally click on Download
to get the .run
installation file.
Step 6 – Switch to Console
Before installing NVIDIA drivers, you need to exit the GUI session. Press Ctrl + Alt + F3
to switch to console. Then login with your user credentials.
Step 7 – Disable Nouveau
The open-source Nouveau drivers often conflict with the official NVIDIA drivers. So it‘s better to disable Nouveau first:
sudo mkdir /etc/modprobe.d
echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/nvidia-blacklist.conf
echo "options nouveau modeset=0" | sudo tee -a /etc/modprobe.d/nvidia-blacklist.conf
Step 8 – Install NVIDIA Drivers
Navigate to the downloads folder where the NVIDIA .run
file is saved and make it executable:
cd ~/downloads
chmod +x NVIDIA-Linux-x86_64-515.65.01.run
Finally execute the file to initiate driver installation:
sudo ./NVIDIA-Linux-x86_64-515.65.01.run
- Press
Enter
to continue when prompted - Accept the EULA when asked
- Select
Yes
to automatically update xorg.conf file - Select
Yes
to rebuild initramfs image - Once Done, restart system to load new NVIDIA drivers
Step 9 – Restore GUI Target
Once your system reboots, switch back to GUI session:
sudo systemctl set-default graphical.target
Your Debian desktop should now boot straight into the graphical UI.
Step 10 – Verify Installation
To verify that NVIDIA drivers have installed properly, run:
nvidia-smi
This should show details about your NVIDIA GPU without any errors.
You can also check by running GPU accelerated applications like a OpenGL game or CUDA compute task.
And that‘s it! You now have the latest NVIDIA graphics drivers installed on your Debian 11 desktop. Have fun gaming or creating AI models!