I installed Fedora on my PC and tried to install the Nvidia drivers, adhering to this guide 1, through (after adding the free and nonfree rpm fusion to my system) the commands “sudo dnf install akmod-nvidia” and “sudo dnf install xorg-x11-drv-nvidia-cuda”.
After a reboot, I am pretty sure, that it did not work, since the commands “nvidia-smi” and “nvidia-settings” yielded error messages, saying, that the NVIDIA driver is not loaded and on the glmark2 I got a horrible result.
My graphics card is a RTX 2070 SUPER.
I am a newby to Linux, and therefore don’t now what to do now. Thank you for answers in advance!
I am pretty new to linux myself! I had issues with my 2060. On boot I was constantly getting Unexpected System Error.
I later installed Nobara Project which is based on Fedora and is not related to the official distribution. But I didn’t run into any issues.
You can check this video to understand how it’s different.
That may be a last resort, but I would strongly prefer a solution, which is not based on installing a whole other distro
Nevertheless, thank you!
Welcome to ask @sinthoras
Using the nvidia drivers requires one of 2 things, even after they are installed.
Disable secure boot
This is what most users seem to do and it works.
Leave secure boot enabled, but sign the nvidia modules so the kernel is able to load them
This works well. Once I was aware of how akmod-nvidia is able to manage that and automatically sign the modules for me I switched from secure boot disabled to secure boot enabled and have had no issues.
If you wish to sign your own modules there are a couple steps required.
sudo kmodgenca which will create a key for you (this requires ‘akmods’ to be installed)
sudo mokutil --import /etc/pki/akmods/certs/public_key.der
This will ask for a password that will be used in the next step. (you may need to install ‘mokutil’ first)
- Reboot, and during the reboot a mokutil screen will come up for you to import the key you just created into bios. While in the bios screen enable secure boot or verify it is enabled.
- If you have not yet installed the drivers you will need to do so.
If you have already installed the drivers then you need to remove the modules already created
sudo dnf remove kmod-nvidia then reinstall akmod-nvidia
sudo dnf reinstall akmod-nvidia to force a rebuild of the kernel modules.
- Wait a minute or two after the install completes for the module to be rebuilt then reboot.
- Verify the drivers are active with
lsmod | grep nvidia. If that produces a list of modules loaded then the drivers are now active and secure boot is also active.
Thanks a lot!
I did everything as you wrote and everything happened as you said it until I had to
sudo dnf reinstall akmod-nvidia, after removing it. This did not work, but the command
sudo dnf install akmod-nvidia worked and installed it.
After waiting 3 Minutes, I typed
lsmod | grep nvidia and got the result: “i2c_nvidia_gpu 16384 0”. Then I rebooted again and again while booting the message that Nvidia-Drivers are not loaded came, so it didn’t work.
I also could not try the same thing again, because the second time
sudo mokutil --import /etc/pki/akmods/certs/public_key.der yields “SKIP: /etc/pki/akmods/certs/public_key.der is already enrolled”.
Since akmod-nvidia was not previously installed I wonder about how the driver was previously installed?
Please, lets make this a clean install of the nvidia packages.
sudo dnf remove *nvidia* to remove all nvidia related packages.
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda to do a clean install of all needed nvidia packages
- Please now post the output of
dmesg | grep -iE 'nvidia|secure'
That will tell us the status of secure boot as well as the nvidia drivers.
Steps 1 to 3 of the previous list are one time use and do not need repeated.
HOWEVER, if you have already repeated the kmodgenca command in step 1 you now have a changed key and must repeat the other 2 steps to import the changed key into bios. Akmods uses the most recently generated key to sign the modules.
[ 0.000000] Command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.18.16-200.fc36.x86_64 root=UUID=ba5a5b07-437e-459e-95b3-a00a7b972d59 ro rootflags=subvol=root rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init
[ 0.000000] secureboot: Secure boot enabled
[ 0.000000] Kernel is locked down from EFI Secure Boot mode; see man kernel_lockdown.7
[ 0.000000] secureboot: Secure boot enabled
[ 0.000000] Kernel command line: BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.18.16-200.fc36.x86_64 root=UUID=ba5a5b07-437e-459e-95b3-a00a7b972d59 ro rootflags=subvol=root rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init
[ 2.600803] integrity: Loaded X.509 cert 'Fedora Secure Boot CA: fde32599c2d61db1bf5807335d7b20e4cd963b42'
[ 6.078188] nvidia-gpu 0000:07:00.3: enabling device (0000 -> 0002)
[ 6.387985] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input15
[ 6.388061] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input16
[ 6.388118] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input17
[ 6.388169] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input18
[ 6.389391] input: HDA NVidia HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input19
[ 6.389491] input: HDA NVidia HDMI/DP,pcm=11 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input20
[ 6.389586] input: HDA NVidia HDMI/DP,pcm=12 as /devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card1/input21
[ 6.850794] nvidia: loading out-of-tree module taints kernel.
[ 6.850802] nvidia: module license 'NVIDIA' taints kernel.
[ 6.876771] nvidia-nvlink: Nvlink Core is being initialized, major device number 235
[ 6.877431] nvidia 0000:07:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[ 6.920051] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 515.65.01 Wed Jul 20 14:00:58 UTC 2022
[ 6.975097] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[ 7.005211] nvidia-uvm: Loaded the UVM driver, major device number 511.
[ 7.328517] nvidia-gpu 0000:07:00.3: i2c timeout error e0000000
[ 7.876259] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 515.65.01 Wed Jul 20 13:43:59 UTC 2022
[ 7.885608] [drm] [nvidia-drm] [GPU ID 0x00000700] Loading driver
[ 8.885887] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:07:00.0 on minor 0
These are the results of
dmesg | grep -iE 'nvidia|secure'.
I have already repeated step 1, but i am unable to repeat the other 2 steps, since
sudo mokutil --import /etc/pki/akmods/certs/public_key.der yields the error message:
SKIP: /etc/pki/akmods/certs/public_key.der is already enrolled.
PS: Sorry for answering this late, I went to bed. Thank you!
That dmesg output looks like secure boot is enabled and it properly loaded the nvidia modules.
Final thing to check is the output of
lsmod | grep nvidia. If that shows several lines of output then the modules are loaded properly and the nvidia drivers are working.
You are right! They seem to be working now.
The output is:
nvidia_drm 73728 189
nvidia_modeset 1146880 4 nvidia_drm
nvidia_uvm 1286144 0
nvidia 40849408 452 nvidia_uvm,nvidia_modeset
i2c_nvidia_gpu 16384 0
Probably, the clean installation has worked!
Thank you very much!
I really appreciate your time and have a wonderful day!