Problem when installing RPMFusion Nvidia drivers on F33 KDE

Hey everyone!

The issue I’m having is confusing me a lot so I’ll try to provide as many details as I can, because I’ve been stumped for almost two weeks already. Looked through a myriad of askfedora/SO/reddit threads and still can’t figure this out.

I’ve installed F33 KDE spin recently on my Dell XPS 15 9570 and was hoping to be able to utilize Nvidia Geforce GTX 1050ti Max-Q card using the Prime Render Offload method (using __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%), so that I’m not draining the battery while just doing whatever but still able to play Steam games.

In order to install the proprietary drivers I have thoroughly followed the following guides:

Now the problem that I am having is that offloading simply does not work for me, which is indicated by a multitude of issues:

  • __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep vendor spits out this:

    X Error of failed request:  BadValue (integer parameter out of range for operation)
      Major opcode of failed request:  152 (GLX)
      Minor opcode of failed request:  24 (X_GLXCreateNewContext)
      Value in failed request:  0x0
      Serial number of failed request:  39
      Current serial number in output stream:  40
    
  • xrandr --listproviders lists only 1 device which is Intel

  • Nvidia X Server Settings does not open and running nvidia-settings -V produces this:

    WARNING: NV-CONTROL extension not found on this Display.
    ERROR: Unable to load info from any available system
    

    Some discussion threads on Reddit have indicated that this could be due to the fact that nouveau is still loaded, but…
    cat /etc/modprobe.d/blacklist.conf

    blacklist nouveau
    

    Also blacklisted in GRUB params:

    GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 mem_sleep_default=deep rhgb quiet"
    GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 mem_sleep_default=deep rhgb quiet"
    
  • No mentions of “nvidia” or “glamoregl” in Xorg logs:
    cat /var/log/Xorg.0.log | grep glamoregl gives nothing
    cat /var/log/Xorg.0.log | grep nvidia only shows kernel command line being logged which includes the GRUB params

Along the issues, my other findings and helpful info:

uname -r

5.10.16-200.fc33.x86_64

lspci and neofetch recognize that I have the Nvidia GPU:
lspci -v | grep -A 10 NVIDIA says

01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
        Flags: bus master, fast devsel, latency 0, IRQ 141
        Memory at ec000000 (32-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at d0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 3000 [size=128]
        Expansion ROM at ed000000 [virtual] [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

rpm -qa \*nvidia\* | sort outputs this

akmod-nvidia-460.39-1.fc33.x86_64
kmod-nvidia-5.10.16-200.fc33.x86_64-460.39-1.fc33.x86_64
nvidia-settings-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-kmodsrc-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-libs-460.39-1.fc33.i686
xorg-x11-drv-nvidia-libs-460.39-1.fc33.x86_64

Feels like there is supposed to be more. I did dnf install vdpauinfo libva-vdpau-driver libva-utils, but feels like something is still missing, maybe nvidia-modprobe? Not sure what it does but it doesn’t make a difference whether it is installed or not.

When running lsmod | grep nvidia it appears that nvidia_drm has a value of 0.

nvidia_drm             65536  0
nvidia_modeset       1232896  1 nvidia_drm
nvidia              34136064  1 nvidia_modeset
drm_kms_helper        274432  2 nvidia_drm,i915
drm                   618496  10 drm_kms_helper,nvidia_drm,i915

Also found this in dmesg | grep nvidia:

[    5.848820] nvidia: loading out-of-tree module taints kernel.
[    5.848834] nvidia: module license 'NVIDIA' taints kernel.
[    5.895034] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    5.922884] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[    5.937804] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[    6.240033] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  460.39  Thu Jan 21 21:49:04 UTC 2021
[    6.278566] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    7.154694] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1

Other findings from nvidia-bug-report.log:

[    0.000000] secureboot: Secure boot disabled
[    5.895034] nvidia: module verification failed: signature and/or required key missing - tainting kernel
NVRM: loading NVIDIA UNIX x86_64 Kernel Module  460.39  Thu Jan 21 21:54:06 UTC 2021

but not much else from NVRM

I tried configuring Xorg to see the GPU in /etc/X11/xorg.conf which caused my laptop to, erm, not boot:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "intel"
    Inactive "nvidia"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "True"
#   Option "PrimaryGPU" "yes"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID  "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

So, I’m left with the “default” /etc/X11/xorg.conf.d/nvidia.conf copied from /usr/share/X11/xorg.conf.d/nvidia.conf

Sorry for too much info, but I wanted to be as clear as I could. I feel like I’m out of ideas, so that’s why I want to ask for help here. Did I miss something?
Really, all I want is to be able to use my Nvidia GPU, play games, edit videos, do whatever.

Hi, if you don’t saw it before you could have a look to Howto - RPM Fusion
and Howto/Optimus - RPM Fusion

Maybe you will to add the non free repos from RPM fusion: Configuration - RPM Fusion

Hi @alienator,
thanks for the quick response,
however, as I’ve mentioned in the post, I’ve thoroughly followed the RPMFusion howto guides, including the Optimus one, which even mentions that there is nothing else to be done beyound normal driver installation.
Also,
sudo dnf repolist gives

fedora                                                                                                            Fedora 33 - x86_64
fedora-cisco-openh264                                                                                             Fedora 33 openh264 (From Cisco) - x86_64
fedora-modular                                                                                                    Fedora Modular 33 - x86_64
rpmfusion-free                                                                                                    RPM Fusion for Fedora 33 - Free
rpmfusion-free-updates                                                                                            RPM Fusion for Fedora 33 - Free - Updates
rpmfusion-nonfree                                                                                                 RPM Fusion for Fedora 33 - Nonfree
rpmfusion-nonfree-updates 

(didn’t list all of them here but you get the point)
I’m 100% sure I’ve done everything correctly when it comes to following the guides to install the drivers

@unsame
You can try this short path:
Upgrade your system first and reboot, then:
lspci |grep -E “NVIDIA|3D” # substitude the " with your own on command line
dnf install fedora-workstation-repositories
dnf config-manager --set-enabled rpmfusion-nonfree-nvidia-driver
dnf repository-packages rpmfusion-nonfree-nvidia-driver info
dnf clean all
dnf makecache
dnf install akmod-nvidia nvidia* xorg-x11-drv-nvidia*
modinfo -F version nvidia
reboot

Hi @huben,
thanks for response
A couple of quick questions though, wouldn’t I need to wait for the akmods to build and then run sudo akmods --force and sudo dracut --force? and only then reboot?
Besides that, do I need to delete my previously installed akmod-nvidia and other driver-related packages?

Good question. I didn’t try this yet.
You might reboot and go back to an older kernel

Also you can remove installed packages with
dnf history list
and
dnf history undo "number"

@huben,

It appears that rpmfusion-nonfree-nvidia-driver has exactly the same drivers as the regular rpmfusion-nonfree. RPMFusion have created a separate repo for Gnome Software app to display help related to installation of proprietary Nvidia drivers. Effectively, rpmfusion-nonfree-nvidia-driver can be considered an nvidia-only copy of rpmfusion-nonfree. Therefore it means that I have installed the same driver from rpmfusion-nonfree that I could’ve installed from rpmfusion-nonfree-nvidia-driver.
modinfo -F version nvidia outputs 460.39

@unsame
Did you install a proprietary NVIDIA driver before?
That looks like to be the cause of the tainted kernel.

[    5.848820] nvidia: loading out-of-tree module taints kernel.
[    5.848834] nvidia: module license 'NVIDIA' taints kernel.
[    5.895034] nvidia: module verification failed: signature and/or required key missing - tainting kernel

If you install it from the repos, it should have a valid signature.
You probably would need to go back to a normal kernel before installing nvidia drivers from repo.

@huben I did indeed, but I uninstalled it. This install-get mad-uninstall procedure happened two times (i was trying to install drivers using different ways). How would I un-taint kernel?

This is easy. You have different ways.

Firtst remove your installed packages using dnf history list all and chose the right number when doing dnf history undo "number".

You can reboot and choose a different kernel in the boot loader. This might be easiest.

You also can:
dnf list kernel*
There you see installed kernels and updates.

If theres an update, just update, reboot, problem solved.

If not, type
dnf info kernel
You get all available Kernels with full package name. (Quelle: / maybe Source: entry)
Or just grep for “kernel-” like
dnf info kernel | grep kernel-
Install the package you want, e.g
dnf install kernel-5.10....
Use the full paket name with version number.

Now you need to reboot and chose the correct version. It should alredy be highlighted.

If you are back and your kernel is not tainted, congrats, chose one way to install your nvidia drivers from a repo.

Avoid installing the proprietary NVIDIA driver. They will cause problems on updates, which are frequent.

Having read a bit further and I hopefully learned something.
Most of the time it really is not a problem and even if you install the nvidia driver from the repo, you’ll get the tainted kernel state. Because of the license, missing signature and proprietary asset and whatnot. They didn’t build a kernel, they built a kernel module.
You’d need to identify the kernel module and if faulty removing it.

https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
for i in $(seq 18); do echo $(($i-1)) $(($(cat /proc/sys/kernel/tainted)>>($i-1)&1));done
You can use the link above and command to identify the problem regarding the tainted kernel.
There is a table that describes what the output above means, called:
“Table for decoding tainted state”

Working with kernel modules:

dmesg | grep taint
dmesg | grep nvidia
lsmod | grep -i nvidia
modinfo module

In the first link they say that the kernel still may remain tainted, not trustworthy.
So you may need to reinstall the kernel after removing?

If you remove something, first use
modprobe -r foo
After that you can
rmmod foo

Do not use rmmod directly!

Although the rmmod command can be used to unload kernel modules, it is recommended to use modprobe -r instead.

I for myself had a similar problem once. But I made a clean reinstall of the entire OS to fix it. Then I avoided to touch any proprietary binary graphics driver until today.

1 Like

Forget everything I said.
Having reread your opening post, there indeed seems to be a nouveau module loaded.

01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
        Flags: bus master, fast devsel, latency 0, IRQ 141
        Memory at ec000000 (32-bit, non-prefetchable) [size=16M]
        Memory at c0000000 (64-bit, prefetchable) [size=256M]
        Memory at d0000000 (64-bit, prefetchable) [size=32M]
        I/O ports at 3000 [size=128]
        Expansion ROM at ed000000 [virtual] [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia

last line

What does lsmod | grep nouveau say?

It should return nothing. If there still is an nouveau-module, I’d try to remove it.
How to do?

Your grub would need to have
“rd.driver.blacklist=nouveau modprobe.blacklist=nouveau”
listed as well. Apparently both entries are needed.

edit /etc/default/grub
and make shure there is someting like this in the GRUB_CMDLINE_LINUX:
… rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 …

then rebuild the bootloader with
grub2-mkconfig
reboot

Check if the nouveau module is gone.

@huben, thanks for the help.
I did not do anything yet.
See my first post, nouveau is blacklisted in grub and even in /etc/modbprobe.d/blacklist.conf. lsmod | grep nouveau doesn’t return anything.

I know, my original post is really long and is just a mess of information, it’s easy to miss things.

I see, maybe it helps to see how a working driver looks like:
rpm -qa \*nvidia\*

nvidia-query-resource-opengl-lib-1.0.0-7.fc32.x86_64
nvidia-texture-tools-2.0.8-25.fc33.x86_64
nvidia-texture-tools-devel-2.0.8-25.fc33.x86_64
nvidia-query-resource-opengl-1.0.0-7.fc32.x86_64
xorg-x11-drv-nvidia-cuda-libs-460.39-1.fc33.x86_64
nvidia-modprobe-460.39-1.fc33.x86_64
nvidia-settings-460.39-1.fc33.x86_64
nvidia-xconfig-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-kmodsrc-460.39-1.fc33.x86_64
nvidia-persistenced-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-cuda-libs-460.39-1.fc33.i686
xorg-x11-drv-nvidia-libs-460.39-1.fc33.i686
xorg-x11-drv-nvidia-libs-460.39-1.fc33.x86_64
akmod-nvidia-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-cuda-460.39-1.fc33.x86_64
xorg-x11-drv-nvidia-devel-460.39-1.fc33.x86_64
kmod-nvidia-5.10.14-200.fc33.x86_64-460.39-1.fc33.x86_64
kmod-nvidia-5.10.15-200.fc33.x86_64-460.39-1.fc33.x86_64
kmod-nvidia-5.10.16-200.fc33.x86_64-460.39-1.fc33.x86_64

lsmod | grep nvidia

nvidia_drm 65536 6
nvidia_modeset 1232896 11 nvidia_drm
nvidia_uvm 1150976 0
nvidia 34136064 458 nvidia_uvm,nvidia_modeset
drm_kms_helper 274432 1 nvidia_drm
drm 618496 9 drm_kms_helper,nvidia_drm

modinfo nvidia_drm

filename: /lib/modules/5.10.16-200.fc33.x86_64/extra/nvidia/nvidia-drm.ko
version: 460.39
supported: external
license: MIT
srcversion: B0B8ECC7F96A962EBF0952E
alias: pci:v000010DEdsvsdbc03sc02i00
alias: pci:v000010DEdsvsdbc03sc00i00
depends: drm,drm_kms_helper,nvidia-modeset
retpoline: Y
name: nvidia_drm
vermagic: 5.10.16-200.fc33.x86_64 SMP mod_unload
parm: modeset:Enable atomic kernel modesetting (1 = enable, 0 = disable (default)) (bool)

glxinfo | grep vendor

server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation

lspci -v | grep -A 20 NVIDIA


Flags: bus master, fast devsel, latency 0, IRQ 59
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e8000000 (64-bit, prefetchable) [size=128M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
Capabilities: [60] Power Management version 3
Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [78] Express Endpoint, MSI 00
Capabilities: [b4] Vendor Specific Information: Len=14 <?> Capabilities: [100] Virtual Channel Capabilities: [128] Power Budgeting <?>
Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
Capabilities: [900] Secondary PCI Express
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia

My guess would be that something of the proprietary drivers you installed in advance might be still there.
I would decide for me to either track down the bug another two weeks and maybe learn things that are amazing or to install fresh and clean, which maybe takes 2 - 4 hours, depending on what to do.
If I would have installed fresh just recently, then there’s not much to backup anyway.

Then I would install NVIDIA drivers and Steam in one ride by doing this:
lspci |grep -E “NVIDIA|3D”

dnf install fedora-workstation-repositories
dnf config-manager --set-enabled rpmfusion-nonfree-nvidia-driver
dnf config-manager --set-enabled rpmfusion-nonfree-steam
dnf repository-packages rpmfusion-nonfree-nvidia-driver info
dnf clean all && dnf makecache
dnf install akmod-nvidia nvidia* xorg-x11-drv-nvidia*

If you want you can mix in the suggested packages from the guide as well:
dnf install gcc kernel-headers kernel-devel

dnf install steam
modinfo -F version nvidia
reboot

Why this? Because this works for me.
If you install those proprietary drivers, you’ll have to reinstall them every kernel update.
(And every time you would have a chance of failure.)
Also you can’t definately rule out that they still may cause a problem.

If everything is in place, I would proceede with Point 8

Step #8: Edit the X11 configuration

With the guide

Execute the following command to copy the display render details for the X11.
sudo cp -p /usr/share/X11/xorg.conf.d/nvidia.conf /etc/X11/xorg.conf.d/nvidia.conf
Once done, open up the nvidia.conf from the copy destination and edit it to add
Option “PrimaryGPU” “yes”
to every section of it.
For example, using nano
sudo nano /etc/X11/xorg.conf.d/nvidia.conf

Yes, editing the file in /etc/X11/xorg.conf.d/ actually is a good idea. Additional configurations nowadays are used to be stored in “something.conf.d” folders. They are loaded additionally. Avoid editing /etc/X11/xorg.conf directly. Also avoid touching anything in /boot/. If you need to change something do it in /etc/default/grub and use grub2-mkconfig to generate a new bootloader. Maybe you do not need to edit there.

1 Like

@huben I might just try reinstalling out of despair.
About step 8 and further steps from that guide, wouldn’t that lead to setting up Nvidia as the primary gpu?
A while ago I’ve done exactly that on F32 KDE and it totally destroyed my battery health over a month.
I just want to be able to use it in cases when I’m gaming & video editing, not all the time, e.g. __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo

@unsame I have the same laptop as you and, in my case, it works properly just by following the Howto/Optimus guide that was linked above. Summarizing, nothing apart from a sudo dnf install akmod-nvidia and a reboot should be needed. From what I understand, the only difference is that I am using the default GNOME 3 Fedora, while you are using the KDE spin. Have you checked if the problem persists in GNOME 3 as well?

One thing that I would like to add is that, if your goal is power saving, the guide regarding setting Nvidia as Primary GPU is not what you want. That one is going to drain your battery. Prime Render Offload is what you want and also what I have.

@egeretto
Thanks for replying! I’ll try F33 GNOME and will see whether it’s a DE issue (which i kinda doubt) if my KDE reinstall fails. Funny enough, I remember being able to install the drivers on F32 KDE with no problem by following the exact same steps.
The reason why I am linking the “setting Nvidia as Primary GPU” guide is because it is mostly relevant to a regular install of the drivers, while the RPMFusion guides are missing out on such steps as sudo akmods --force and sudo dracut --force.
Besides that, don’t I need to separately dnf install xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs xorg-x11-drv-nvidia-libs.i686? Don’t remember if they come as dependecies to that akmod-nvidia package

I am also convinced it is unlikely to be a problem with the DE itself. I am just wondering if, maybe, some configuration file is different in that spin due to KDE. Anyway, I checked with dnf history and, indeed, installing akmod-nvidia pulled in:

  • egl-wayland
  • libglvnd-opengl
  • akmod-nvidia
  • nvidia-settings
  • xorg-x11-drv-nvidia
  • xorg-x11-drv-nvidia-kmodsrc
  • xorg-x11-drv-nvidia-libs

This was on a clean installation back in December 2020. Is it not the same for you? I am using the package from rpmfusion-nonfree-nvidia-driver, the Nvidia-specific repository. Also, I have not run neither of akmods --force, nor dracut --force.

Also worth mentioning: I am signing the kernel modules to keep SecureBoot enabled, but I have seen you have it disabled, so that should not be the cause.

I have just noticed I have one module more than you loaded:

$ lsmod | grep nvidia
nvidia_drm             65536  2
nvidia_modeset       1232896  2 nvidia_drm
nvidia_uvm           1150976  0
nvidia              34136064  73 nvidia_uvm,nvidia_modeset
drm_kms_helper        274432  2 nvidia_drm,i915
drm                   618496  14 drm_kms_helper,nvidia_drm,i915

@unsame

I don’t get why do have copied /usr/share/X11/xorg.conf.d/nvidia.conf to /etc/X11/xorg.conf.d/nvidia to comment the PrimaryGPU option, this should have been uneeded.

That been said, KDE might requires the hack for display manager:
https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Display_managers
In Fedora GDM users does not need that…