If you are using Debian 12 and have an Nvidia graphics card, installing the correct drivers is essential for getting the best performance out of your system.

Nvidia drivers allow your computer to use the full power of your graphics card, which is important for tasks like gaming, video editing, and 3D rendering.

In this guide, we will walk you through the steps to install Nvidia graphics drivers on Debian 12.

Step 1: Update Your System

Before installing any new software, it’s a good idea to make sure your system is up to date.

sudo apt update
sudo apt upgrade

This will update the list of available packages and upgrade any outdated software on your system.

Update Debian System
Update Debian System

Step 2: Identify Your Nvidia Graphics Card

To install the correct driver, you need to know which Nvidia graphics card you have, you can find this information by running the following command in the terminal:

lspci | grep -i nvidia

This command will list all the hardware connected to your system and filter out only the Nvidia-related entries. Look for the line that describes your graphics card, which will look something like this:

01:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)

In this example, the graphics card is a “GeForce GTX 1060 6GB“.

Step 3: Add the Non-Free Repository

Debian’s default repositories do not include proprietary software like Nvidia, you need to enable the non-free repository to install the Nvidia drivers.

Open the sources list file in a text editor:

sudo nano /etc/apt/sources.list

Look for lines that start with deb and end with main. Add non-free at the end of these lines.

For example:

deb http://deb.debian.org/debian bookworm main non-free
deb-src http://deb.debian.org/debian bookworm main non-free

Save the file and update the package list again:

sudo apt update

Step 4: Install the Nvidia Driver in Debian

Now that the non-free repository is enabled, you can install the Nvidia driver. The easiest way to do this is to use the nvidia-detect tool, which will recommend the best driver for your graphics card.

sudo apt install nvidia-detect
nvidia-detect

The output will look something like this:

Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)

It is recommended to install the
nvidia-driver
package.

In this example, the recommended package is nvidia-driver, so install it:

sudo apt install nvidia-driver

If nvidia-detect recommends a different package, replace nvidia-driver with the recommended package name. During the installation, you may be asked to confirm that you want to install the driver. Press Y and Enter to continue.

After the installation is complete, you need to reboot your system to load the new drivers:

sudo reboot

Once your system has restarted, you can verify that the Nvidia drivers are installed and working correctly.

nvidia-smi

This command will display information about your Nvidia graphics card, including the driver version and GPU usage. If you see this information, the drivers are installed correctly.

Troubleshooting

If you encounter any issues after installing the drivers, here are a few things you can try:

  • Black Screen After Reboot: If your screen goes black after rebooting, you may need to switch to a different terminal (e.g., CTRL + ALT + F2) and reinstall the drivers. You can also try using the nomodeset kernel parameter during boot.
  • Driver Not Loading: If the driver is not loading, make sure that the nvidia-kernel-dkms package is installed, which ensures that the Nvidia kernel module is built correctly for your system.
  • Incorrect Driver: If you installed the wrong driver, you can remove it using sudo apt remove nvidia-* and then install the correct driver.
Conclusion

Installing Nvidia graphics drivers on Debian 12 is a straightforward process once you know the steps. By following this guide, you should be able to get your Nvidia graphics card up and running with the correct drivers.

This will allow you to take full advantage of your hardware, whether you’re gaming, editing videos, or working with 3D graphics. If you run into any problems, the Debian community and Nvidia’s support resources are great places to seek help.

Similar Posts