Fedora 36 Nvidia kernel module missing

Hey there.

I fear stuff like this gets asked a lot but I could not find a solution by reading other post about this.

I am unable to get the nvida drivers running correctly. In particular on startup before I am logged into my destop I get the message “nvidia kernel module missing. Falling back to nouveau”. Moreover, I dont think that I am currently able to use my graphics card with nouveau.
For example my graphics card is not listed under “settings”:

I tried to follow different guides and by now am quite unsure about the state I am in actually. But among the guides was https://rpmfusion.org/Howto/NVIDIA.

I will try to collect some information here:

/sbin/lspci | grep -e VGA

gives

00:02.0 VGA compatible controller: Intel Corporation CometLake-U GT2 [UHD Graphics] (rev 02)

But

/sbin/lspci | grep -e 3D

gives

2d:00.0 3D controller: NVIDIA Corporation GP108GLM [Quadro P520] (rev a1)
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

shows that both packages are already installed.

I also found https://rpmfusion.org/Howto/Optimus but I did not unserstand what parts apply to me.

Please let me know what to check and what to try.

TY!

1 Like

Have you typed/tried these lines of code to download nvidia ?

sudo dnf update -y # and reboot if you are not on the latest kernel
sudo dnf install akmod-nvidia # rhel/centos users can use kmod-nvidia instead
sudo dnf install xorg-x11-drv-nvidia-cuda #optional for cuda/nvdec/nvenc support

If you did could you type what is the output of nvidia-smi command ?

I did. Seems to be installed all just fine. nvidia-smi yields

NVIDIA-SMI has failed because it couldnt communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Hmm, it could be a secure boot problem…but I am not sure. Is your secure boot enabled or not. Could you check it ? Also are you dual booting or just using Fedora ?

I am just using fedora. Secure boot can be checked in the BIOS?

You can check if secureboot is enabled with sudo mokutil --sb-state

If it is, here’s how you can set up the nvidia driver with it:

https://rpmfusion.org/Howto/Secure%20Boot

3 Likes

Ok it is enabled. I did not understand the guide you liked at first glance, But I will try it out later.
Ty.

Here’s the TL;DR (you’ll probably need to run these with sudo):

# To create the self generated key and certificate:
/usr/sbin/kmodgenca
# To import the key, the command will ask for a password to protect the key
# You will have to enter this password during the special EFI window
mokutil --import /etc/pki/akmods/certs/public_key.der

I get

Update cacert.config...
/usr/sbin/kmodgenca: line 103: /etc/pki/akmods/cacert.config: Permission denied
Generate new keypair...
Password: 
sg: failed to crypt password with previous salt: Invalid argument
chmod: cannot access '/etc/pki/akmods/certs/fedora-1127348359.*': Permission denied
chmod: cannot access '/etc/pki/akmods/private/fedora-1127348359.*': Permission denied
/usr/sbin/restorecon: lstat(/etc/pki/akmods/certs/fedora-1127348359.der) failed: Permission denied
/usr/sbin/restorecon: lstat(/etc/pki/akmods/private/fedora-1127348359.priv) failed: Permission denied
ln: failed to access '/etc/pki/akmods/certs/public_key.der': Permission denied
ln: failed to access '/etc/pki/akmods/private/private_key.priv': Permission denied

Do I need sudo?

You can also just disable the secure boot (if you want to) from the UEFI menu and try to compile the nvidia modules again. But ofc thats is just an option. You can also follow the commands provided by Scott.

Yes. Put sudo before those two commands. Once you do this, you should be good to go with the nvidia drivers with secureboot enabled. I suggest rebooting after you run this to get the drivers loaded on boot up.

1 Like

The modules are probably already created and unsigned. Thus you will likely do best to uninstall the nvidia modules after you have created and enabled the keys as noted above, then reinstall the nvidia driver so the modules are signed when they are created.

  1. sudo dnf remove *nvidia*
  2. sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
  3. wait about 2 to 5 minutes then reboot.

Now the drivers should be installed, signed, and should load and work.
To verify they are loaded properly, lsmod | grep nvidia should give you several lines output listing the modules that are loaded. If it does then the drivers are loaded and functional.

2 Likes

Ok the problem seemed to be the secure boot. I checked the README at /usr/share/doc/akmods/README.secureboot again and after that got it working. At least that is what I think.
nvidia-smi works now and lsmod | grep nvidia gives:

nvidia_drm             73728  1
nvidia_modeset       1146880  2 nvidia_drm
nvidia_uvm           1286144  0
nvidia              40849408  115 nvidia_uvm,nvidia_modeset

I did not reinstall the driver packages. Is there anything else that I could confirm?

2 Likes

At this point the kernel modules are loaded so the nvidia drivers are active.

I don’t think you need anything more unless you can identify a specific issue to discuss.

1 Like

I was having this same problem with Fedora 36 after updating to kernel 5.19. Even after doing a full uninstall and re-install of akmod-nvidia I would still get the error message when booting “nvidia kernel module missing falling back to nouveau”.

Following the steps here: Howto/Secure Boot - RPM Fusion

Then rebooting and loading the key and entering my passphrase at boot, that totally resolved the issue for me.

1 Like

Welcome to ask :fedora:

It has been known for a long time that secure boot prevents loading unsigned kernels, modules, etc.

This issue is part of that, and I am glad you were able to find the solution.

My apologies, it seems that there is some dislike about replying to older threads on this forum but as long as people continue to come to the thread for information (like I did) it seems important to me that any user aware of new information should try to update the thread with that information as to not have users like myself following commands that are not optimal.

I have seen multiple reddit comments that seem to use the dnf remove *nvidia* which they might have gotten from this forum. According to what I understood from Nvidia drivers with secure boot no longer working - #2 by computersavvy , it seems that that command is not recommended.