Nvidia Prime render offload won't work on Silverblue

I’m using a hybrid Nvidia/Intel laptop on my Silverblue 39. For some reason, using Prime render offload couldn’t use Nvidia to launch apps anymore. Usually, right clicking application would show the GPU switch option before, but now this option is gone. DRI_PRIME=1 didn’t work. For example, use DRI_PRIME=1 flatpak run com.valvesoftware.Steam still runs Steam in Intel. Putting nvidia-smi says No devices were found when switching to the hybrid mode.

Here is the output of nvidia-bug-report.sh.

dadstick@fedora:~$ nvidia-smi
No devices were found

dadstick@fedora:~$ modinfo -F version nvidia
535.129.03
dadstick@fedora:~$ rpm-ostree status
State: idle
Deployments:
  fedora:fedora/39/x86_64/silverblue
                  Version: 39.20231114.0 (2023-11-14T00:52:29Z)
               BaseCommit: e2d50b6d7ba4ae833bb2ec5d6211c984dc47cc9f2333ead0846401fdb0b2ec39
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
                     Diff: 23 removed
          LayeredPackages: akmod-nvidia distrobox gnome-tweaks steam-devices supergfxctl xorg-x11-drv-nvidia-cuda

● fedora:fedora/39/x86_64/silverblue
                  Version: 39.20231114.0 (2023-11-14T00:52:29Z)
               BaseCommit: e2d50b6d7ba4ae833bb2ec5d6211c984dc47cc9f2333ead0846401fdb0b2ec39
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
          LayeredPackages: akmod-nvidia distrobox gnome-tweaks inxi steam-devices supergfxctl xorg-x11-drv-nvidia-cuda

  fedora:fedora/39/x86_64/silverblue
                  Version: 39.20231114.0 (2023-11-14T00:52:29Z)
               BaseCommit: e2d50b6d7ba4ae833bb2ec5d6211c984dc47cc9f2333ead0846401fdb0b2ec39
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
          LayeredPackages: akmod-nvidia distrobox gnome-tweaks inxi steam-devices supergfxctl xorg-x11-drv-nvidia-cuda

I tried to reinstall Nvidia and I found I couldn’t boot into the system, which only gave me a blackscreen. Probably the 535 driver is currently broken on the Fedora kernel and I hope the upcoming 545 driver can fix it.

No, the driver is not broken.
But something may have gone wrong during the installation so the module may not have properly compiled and installed correctly. Corrupted modules often seem to give the black screen result.

On Workstation I would use dnf list installed \*nvidia\* to see and verify what nvidia packages are actually installed and the package named kmod-nvidia-$(uname -r) is the one that may be corrupted.

How the repair works on silverblue may be different but I use
sudo dnf remove kmod-nvidia -$(uname -r) to remove the failed drivers then repair it with
sudo akmods --force. After completion a reboot usually solves the driver problem when this has occurred.

Is there any way to get it working on Silverblue? There is no dnf command on Silverblue and I had to use rpm-ostree command instead, which didn’t seem to work.

dadstick@fedora:~$ sudo rpm-ostree uninstall kmod-nvidia -$(uname -r)
[sudo] password for dadstick: 
error: Unknown option -6.5.11-300.fc39.x86_64

You left a space there in the name
kmod-nvidia-$(uname -r)

Here is what I encountered:

dadstick@fedora:~$ sudo rpm-ostree uninstall kmod-nvidia-$(uname -r)
[sudo] password for dadstick: 
error: Package/capability 'kmod-nvidia-6.5.11-300.fc39.x86_64' is not currently requested

I installed Nvidia 545 driver from RPM Rawhide following the tutorial, which didn’t resolve the issue.

Putting nvidia-smi says No devices were found when switching to the hybrid mode.

Here is the output of nvidia-bug-report.sh.