In the recent days, my laptop (Lenovo X1 Extreme 2nd gen) falls back to noveau. Secureboot is disabled. When I boot with the 6.9.5-200.fc40.x86_64 kernel, the nvidia driver is loaded, but not with the 6.9.6 kernel.
I think it’s because the kernel module isn’t available for that kernel version. dnf search kmod-nvidia shows:
Last metadata expiration check: 1:10:58 ago on Mo 01 Jul 2024 18:06:44 CEST.
============================ Name Matched: kmod-nvidia ============================
kmod-nvidia-6.9.4-200.fc40.x86_64.x86_64 : nvidia kernel module(s) for
: 6.9.4-200.fc40.x86_64
kmod-nvidia-6.9.5-200.fc40.x86_64.x86_64 : nvidia kernel module(s) for
: 6.9.5-200.fc40.x86_64
sudo kmod remove 'kmod-nvidia-*' says invalid command 'remove'. I’m currently booted into the older kernel, so nvidia-smi works. I’ll try the newer kernel tomorrow.
That was posted as an erroneous command.
It should have been simply sudo akmods --force since the kmod-nvidia-6.9.6… package was not shown with the dnf search command.
It would appear that the reboot after the update which installed the 6.9.6 kernel may have been done too soon after the update completed and thus interrupted the normal build and install of the related kmod-nvidia package.
If the sudo akmods --force command does not build and install the ‘kmod-nvidia-6.9.6…’ package then try it as sudo akmods --force --rebuild.
Should have been sudo dnf remove kmod-nvidia-\* to remove those packages. However, since the kmod-nvidia-6.9.6… package was not installed, the removal of the other packages for older kernels was not warranted.
FYI if you run akmods yourself then you do not need to wait 5 minutes.
The 5 minute advice is to allow a background build to complete when you do an update. Which is not the case here.
Yes, it would remove kmod-nvidia. The kmod-nvidia package should not be installed anyway since the user should only install akmod-nvidia (and its dependencies) or kmod-nvidia, and kmod-nvidia seems not intended for fedora anyway but for the older kernels on RHEL or Centos.
No, it would not remove akmod-nvidia.
I have used that command numerous times and since kmod-nvidia-N.N.N… is a package that is locally compiled it removes nothing except the named packages.
The reported error seems to be caused by not having the akmod-nvidia package so the new kernel modules cannot be compiled.
Personally, I always try to suggest removing only the kmod-nvidia-N.N.N… package for the kernel that is having the problem then running the akmods command. It is only recently that I became aware of the --rebuild option that should remove existing modules and rebuild them. The man page is extremely sparse on information on what akmods does and how to use it.