Manually Installing NVIDIA Drivers in Debian 12 – Bookworm

Update (05/02/2025)

Upon further testing this setup, issues with electron apps and graphical errors remained persistent. Most of these errors appear to be related to the version of KDE Plasma 5 that Debian ships with. Unfortunately upgrading KDE and retaining stable operation would be difficult to say the least. I have since migrated to Fedora 41 which includes NVIDIA 565.77 and KDE Plasma 6.2.5 in its repositories where these issues are mostly resolved.

Preamble

So my CachyOS experiment lasted a grand total of… *drum-roll* 2 DAYS! As much as I love Arch and rolling release distros, they do come with caveats. The deal breaker for me was that no matter what I did or what method I used to install Docker Compose and the NVIDIA Container Toolkit, I couldn’t get GPU acceleration working in Docker. So I decided to jump ship back to Debian.

It may not be on the bleeding edge and plenty of people joke about packages being “stale” instead of stable, but the stability of Debian as a Desktop Workstation is 2nd to none in my opinion. Fedora coming in a close 2nd. And while the joke about Debian being stale is partly a lighthearted jab, there is truth to it. For example, the NVIDIA drivers in Bookworm’s repository are version 535.216.01 as of the 01/02/2025, whereas Arch includes the 565 driver with nvidia-utils by default. While for general use, this isn’t really an issue, some modern games require newer drivers to perform properly. One such case I ran across almost immediately was Dragon Age: The Veilguard.

On launch Dragon Age launched a prompt stating that the recommended driver was at least 565. Sure enough, the game performed like fetid ass with the stock proprietary driver regardless of which proton version is used. Looking at ProtonDB, other Debian users have solved this by installing Linux beta drivers from the beta branch.

WARNING

Before proceeding, be aware that manually installing drivers using these NVIDIA scripts is likely to break your system with subsequent firmware updates. I AM NOT RESPONSIBLE FOR ANY DATA LOSS. ALWAYS KEEP BACKUPS OF CRITICAL DATA! I’d suggest having a system in place that can roll back any changes in case of catastrophic failure as well as performing routine backups. I personally use automatic snapshots with Snapper and btrfs as per this guide by David Cortes and back up important documents to my NAS and the cloud.

I’m normally against skirting around using a package manager if it can be avoided. The recommended installation method for newer packages in Debian is to use backports from the experimental repository. However, even there the latest version is 545.23.06. If you decide to proceed, keep in mind that this guide does not cover signing drivers for use with Secure Boot. You can follow the installation instructions on the NVIDIA website if needed.

Driver updates will involve repeating these steps every time.

Download The Latest NVIDIA Driver

At the time of writing, the 565 driver can be downloaded from the NVIDIA Unix Archive.

Screenshot of the Unix Driver Archive from the NVIDIA website.

Install Dependencies

  1. Enable 32-bit and install 32-bit C libraries
  1. Install build dependencies

Prepare System for Installation

  1. Blacklist nouveau drivers
  1. Update kernel initramfs
  1. Reboot
  1. In the grub menu, select advanced options and enter recovery mode.
    • Enter password if prompted.

Install Drivers

  1. Navigate to your downloads folder or wherever you saved the .run file to
  1. Make script executable
  1. Run the installer
  1. Follow the prompts to install the 64 and 32-bit versions of the driver (important if you use Steam). Rebuild the initramfs when prompted.
  2. Reboot the system.

If all went smoothly you should now boot to your greeter with the NVIDIA driver installed.

Improving Wayland Compatibility

Choose to log in to an X11 session as we need to tweak a few settings to improve Wayland compatibility.

  1. Confirm that the NVIDIA driver is installed with the version you want:
  1. Ensure the GPU is using the NVIDIA driver:

You should see something similar to this. Look for nvidia in the Kernel driver in use section:

  1. Check if the driver is running in modesetting
  • If the output is “N”, enable it and update initramfs with:
  1. Install nvidia-suspend-common package with apt:
  1. Enable the helper scripts:
  1. Check if if PreserveVideoMemoryAllocations is enabled:
  1. If the value is 0, enable it with:

Improving Xwayland Compatibility in Mixed Refresh Rate Monitor Setups

I’ve found that certain apps that use legacy windowing systems can experience artifacting in KDE when using the proprietary NVIDIA driver, especially when using monitors with mixed resolutions/refresh rates.

If you are using matching monitors or a single display you can probably skip this step.

  1. In an X11 session, launch NVIDIA settings with super-user privileges.
  1. We need to change a few things in these sections:
Image showing the location of the X Server Display Configuration and OpenGL Settings tabs.
  1. Go to OpenGL Settings and uncheck “Sync to Vblank” and “Allow Flipping”
Image showing the location of the Sync to VBlank and Allow Flipping checkboxes.
  1. Under the “X Server Display Configuration” tab, select advanced.
Image showing the location of the advanced button
  1. Select Force Full Composition Pipeline checkbox for all displays.
    • note: Upon further reading Force Full Composition Pipeline is not recommended as it impacts game performance to reduce screen tearing. Force Composition should be enough.
Image showing the location of the Force Full Composition Pipeline checkbox
  1. Select apply and the Save to X Configuration File.
Image showing the location of the "Apply" and "Save to X Configuration File " buttons.
  1. Click Save
Image of the nvidia-settings save dialog. Default save location is /etcX11/xorg.conf
  1. Quit.
    • You can ignore the warning about unsaved changes if prompted.
  2. Open up /etc/xorg/xorg.conf with your favourite text editor
  1. Add “ Option "TripleBuffer" "On" ” below the Board Name in the Device section
  1. Check your monitor’s settings with xrandr . Mine looks like this:
  1. You’ll want to take the output name and refresh rate of the monitor that has the HIGHEST refresh rate and put them in the following command. Mine looks like this. Adjust accordingly:

For Mutter/GNOME:

for Kwin/KDE:


  1. Create a script to launch the config on startup:
  1. Add a script to enable triple buffering on boot
  1. Reboot

If all went smoothly, Wayland should be good to go!

Results

Sure enough, with the latest drivers installed, Dragon Age runs like a charm! Although I say that now, I’m only a few days in, so we’ll see how this setup holds up in the long run! Next steps will be to install Docker under Debian so I can play around with a few AI models. I’m keen to see how Deepseek compares to its competitors!

References

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.