In this article, we will show you how to install the NVIDIA GPU drivers on Debian 12 “Bookworm”. So, let’s get started.
Topic of Contents:
- Enabling the Contrib and Non-Free Repositories on Debian 12
- Checking If NVIDIA GPU Is Installed on Your Debian 12 Machine
- Updating the Debian 12 Package Database Cache
- Installing the Linux Kernel Headers on Debian 12
- Installing the NVIDIA GPU Drivers on Debian 12
- Checking If the NVIDIA GPU Drivers Are Installed on Debian 12
- Conclusion
- References
Enabling Contrib and Non-Free Repositories on Debian 12
On Debian 12 “Bookworm”, the official main and non-free-firmware package repositories are enabled by default. To install the NVIDIA GPU drivers and the required dependency packages on Debian 12 “Bookworm”, you have to enable the official Debian 12 contrib and non-free package repositories as well.
To learn how to enable the contrib and non-free package repositories on Debian 12 “Bookworm”, read the article on How to Enable the contrib and non-free Repositories on Debian 12.
Checking If NVIDIA GPU Is Installed on Your Debian 12 Machine
You can check whether your Debian 12 machine has an NVIDIA GPU installed with the following command:
As you can see, we have an NVIDIA GeForce GTX 1050 Ti GPU installed on my Debian 12 machine. You may have a different NVIDIA GPU installed.
Debian 12 uses the open-source Nouveau GPU drivers by default if you have an NVIDIA GPU installed on your computer as you can see in the following screenshot:
$ lsmod | grep nouveau
Updating the Debian 12 Package Database Cache
To update the Debian 12 package database cache, run the following command:
Installing the Linux Kernel Headers on Debian 12
For the NVIDIA GPU Drivers kernel modules to be compiled on Debian 12, you need to have the Linux Kernel Headers installed on your Debian 12 machine.
To install the Linux Kernel Headers on Debian 12, run the following command:
To confirm the installation, press Y and then press <Enter>.
The Linux Kernel Headers and the required dependency packages are being downloaded. It takes a while to complete.
The Linux Kernel Headers and the required dependency packages are being installed. It takes a while to complete.
At this point, the Linux Kernel Headers should be installed on your Debian 12 machine.
Installing the NVIDIA GPU Drivers on Debian 12
To install the NVIDIA GPU drivers on your Debian 12 machine, run the following command:
To confirm the installation, press Y and then press <Enter>.
The NVIDIA GPU Drivers and the required dependency packages are being downloaded. It takes a while to complete.
The NVIDIA GPU Drivers and the required dependency packages are being installed. It takes a while to complete.
Press <Enter> once you see this prompt.
At this point, the NVIDIA GPU Drivers should be installed on your Debian 12 machine.
For the changes to take effect, reboot your Debian 12 machine with the following command:
Checking If the NVIDIA GPU Drivers Are Installed on Debian 12
Once your Debian 12 machine boots, you should see that Debian 12 is using the NVIDIA kernel modules instead of the open-source Nouveau kernel modules. It means that the NVIDIA GPU drivers are installed correctly and working as it should.
$ lsmod | grep nvidia
The “nvidia-smi” command can also be used to verify whether the NVIDIA GPU drivers are working correctly on Debian 12. If it is, the Debian 12 processes that are using the NVIDIA GPU should be listed. A lot of usage information on your NVIDIA GPU should also be listed.
You will find a new app which is the NVIDIA X Server Settings in the “Application Menu” of your Debian 12 desktop once the NVIDIA GPU drivers are installed as well. Click on the NVIDIA X Server Settings icon to open it.
The NVIDIA X Server Settings app should be opened. If the NVIDIA GPU drivers are working correctly, you will see a lot of information on your NVIDIA GPU in the NVIDIA X Server Settings app.
Conclusion
We showed you how to install the NVIDIA GPU drivers on the Debian 12 “Bookworm” desktop. We also showed you how to check if the NVIDIA GPU drivers are working correctly on Debian 12.