Fedora KDE still using nouveau driver after installing akmod-nvidia

I installed nvidia drivers using this guide.
after install finished I waited for it to finish the compiling (CPU usage went up so something was happening) after about 2 minutes it finished and I restarted the system.
then I ran inxi -G to check the drivers and here’s the result:

Graphics:
  Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: NVIDIA GP108M [GeForce MX330] driver: nouveau v: kernel
  Device-3: Sonix USB2.0 HD UVC WebCam driver: uvcvideo type: USB
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.9
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: fbdev,vesa
    dri: iris,nouveau gpu: i915,nouveau resolution: 1536x864
  API: OpenGL v: 4.6 Mesa 23.1.5 renderer: Mesa Intel Xe Graphics (TGL GT2)

then I took a look at /etc/default/grub and I noticed something strange:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau resume=UUID=cdc27e27-21fd-4f17-b1b2-f19ce0b6544e rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

the line rd.driver.blacklist=nouveau modprobe.blacklist=nouveau is repeated two times here. I just ignored it and added this line mem_sleep_default=deep to make fedora use deep sleep instead of s2idle which drains battery faster than when I’m using my laptop. after I restarted the laptop it was still using s2idle. however on my last fedora install I removed the duplicate blacklist commands and somehow mem_sleep_default=deep started to work. so what should I do about this? why is it duplicate? should I remove one of them?

1 Like

There sees to be a possible bug in the install script for akmod-nvidia or related that adds those options into that line twice. It looks odd but is totally benign when booting as far as the system is concerned. One can tell it is benign by comparing the output of cat /proc/cmdline with what you posted and see that those options only appear in the command line once. Removing the second copy of those 2 options may or may not affect the sleep option you are trying.

BTW I hope this I just ignored it and added this line is a typo and that you added the option into the line in /etc/default/grub and did not actually add a new line with that content.

However, since the nouveau driver is actually loaded and not nvidia, please let us see the output of mokutil --sb-state and dnf list installed '*nvidia*'.

sorry for late answer,
here’s the output of the above commands:

cat /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="resume=UUID=cdc27e27-21fd-4f17-b1b2-f19ce0b6544e rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau mem_sleep_default=deep"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

cat /proc/cmdline

BOOT_IMAGE=(hd0,gpt7)/boot/vmlinuz-6.4.9-200.fc38.x86_64 root=UUID=8f60ec4d-af1e-4091-97af-36ccfe9e3568 ro resume=UUID=cdc27e27-21fd-4f17-b1b2-f19ce0b6544e rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau mem_sleep_default=deep

mokutil --sb-state

SecureBoot enabled

dnf list installed '*nvidia*'

Installed Packages
akmod-nvidia.x86_64                                    3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
kmod-nvidia-6.4.9-200.fc38.x86_64.x86_64               3:535.86.05-1.fc38                @@commandline             
nvidia-gpu-firmware.noarch                             20230804-153.fc38                 @updates                  
nvidia-settings.x86_64                                 3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia.x86_64                             3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-cuda-libs.x86_64                   3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-kmodsrc.x86_64                     3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-libs.x86_64                        3:535.86.05-1.fc38                @rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-power.x86_64                       3:535.86.05-1.fc38                @rpmfusion-nonfree-updates

Edit: on opensuse and ubuntu I used to get a prompt for typing in my password to enroll the keys for secure boot (before booting into the OS). but Ii didn’t get any prompt on fedora.

Have you tried to disable secure boot to see if the driver loads.

Nvidia driver is loaded after disabling secure boot. but fedora does support secure boot. so defo something’s wrong with akmod-nvidia.

I don’t use secure boot but on rpmfusions how to install nvidia it explains how to set up nvidia with secure boot @computersavvy can explain how to set it up alot better than I can.

The file /usr/share/doc/akmods/README.secureboot gives the steps to enable signing the kernel modules for secure boot.

Those instructions are the same as on rpmfusion
https://rpmfusion.org/Howto/Secure%20Boot?highlight=(\bCategoryHowto\b)

Once the steps in those instructions have been completed the final step that is required is to

  1. remove the current modules that are unsigned
    sudo dnf remove kmod-nvidia-6.4.9-200.fc38.x86_64
  2. build the modules again so they are properly signed
    sudo akmods --force --kernels 6.4.9-200.fc38.x86_64
  3. reboot, and this time enter the bios setup and enable secure boot.

These 3 steps may not be required except for step 3 which enables secure boot if one chooses to do an update with sudo dnf upgrade --refresh. The kernel 6.4.10 was just released and installing that kernel would build the modules for the new kernel already signed.

If one chooses to do the update then after waiting long enough for the system to build the new modules the reboot and enabling secure boot should make it possible to use nvidia with secure boot. Depending upon the system the wait should be anywhere from 3 to 10 minutes.

so what’s the point of akmod-nvidia if I have to do all these manually? and what happens if I go from fedora 38 to 39 or a new nvidia driver is released? do I need to redo all the step?

You absolutely should not need to do any of that except at the very first time booting with secure boot enabled and signed kernel modules. In fact, if one has done the key generation and imported it into the bios with mokutil before installing the akmod-nvidia package those steps would not have been required.

Once the key is imported to bios then akmods will automatically sign any new kernel modules built from that time on with updates.

I have Fedora 38 with secure boot enable from the beginning of the installation, and also the nvidia card and drivers are running OK.

I followed the instructions from the official RPM Fusion guide (including the ‘enrolling the keys’ steps for the secure boot). The only thing that I changed was to always use X11 and not Wayland. But even with Wayland the nvidia driver works, except for a few Qt applications that was not loading correctly. With X11 everything works smooth and correctly.