How To Install Nvidia Drivers on Debian 12
In this tutorial, we will show you how to install Nvidia Drivers on Debian 12. Nvidia graphics cards are widely used for various applications, including gaming, 3D rendering, and machine learning. Installing the correct drivers for your Nvidia card on Debian 12 is crucial for optimal performance and stability.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of Nvidia Drivers on a Debian 12 (Bookworm).
Prerequisites
- A server running one of the following operating systems: Debian 12 (Bookworm).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Nvidia Drivers.
- A user account with sudo privileges to execute administrative commands.
Install Nvidia Drivers on Debian 12 Bookworm
Step 1. Before installing any new software, it’s always a good practice to update the system’s package list. This ensures that you have the latest versions of all packages, which can help prevent compatibility issues. To update your system’s package list, open a terminal and run the following command:
sudo apt update sudo apt upgrade sudo apt install software-properties-common
Next, you need to enable the contrib
and non-free
repositories on your Debian system. These repositories contain packages that do not comply with the Debian Free Software Guidelines. However, they are necessary for installing proprietary drivers like Nvidia.
To enable these repositories, you can use the add-apt-repository
command as follows:
sudo add-apt-repository contrib non-free-firmware sudo apt update
Step 2. Installing Nvidia-Detect Utility.
The first step in installing Nvidia drivers on Debian is to install the nvidia-detect
utility. This utility checks for an Nvidia GPU in your system and recommends one of the non-free drivers for installation.
To install nvidia-detect
, run the following command:
sudo apt install nvidia-detect
After installing nvidia-detect
, you can run it to check which Nvidia driver is recommended for your system:
nvidia-detect
The utility will output the model of your Nvidia card and suggest the appropriate driver package to install.
Step 3. Installing Nvidia Drivers on Debian 12.
Based on the recommendation from nvidia-detect
, you can install the suggested Nvidia driver. For example, if nvidia-detect
recommends the nvidia-driver
package, you can install it with the following command:
sudo apt install nvidia-driver
After the installation, you need to reboot your system for the changes to take effect:
sudo systemctl reboot
After rebooting, you can verify the installation of the Nvidia driver by running the nvidia-settings
command. This command opens the Nvidia Settings panel, where you can view your driver settings and system information:
nvidia-settings
Step 4. Troubleshooting.
If you encounter issues during or after the installation of the Nvidia driver, there are several troubleshooting steps you can take.
- Nvidia Module Not Loaded
If the Nvidia module is not loaded, you might see errors related to the nvidia
module in your boot logs. Another symptom is the nvidia-settings
command not starting. To resolve this issue, you can sign the Nvidia modules and make them work with Secure Boot, or disable Secure Boot in your system’s BIOS.
- Black Screen After Installation
If you experience a black screen after installing the Nvidia driver, you can try adding the enable_mtrr_cleanup
and mtrr_spare_reg_nr=4
boot parameters. These parameters can show improvements on some systems.
Congratulations! You have successfully installed Nvidia Drivers. Thanks for using this tutorial for installing the latest version of Nvidia Drivers on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official Nvidia website.