Nvidia drivers not surviving kernel update

oldfart

Well-Known Member
May 14, 2019
45
4
48
71
Every time the kernel is updated, I have to re-install the nvidia divers, they do not survive the update.
I install them by:
./$(ls -t NVIDIA-Linux-x86_64-580.126.18.run | head -n 1) --dkms --disable-nouveau --kernel-module-type proprietary --no-install-libglvnd

(the GPU - NVIDIA GeForce GTX 960 is to be shared with an LXC)

if I do a dkms status (or -status) i get dkms: command not found

any ideas please?
 
I had this same issue with my Debian 13 Docker VM. To fix this you need to install dkms and the matching headers for your new kernel:

Code:
apt install dkms pve-headers-$(uname -r)

Then re-run the .run installer as before. After that, verify DKMS is tracking it:

Code:
/usr/sbin/dkms status

Note: dkms lives in /usr/sbin/ so if it's not in your PATH, call it with the full path interactively. Kernel update hooks run as root, which has /usr/sbin in PATH, so automatic rebuilds on kernel updates will work correctly once DKMS and the right headers are in place. Going forward after a kernel update, when Proxmox updates the kernel, you'll also need to make sure the new headers get installed. You can automate that by ensuring pve-headers (the meta-package, without the version suffix) is installed. It will pull in headers for each new PVE kernel automatically:

Code:
apt install pve-headers

That's the piece that makes DKMS rebuilds survive kernel updates without manual intervention.
 
  • Like
Reactions: oldfart
thank you, the problem is not with a VM but the pve node, the headers are installed with the kernel update (I think)?
 
I understood that this is the PVE node, not a VM, I was just sharing that I had a similar problem, but since Proxmox is based on Debian the answer is mostly the same. FYI, the kernel headers are not normally installed with an update unless you install the meta package.

Depending on your use case you may want to consider a VM instead of an LXC. I pass the GPU through to the VM, install the Nvidia toolkit inside the VM, then all of my docker images can share the GPU. I have Ollama/OpenwebUI, Immich, PaperlessNGX, Whisper, and Frigate all sharing the same GPU (RTX 200 Ada in my case)