Nvidia proprietary and open source kernel modules

With the latest bunch of updates to the Nvidia and Multimedia repositories, I’ve added the ability to switch to the two implementations of the kernel modules currently available in the Nvidia driver for Linux.

Since almost a year, the Nvidia driver ships with two different implementations of the kernel modules, one proprietary and one open source. The open source one as of drivers 545.x is now considered beta quality also for the workstations, so it seems a good moment to start shipping it.

The open source one is supposed to be the only one that will be kept in the future, but at the moment both are available and both differ in terms of functionality. You can read about the main differences in terms of functionality and what chips they support in the official documentation.

I did not want to introduce another variation of the kernel modules beside akmods, kABI and DKMS, this would have created even more confusion and lots of dependencies in the SPEC files for the variations. The new akmod and DKMS packages ship both sources (MIT/GPL and proprietary kernel modules) and allow you to switch between one or the other through a configuration file.

Considering that in the long run only the open source variant will remain, I wanted to make this as transparent as possible for the users. Basically, if you don’t care and just want something that works, nothing has changed for you.

The two sources get referenced as they are referenced inside the Nvidia run file, namely “kernel” for the original proprietary kernel modules and “kernel-open” for the new open source variation.

The following instructions show you how to switch between one implementation or the other.

Table of Contents

DKMS

Check which version you have installed:

# modinfo -l nvidia
NVIDIA

Change the type of modules you want to use and trigger a rebuild and a reinstall:

# sed -i -e 's/kernel$/kernel-open/g' /etc/nvidia/kernel.conf
# dkms build -m nvidia/545.29.02 --force
# dkms install -m nvidia/545.29.02 --force

Now check again the license and you should see that it has changed to MIT/GPL:

# modinfo -l nvidia
Dual MIT/GPL
# reboot

To switch back, change the configuration again and then trigger the same process for rebuilding installing:

# sed -i -e 's/kernel-open$/kernel/g' /etc/nvidia/kernel.conf
# dkms build -m nvidia/545.29.02 --force
# dkms install -m nvidia/545.29.02 --force
# reboot

akmods

Check which version you have installed:

# modinfo -l nvidia
NVIDIA

Change the type of modules you want to use and trigger a rebuild and a reinstall:

# sed -i -e 's/kernel$/kernel-open/g' /etc/nvidia/kernel.conf
# akmods --rebuild

Now check again the license and you should see that it has changed to MIT/GPL:

# modinfo -l nvidia
Dual MIT/GPL
# reboot

To switch back, change the configuration again and then trigger the same process for rebuilding installing:

# sed -i -e 's/kernel-open$/kernel/g' /etc/nvidia/kernel.conf
# akmods --rebuild
# reboot

4 thoughts to “Nvidia proprietary and open source kernel modules”

  1. Okay, the update to Fedora 39 went well. But I do see a potential package conflict looming with Fedora’s ROCm packages. In particular:
    dnf provides /usr/include/thrust/
    cuda-cccl-devel-1:12.3.101-1.fc39.x86_64 : CXX Core Compute Libraries development files
    Repo : fedora-nvidia
    Matched from:
    Other : /usr/include/thrust/

    rocthrust-devel-5.6.0-2.fc39.noarch : The rocThrust development package
    Repo : fedora
    Matched from:
    Other : /usr/include/thrust/

    At present I’m happy with CUDA, but looking to the future anyone wishing to install both Radeon with ROCm, and Nvidia with CUDA, and use thrust with both, might find conflict. Would it be possible for fedora-nvidia to move its /usr/include/thrust e.g. to /usr/include/cuda/thrust, or elsewise distinguish it?

  2. Thanks for this, Slaanesh! I personally have many self-inflicted CUDA dependencies for ongoing projects, so will not be experimenting with this until at least Fedora 39. ( know, but will give it another month for the dust to settle.) Very heartening to see you out ahead on this. Best!

Leave a Reply