DKMS fails to recompile NVIDIA drivers on kernel update
Hi,
I am using Fedora 28, Gnome3. Lately after every kernel update (and kernel updates seem to happen on a weekly basis at least) dkms fails to auto-compile the NVIDIA driver. So I have to switch back to previous kernel, do systemctl set-default multi-user.target, reboot, re-install driver, systemctl set-default graphical.target, reboot and then everything is back. Today when the I've updated my system, I've notice the error on the driver mentioning something related to driver 396.24. That's strange, because I am using the latest NVIDIA driver 410.66. But when I look into /var/lib/dkms/nvidia, I see the following:
[xxx@yyy ~]$ ll /var/lib/dkms/nvidia/
total 16
drwxr-xr-x. 4 root root 4096 Oct 24 19:19 .
drwxr-xr-x. 3 root root 4096 May 31 00:02 ..
drwxr-xr-x. 6 root root 4096 Sep 23 18:01 396.24
drwxr-xr-x. 3 root root 4096 Oct 24 19:19 410.66
lrwxrwxrwx. 1 root root 37 May 31 00:03 kernel-4.16.12-300.fc28.x86_64-x86_64 -> 396.24/4.16.12-300.fc28.x86_64/x86_64
lrwxrwxrwx. 1 root root 37 Jun 12 23:04 kernel-4.16.14-300.fc28.x86_64-x86_64 -> 396.24/4.16.14-300.fc28.x86_64/x86_64
lrwxrwxrwx. 1 root root 37 Jun 21 01:27 kernel-4.16.16-300.fc28.x86_64-x86_64 -> 396.24/4.16.16-300.fc28.x86_64/x86_64
lrwxrwxrwx. 1 root root 37 Oct 24 19:19 kernel-4.18.16-200.fc28.x86_64-x86_64 -> 410.66/4.18.16-200.fc28.x86_64/x86_64
So, it looks like only the latest kernel is pointing to the newest driver, which is strange since it's been a few kernel updates since I am using 410.
Any idea what might be wrong?
I haven't found dkms that reliable. It has happened a few times that the PC ended up black and you have to boot with kernel parameters "nomodeset" and/or "3" and remove the dkms links manually and recompile.
But which link is correct and which one not? Would it actually be a good idea to boot into each kernel and compile driver 410.66, therefore removing 396.24 entirely?
Your shell should show if the symlink has a target or if it is broken. I would maybe remove everything and recompile with dkms. If you want to do it for older kernels you should be able to specify the kernel version for dkms, so that you don't actually have to boot all kernels. Check the dkms documentation.
I'd recommend that you switch to RPMfusion's nvidia driver. They use akmod to rebuild the modules, which has always worked for me. I know that this doesn't answer the question, but could be better long-term.