Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / Desktop
posted at 25. Jan '25

Appeasing nVidia Gods With New Linux Kernel Sacrifice

I find it ironic that while nVidia is currently the first or second most valuable company on earth - well, according to western metrics, I have endless and constant issues with nVidia graphics drivers in Linux.

I guess I shouldn’t buy something with out of tree drivers at all.

To be fair, I criticize nVidia, but at the same time I want to use “unsupported” distribution (Debian 13 (Trixie/current testing) instead of Debian 12 Bookworm.

But hey, what I see on kernel.org is “stable: 6.12.11 2025-01-23”. Man, I just want to use the driver with latest stable kernel. I constantly read stuff like wait for the next release in two months. But in Windows I see updates and hotfixes constantly with new games or bugs.


I installed Debian Testing like yesterday, again, and I got 6.12.9-1 installed along with 6.11.5-1 which is shipped with the installed. Unfortunately Debian does not install kernel headers automatically, I had do to it manually in order to compile nvidia driver with dkms automatically.

Therefore I was left with 6.12.9-1 with kernel headers and 6.11.5-1 without and could not install them anymore. Here I have to also criticize Debian. Linux kernel used to be versioned in separate packages (it still seem it is) and available, but now 6.11.5-1 just vanished from the repositories, so I am just fucked. Sure, this is a testing distro, but I consider this a large oversight as nvidia has like 80% marketshare.

Well, anyways, I could compile my own kernel or just use an old one from stable Debian 12 which is 6.1.123-1. I did latter.

  1. I did not feel a motivation to add stable repo and mess with pinnings, so I downloaded the kernel and kernel headers manually:
  1. dpkg -i *.deb in a directory where DEB packages are downloaded

  2. apt install gcc-12 to appease linux-kbuild6.1 dependency

damon@rapthalia:~$ sudo apt install gcc-12
[sudo] heslo pre používateľa damon:
Možno to budete chcieť napraviť spustením „apt --fix-broken install“.
Unsatisfied dependencies:
 gcc-12 : Závisí na: cpp-12 (= 12.4.0-4) ale sa nebude inštalovať
          Závisí na: gcc-12-base (= 12.4.0-4) ale sa nebude inštalovať
          Závisí na: libgcc-12-dev (= 12.4.0-4) ale sa nebude inštalovať
Error: Nesplnené závislosti. Skúste spustiť „apt --fix-broken install“ bez balíkov (alebo navrhnite riešenie).
  1. run this apt --fix-broken install
damon@rapthalia:~$ sudo apt --fix-broken install
Opravujú sa závislosti... Hotovo
Installing dependencies:
  cpp-12  gcc-12  gcc-12-base  libgcc-12-dev

Navrhované balíky:
  gcc-12-locales  cpp-12-doc  gcc-12-multilib  gcc-12-doc

Summary:
  Upgrading: 0, Installing: 4, Removing: 0, Not Upgrading: 5
  3 iba čiastočne nainštalovaných alebo odstránených.
  Download size: 32,0 MB
  Space needed: 121 MB / 200 GB available

Continue? [Y/n] y
Získava sa:1 http://mirrors.nic.cz/debian trixie/main amd64 gcc-12-base amd64 12.4.0-4 [43,6 kB]
Získava sa:2 http://mirrors.nic.cz/debian trixie/main amd64 cpp-12 amd64 12.4.0-4 [9 885 kB]
Získava sa:3 http://mirrors.nic.cz/debian trixie/main amd64 libgcc-12-dev amd64 12.4.0-4 [2 434 kB]
Získava sa:4 http://mirrors.nic.cz/debian trixie/main amd64 gcc-12 amd64 12.4.0-4 [19,6 MB]
32,0 MB sa stiahlo za 9 s (3 484 kB/s)
Vyberá sa predtým nevybraný balík gcc-12-base:amd64.
(Číta sa databáza ... momentálne je nainštalovaných 275754 súborov alebo adresárov.
Preparing to unpack .../gcc-12-base_12.4.0-4_amd64.deb ...
Unpacking gcc-12-base:amd64 (12.4.0-4) ...
Vyberá sa predtým nevybraný balík cpp-12.
Preparing to unpack .../cpp-12_12.4.0-4_amd64.deb ...
Unpacking cpp-12 (12.4.0-4) ...
Vyberá sa predtým nevybraný balík libgcc-12-dev:amd64.
Preparing to unpack .../libgcc-12-dev_12.4.0-4_amd64.deb ...
Unpacking libgcc-12-dev:amd64 (12.4.0-4) ...
Vyberá sa predtým nevybraný balík gcc-12.
Preparing to unpack .../gcc-12_12.4.0-4_amd64.deb ...
Unpacking gcc-12 (12.4.0-4) ...
Nastavuje sa balík gcc-12-base:amd64 (12.4.0-4) ...
Nastavuje sa balík libgcc-12-dev:amd64 (12.4.0-4) ...
Nastavuje sa balík linux-image-6.1.0-29-amd64 (6.1.123-1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.1.0-29-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
Building module(s)...................
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-modeset.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-drm.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-uvm.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-peermem.ko
Cleaning build area...

nvidia-current.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-peermem.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/
depmod...
dkms autoinstall on 6.1.0-29-amd64/x86_64 succeeded for nvidia-current
dkms: autoinstall for kernel: 6.1.0-29-amd64.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.1.0-29-amd64
W: Couldn't identify type of root file system '/dev/mapper/debian' for fsck hook
Updating kernel version 6.1.0-29-amd64 in systemd-boot...
dkms: running auto installation service for kernel 6.1.0-29-amd64.
dkms: autoinstall for kernel: 6.1.0-29-amd64.
/etc/kernel/postinst.d/zz-systemd-boot:
Installing kernel version 6.1.0-29-amd64 in systemd-boot...
dkms: running auto installation service for kernel 6.1.0-29-amd64.
dkms: autoinstall for kernel: 6.1.0-29-amd64.
Nastavuje sa balík cpp-12 (12.4.0-4) ...
Nastavuje sa balík gcc-12 (12.4.0-4) ...
Nastavuje sa balík linux-compiler-gcc-12-x86 (6.1.123-1) ...
Nastavuje sa balík linux-headers-6.1.0-29-amd64 (6.1.123-1) ...
/etc/kernel/header_postinst.d/dkms:
Module nvidia-current-535.216.03 for kernel 6.1.0-29-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

nvidia-current.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-29-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-modeset.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-29-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-drm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-29-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-uvm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-29-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-current-peermem.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-29-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
dkms: running auto installation service for kernel 6.1.0-29-amd64.
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
Building module(s)...................
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-modeset.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-drm.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-uvm.ko
Signing module /var/lib/dkms/nvidia-current/535.216.03/build/nvidia-peermem.ko
Cleaning build area...

nvidia-current.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-current-peermem.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/
depmod...
dkms autoinstall on 6.1.0-29-amd64/x86_64 succeeded for nvidia-current
dkms: autoinstall for kernel: 6.1.0-29-amd64.
Processing triggers for man-db (2.13.0-1) ...
  1. while the output of the previous command indicate that nvidia kernel module was compiled for 6.1
root@rapthalia:/home/damon# dkms status
nvidia/570.86.10, 6.12.9-amd64, x86_64: installed

dkms status says otherwise

  1. compile it for 6.1
root@rapthalia:/home/damon# dkms build nvidia/570.86.10 -k 6.1.0-29-amd64
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
Building module(s)............
Signing module /var/lib/dkms/nvidia/570.86.10/build/nvidia.ko
Signing module /var/lib/dkms/nvidia/570.86.10/build/nvidia-modeset.ko
Signing module /var/lib/dkms/nvidia/570.86.10/build/nvidia-drm.ko
Signing module /var/lib/dkms/nvidia/570.86.10/build/nvidia-uvm.ko
Signing module /var/lib/dkms/nvidia/570.86.10/build/nvidia-peermem.ko
Cleaning build area...
  1. run update-initramfs -k all -u just to be sure, the previous command might not be necessary
root@rapthalia:/home/damon# update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-6.12.9-amd64
W: Couldn't identify type of root file system '/dev/mapper/debian' for fsck hook
Updating kernel version 6.12.9-amd64 in systemd-boot...
dkms: running auto installation service for kernel 6.12.9-amd64.
dkms: autoinstall for kernel: 6.12.9-amd64.
update-initramfs: Generating /boot/initrd.img-6.11.5-amd64
W: Couldn't identify type of root file system '/dev/mapper/debian' for fsck hook
Updating kernel version 6.11.5-amd64 in systemd-boot...
dkms: autoinstall for kernel 6.11.5-amd64 was skipped since the kernel headers for this kernel do not seem to be installed.
update-initramfs: Generating /boot/initrd.img-6.1.0-29-amd64
W: Couldn't identify type of root file system '/dev/mapper/debian' for fsck hook
Updating kernel version 6.1.0-29-amd64 in systemd-boot...
dkms: running auto installation service for kernel 6.1.0-29-amd64.

nvidia.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/

nvidia-peermem.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.1.0-29-amd64/updates/dkms/
depmod...
dkms autoinstall on 6.1.0-29-amd64/x86_64 succeeded for nvidia
dkms: autoinstall for kernel: 6.1.0-29-amd64.

Now restart and select the old kernel. With the systemd-boot press ESC after POST.

And that’s all, now SDDM should start just fine (since I have kernel headers and nvidia driver will load), there is no “kernel bug” in the boot output (no 6.12) and even Wayland seems to work without the stuttering (in 99% of cases).

I think debugging Linux desktop is getting harder these days. I don’t like accessing systemd logs, currently I no longer know how SDDM and consoles work. Xserver used to be easier, it ran on F7, F8 or F1. Nowadays something runs on F1 and F2, sometimes I cannot even switch to F3 to debug and just see a black screen and I have to restart with the power button. Therefore I don’t care as much right now. Maybe I should buy AMD or Intel graphics card, I was too long in nVidia land (since 2016).

And sorry for the numbers in the list, kramdown is kind of bad with blocks of source code while Ghostwriter shows it just fine. I’ll have to find a better gem to convert Markdown.

Add Comment