Debian Bullseye (11) — Install Upstream NVIDIA Driver

Debian Bullseye (11) — Install Upstream NVIDIA Driver

My objective was to be able to enjoy some recent games, which on the Linux platform is usually done via Steam. However most games were not running at all.

While steam native games like Lara Croft: Tomb Raider; Deus Ex: Mankind Divided; Shadow of Mordor … work beautifully, I wanted to run Mass Effect 3, Destiny 2, Disintegration, Crysis 3, Halo Infinite, The Last of Us, …

I’ve also tried to run e.g. ESO in a Bottle, but that failed with an error whining about DirectX being unsupported. So I took a step back and looked at whether I even had the most recent driver for my nvidia card —actually I took several steps back and updated my BIOS as well though that be a tale for another day. It turns out Debian’s packages only go up to v470.

When checking apt, make sure all necessary repos are listed

$ cat /etc/apt/sources.list

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

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

Check for driver availability

$ apt search nvidia-driver

nvidia-driver/stable 470.161.03-1 amd64 NVIDIA metapackage

nvidia-driver-bin/stable 470.161.03-1 amd64 NVIDIA driver support binaries

nvidia-driver-libs/stable 470.161.03-1 amd64 NVIDIA metapackage (OpenGL/GLX/EGL/GLES libraries)

nvidia-kernel-dkms/stable 470.161.03-1 amd64 NVIDIA binary kernel module DKMS source

nvidia-kernel-source/stable 470.161.03-1 amd64 NVIDIA binary kernel module source

It’s that or the 390 driver …

Just in case we forgot which card we have in the first place, check your hardware

$ lspci | grep -i nvidia

01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP106 High Definition Audio Controller (rev a1)

Next, take a look at NVIDIA‘s Linux support

Excellent.
Now you can’t just install the driver, you have to (1) remove the existing driver, (2) disable the default Nouveau driver, (3) make sure kernel sources and headers are installed, …

Step by Step

Prepare the system

  1. Remove existing NVIDIA driver
  2. Deactivate the NOUVEAU driver
  3. Update initramfs
  4. Ascertain necessary sources are installed
  5. Set runlevel 3
  6. Reboot
  7. Install the new driver
  8. Set runlevel 5
  9. Reboot

BOOM DONE!

  1. Remove the driver and any residual files

# apt purge *nvidia*
# apt autoremove

—resist the urge to purge nouveau !

  1. Disable default NOUVEAU driver

# nano /etc/modprobe.d/blacklist-nouveau.conf

blacklist nouveau
options nouveau modeset=0

CTRL-o y; CTRL-x

# nano /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf

blacklist nouveau
options nouveau modeset=0

CTRL-o y; CTRL-x

  1. Update initram
    # update-initramfs -u

  2. Install kernel and header source files
    # apt install linux-image-$(uname -r)
    # apt install linux-headers-$(uname -r)

  3. Change runlevel from 5 to 3 else the installer won't run
    # systemctl set-default multi-user.target

  4. Reboot
    # systemctl reboot

NOTE
If you’re running a custom kernel or your system requires packages signature, or some other devil is in the details I’m not covering here, you’ll need to do a little homework i.e. read NVIDIA’s docs. To do that, run the driver script with the extract only parameter.

$ bash ./NVIDIA-Linux-x86_64-525.89.02.run --extract-only

It'll create a directory by the same name so you can peruse the READMEs - prerequisite is presence in the directory containing the script.

Reboot

The system will now boot into CLI.

Next, login …

Prerequisite is presence in the directory containing the driver install script
# bash ./NVIDIA-Linux-x86_64-525.89.02.run

Follow the bouncing ball (on-screen instructions) …

Revert to GUI runlevel 5
# systemctl set-default graphical.target

# systemctl reboot

.. and Voilà, there you go.

NOTE
One oddity I noticed is that in my XFCE4 DE, nvidia-settings did not show up in any of my application menus. No matter, it should be in your path. I don’t run it often so I care not to futz with HOW TO get it into the menu system.

No matter, just run it from CLI
$ /usr/bin/nvidia-settings

In the end, I’m writing this a couple of days after going through these steps so you may want to check my logic, understand what each command does and consider that against your specific setup and adjust accordingly.

Final Thoughts

nvidia-settings now shows more Graphics Clock levels than I recall seeing before. More significantly, the clock adjusts much more quickly than in previous versions such as the v390 driver I was running on my laptop (GeForce 780M). The GPU fan for the GTX 1060 desktop also doesn’t come on as often … there are less graphical artifacts on the screen when watching youtube. That's a bonus.

Most importantly, one mission accomplished: ESO in a Bottle now works!!

$ flatpak run com.usebottles.bottles
ESO now launches!

Initially, the game defaults to mouse & keyboard input, but after you login, you can go into the Settings and enable your gamepad.

The verdict is still out on getting Windoze games to work in Steam.


💡
Give something back, donate

Detlev Obst

Detlev Obst

I am an explorer who started in Germany then moved to the USA — traveled the globe from Amsterdam → Ubud → Auckland → Ayutthaya → Vancouver → Belo Horizonte 𓆃𓁳𓅟𓈗𓆸𓋹
3rd orbit from Sol, Milky Way, Laniakea