Nvidia kmods fail to build after updating to kernel 6.7.3

Today I have updated the kernel on Fedora 39 using sudo dnf upgrade --refresh, which completed successfully. However, after the reboot, I have been prompted with “NVIDIA kernel module missing. Falling back to nouveau”. At first, I have tried rebuilding the kernel modules using sudo akmods --force, since I saw that message many times when I restarted too early after a kernel update. Unfortunately, that failed too, giving the message:

Building and installing nvidia-kmod [FAILED]
Building rpms failed; see /var/cache/akmods/nvidia/535.129.03-1-for-6.7.3-200.fc39.x86_64.failed.log for details

When inspecting the file, I have found the following errors:

ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘__rcu_read_lock’
ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol ‘__rcu_read_unlock’

After some further research, I have found that this problem was also encountered on other distributions such as NixOS and Arch. It seems to me like it is a Nvidia problem and that a patch already exists, but I am not experienced enough to know how to apply it myself. As such, I wanted to know if other people had that experience too and if there is any update from the nvidia-kmod maintainers on this topic.

Note that I use Secure Boot, but this used to work perfectly fine until now.

Added f39

If this happens to be the nvidia drivers the repair is really simple

  1. sudo dnf remove kmod-nvidia-* to remove the failing driver
  2. sudo akmods --force to build and install the repaired driver
  3. Wait a couple minutes then reboot.

This kind of error may occur when the kernel modules build is interrupted by booting too soon after a kernel update.

Also, I note that akmod-nvidia is now version 545.29.06-3 and if you have not already upgraded to that version it may be a factor as well. I upgraded the nvidia driver at the same time as kernel 6.7.3 was installed and I have no problems with the drivers. Yes, I also use secure boot.

dnf list installed *nvidia*
Installed Packages
akmod-nvidia.x86_64                                          3:545.29.06-3.fc39                     @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.6.13-200.fc39.x86_64.x86_64                    3:545.29.06-2.fc39                     @@commandline                   
kmod-nvidia-6.6.14-200.fc39.x86_64.x86_64                    3:545.29.06-3.fc39                     @@commandline                   
kmod-nvidia-6.7.3-200.fc39.x86_64.x86_64                     3:545.29.06-3.fc39                     @@commandline                   
nvidia-gpu-firmware.noarch                                   20240115-2.fc39                        @updates                        
nvidia-modprobe.x86_64                                       3:545.29.06-1.fc39                     @rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64                                   3:545.29.06-1.fc39                     @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                       3:545.29.06-1.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                   3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                              3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.i686                           3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                         3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                           3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686                                3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                              3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64                             3:545.29.06-2.fc39                     @rpmfusion-nonfree-nvidia-driver
1 Like

Thank you very much! I have solved the problem!

First, I have tried the steps that you have mentioned, but I still had the same error in the end since the packages removed were only nvidia kmods from older kernel versions. The building process failed during sudo akmods --force with the same error message.

However, I found it strange that I did not receive the akmod-nvidia update to 545 until now. I also have CUDA installed from the official Nvidia repo, and that gave me a few conflict messages ever since adding it when performing a sudo dnf upgrade --refresh, so I ignored them until now. With the repo on, dnf found no updates available for Nvidia. I tried turning the Nvidia repo off, and dnf found the new akmods. I installed the updated driver, and now the kmods built correctly.

In conclusion, the problem was that my out-of-date nvidia driver 353 did not build on the new kernel, and I was not receiving the update to driver 545 due to the presence of the CUDA repo.

I have never used the cuda repo though many have and many have seen that having that repo enabled resulted in issues. I am glad that you found the issue and fixed it.

:+1: