Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Video] Proper way to Update Debian with Nvidia Drivers and DKMS?

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
VoltSpiral_
Posts: 2
Joined: 2023-01-30 22:38
Has thanked: 1 time

[Video] Proper way to Update Debian with Nvidia Drivers and DKMS?

#1 Post by VoltSpiral_ »

Debian Stable, 11.6, Secure Boot setup and working
Background info:
I pop into this every few months and last time , I had learned that when updating, instead of signing nvidia modules over and over, Debian does it automatically if you uncomment the helper script part of framework.conf at /etc/dkms, and put your secure boot mok keys in the right spots


Anwyay, I tried updating,
I got these weird errors


Code: Select all


    2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up nvidia-kernel-dkms (470.161.03-1) ... Removing old nvidia-current-470.161.03 DKMS files... Loading new nvidia-current-470.161.03 DKMS files... Error! DKMS tree already contains: nvidia-current-470.161.03 You cannot add the same module/version combo more than once. dpkg: error processing package nvidia-kernel-dkms (--configure): installed nvidia-kernel-dkms package post-installation script subprocess returned error exit status 3 dpkg: dependency problems prevent configuration of nvidia-driver: nvidia-driver depends on nvidia-kernel-dkms (= 470.161.03-1) | nvidia-kernel-470.161.03; however: Package nvidia-kernel-dkms is not configured yet. Package nvidia-kernel-470.161.03 is not installed. Package nvidia-kernel-dkms which provides nvidia-kernel-470.161.03 is not configured yet.

    dpkg: error processing package nvidia-driver (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: nvidia-kernel-dkms nvidia-driver

 


So, i was at a loss as to what this meant. My guess is that I am a noob when it comes to updating debian and doing it with nvidia drivers while in Secure Boot

Anyway I poked around though and discovered, in lib/modules/ , I have
5.10.0-11-amd64
5.10.0-13-amd64
5.10.0-15-amd64
5.10.0-18-amd64
5.10.0-21-amd64

But, I don't see /updates/dkms/ , with nvidia-current-drm.ko nvidia-current.ko nvidia-current-modeset.ko nvidia-current-uvm.ko

in any but the
5.10.0-11-amd64
directory. So those are only in /usr/lib/modules/5.10.0-11-amd64/updates/dkms
The others dont even have the updates folder?????

Well first, 11 is not ..the kernel i'm using...I'm using 21. 11 was purged with apt auto remove

Does this mean my current kernel, 21, isn't grabbing NVIDIA drivers from the update process and signing them, but just doing nothing?


So, I'm now totally confused- How do i update debian ,and get the latest nvidia drivers in the right spot(if that's indeed the error)? I saw stuff about dkms is supposed to recompile drivers but don't know what that fully means- it seems to be what my system did not do.

Or is everyone out there literally having to resign drivers over and over again/ I was told this isn't a thing anymore with dkms and updates and auto-signing.
Isn't sudo apt upgrade supposed to get you the newest Nvidia drivers if you already have some? I am having trouble seeing if i have the latest- and if i do, why they weren't put in the right kernel folder.

VoltSpiral_
Posts: 2
Joined: 2023-01-30 22:38
Has thanked: 1 time

Re: [Video] Proper way to Update Debian with Nvidia Drivers and DKMS?

#2 Post by VoltSpiral_ »

Wanted to return to this to say, it was solved. Took a lot of bugging people on as many different exchanges and forums as i could find for clues, and got it


i

cleared everything in /var/lib/dkms/nvidia-current/470.161.03 with rm
then deleted all the old modules in lib modules except 21 with rm.


used plocate dkmsnvidia*.ko , to make sure - and installed the drivers again, and did a sudo update-initramfs and rebooted


I THEN saw nvidia-smi and nvidia-settings still wasn't working, a bunch of googling - led to someone saying you have to turn off secure boot- i'm not doing that, since lol i'm trying to get it to work with Secure Boot-
so i re-signed the modules using my old steps from ages ago -sadly, manually

Code: Select all

$ VERSION="$(uname -r)" $ SHORT_VERSION="$(uname -r | cut -d . -f 1-2)" $ MODULES_DIR=/lib/modules/$VERSION $ KBUILD_DIR=/usr/lib/linux-kbuild-$SHORT_VERSION

Code: Select all

cd /usr/lib/modules/5.10.0-21-amd64/updates/dkms # note  to self , won't be 0-11 or 0-21 anymore,

sudo modinfo nvidia-current-drm

Code: Select all


    for i in *.ko ; do sudo --preserve-env=KBUILD_SIGN_PIN "$KBUILD_DIR"/scripts/sign-file sha256 /(where my keys are)/MOK.priv /(where my keys are)/MOK.der "$i" ; done

    sudo modinfo nvidia-current-drm
and and nvidia-smi and nvidia-settings now work I am all set.


So the old files for some reason messed up DKMS and the updates didn't clear them out- this is something we'll have to watch for.

As for auto-updating, i found i wasn't doing it right, and going forward you don't have to manually sign stuff like nvidia driver modules if using secure boot- via this comment here

https://old.reddit.com/r/debian/comment ... u/irm81ru/

Where DKMS is getting updated , but in Debian 11 and 12 there's ways to get it to auto work, supposedly. Time will tell if these can work without the old-module-messing-you-up thing

This is SOLVED, but i thought i'd come back and update people though apparently no one else runs Secure Boot just for the hell of it, on Debian, while also signing drivers

pythagorasmk
Posts: 148
Joined: 2015-01-18 03:40
Been thanked: 2 times

Re: [Video] Proper way to Update Debian with Nvidia Drivers and DKMS?

#3 Post by pythagorasmk »

I am using Nvidia drivers with secure boot. The drivers are from Debian official repository. For the auto signing problem I am using the solution described in the following link https://gist.github.com/lijikun/22be09e ... 9c7a147cc9. Please read the comments carefully.

Post Reply