Cannot build open Nvidia Open Kernel modules | Silverblue | RPMFusion

While updating to the latest fedora silverblue commit, I have troubles layering the nvidia akmods open package, because a makefile error with the latest kernel: 6.10.3-200.fc40.x86_64.

The following output is generated:

Aug 10 09:41:18 zbook rpm-ostree(akmod-nvidia-open.post)[17786]: Building /usr/src/akmods/nvidia-open-kmod-550.76-1.fc40.src.rpm for kernel 6.10.3-200.fc40.x86_64
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:   495 |         NV_MEMDBG_ADD(ptr, size);
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:       |                                 ^
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:   531 |         NV_MEMDBG_ADD(ptr, size);
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:       |                                 ^
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:   548 |         NV_MEMDBG_ADD(ptr, size);
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:       |                                 ^
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/common/inc/nv-linux.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:   678 |         NV_MEMDBG_ADD(ptr, page_count * PAGE_SIZE);
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:       |                                                   ^
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/nvidia/nv-kthread-q.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.76/_kmod_build_6.10.3-200.fc40.x86_64/kernel-open/nvidia/nv-kthread-q.>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:   179 |     const static unsigned attempts = 3;
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]:       |     ^~~~~
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: make[3]: *** [/usr/src/kernels/6.10.3-200.fc40.x86_64/Makefile:1946: /tmp/akmodsbuild.hLRwqr45/BUILD/nvidia-open-kmod-550.7>
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: make[2]: *** [Makefile:252: __sub-make] Error 2
Aug 10 09:43:22 zbook rpm-ostree(akmod-nvidia-open.post)[33865]: make[2]: Leaving directory '/usr/src/kernels/6.10.3-200.fc40.x86_64'

Did anyone else figure the compilation issue out?

const static unsigned attempts = 3;

This definitely is an illegal statement in C however most compilers should accept it just fine. The correct statement would be static const ..., static going first. I don’t know what compiler you have installed but consider switching it out to a different one (gcc or clang), that might solve the compilation error.

It looks like this issue was fixed in 560.28.03.

2 Likes

nvidia-open-kmod-550.76-1.fc40 is an old package, update to the latest package nvidia-open-555.58.02-1.fc40

1 Like

I’ve enabled the rpmfusion rawhide repository that is supposed to provide the 560 driver, yet I still receive the same error:

Aug 10 19:49:24 zbook rpm-ostree(akmod-nvidia-open.post)[33848]: make[3]: *** [/usr/src/kernels/6.10.3-200.fc40.x86_64/Makefile:1946: /tmp/akmodsbuild.71xs5gpb/BUILD/nvidia-open-kmod-550.7>
Aug 10 19:49:24 zbook rpm-ostree(akmod-nvidia-open.post)[33848]: make[2]: *** [Makefile:252: __sub-make] Error 2

I’ve tried to layer the closed source driver, and it installed the 560.31.02 driver without issues. I cannot figure out why installing the akmod-nvidia-open compiles the 550 driver instead of the 560.

I don’t think that’s on your side. I get version 550.76 too instead of the 555.58.02 for the open driver, although I don’t have rawhide enabled.

Open:

$ dnf info akmod-nvidia-open
Last metadata expiration check: 0:00:28 ago on Sat 10 Aug 2024 07:51:39 PM CEST.
Available Packages
Name         : akmod-nvidia-open
Epoch        : 3
Version      : 550.76
Release      : 1.fc40
Architecture : x86_64
Size         : 13 M
Source       : nvidia-open-kmod-550.76-1.fc40.src.rpm
Repository   : rpmfusion-nonfree-updates
Summary      : Akmod package for nvidia-open kernel module(s)
URL          : https://github.com/NVIDIA/open-gpu-kernel-modules
License      : GPLv2 and MIT
Description  : This package provides the akmod package for the nvidia-open
             : kernel modules.

Proprietary:

$ dnf info akmod-nvidia
Last metadata expiration check: 0:01:17 ago on Sat 10 Aug 2024 07:51:39 PM CEST.
Installed Packages
Name         : akmod-nvidia
Epoch        : 3
Version      : 555.58.02
Release      : 1.fc40
Architecture : x86_64
Size         : 90 k
Source       : nvidia-kmod-555.58.02-1.fc40.src.rpm
Repository   : @System
From repo    : rpmfusion-nonfree-nvidia-driver
Summary      : Akmod package for nvidia kernel module(s)
URL          : https://www.nvidia.com/
License      : Redistributable, no modification permitted
Description  : This package provides the akmod package for the nvidia kernel
             : modules.

The nvidia open package is in the rpmfusion-nonfree-tainted repo

You need to install the rpmfusion-nonfree-release-tainted package

$ sudo dnf --showduplicates list akmod-nvidia-open
Last metadata expiration check: 0:10:10 ago on Sat 10 Aug 2024 20:50:44 BST.
Available Packages
akmod-nvidia-open.x86_64      3:550.76-1.fc40         rpmfusion-nonfree-updates
akmod-nvidia-open.x86_64      3:555.58.02-1.fc40      rpmfusion-nonfree-tainted
1 Like

I’ve added the tainted repo, but guess I’ll have to wait for the time being and roll back because it does not yet provide the 560 open drivers.

The akmod-nvidia package can be used to compile the open driver

https://rpmfusion.org/Howto/NVIDIA?highlight=(\bCategoryHowto\b)#Kernel_Open

sudo sh -c 'echo "%_with_kmod_nvidia_open 1" > /etc/rpm/macros.nvidia-kmod'
sudo akmods --kernels $(uname -r) --rebuild

The akmods rebuild only works on workstation and it fails on silverblue or it should work on an atomic desktop too? It fails on my system.

Sorry I have never used or wanted to use silverblue/atomic desktop.

I believe that akmods uses dnf or rpm to remove the old package and install the newly compiled rpm package and does not use rpm-ostree. Thus it likely would fail.

Once the package has been compiled it may be possible to manually layer in the new modules but that would require research in how to achieve that. I am not aware of where the compiled package is stored.

Added akmods, f40, rpm-ostree, rpmfusion