NVIDIA/Flatpak OpenGL error after every driver update

Hi guys,

I saw an NVIDIA GPU user on Reddit who encountered an error: “Failed to get OpenGL information. Make sure your GPU drivers are properly installed.”

The Root Cause:
It’s because DNF and Flatpak don’t talk to each other. When the host NVIDIA GPU driver updates via DNF, the Flatpak runtime is still pointing at the old version. Users have to manually install the matching Flatpak runtime and remove the old one every time.

The Community Workaround:
The OP created a small systemd service that runs on every boot(The GitHub link reference to the script in the Reddit post below). It checks if the Flatpak NVIDIA runtime matches the system driver. If it doesn’t, it automatically installs the correct one and cleans up the old one. If everything matches, it exits silently.

Proposal:
I think we should consider implementing a similar automated fix or a hook in Fedora to make the NVIDIA + Flatpak experience smoother out of the box.

Here is the full post for reference:

1 Like

Not 100% true, though close. When installing drivers from rpmfusion the new runtime is automatically installed.

I like this proposal (but with changes).

I personally have been using nvidia for many years and have never actually seen an issue. The only thing I have seen is that when an nvidia driver is updated from the rpmfusion repo it automatically installed the updated runtime flatpak. It does not, however remove the older runtime version. Thus an alteration could be proposed to have rpmfusion automatically remove older runtimes.

The caveat there is that often when a new driver version is installed the older driver version (for older kernels) may still require at least one older runtime version and removing runtimes could become problematic when needing to boot from an older kernel that still has the older driver version and requires the older runtime to function.

Note that fedora does not provide the nvidia drivers. Most users have no problems with installing the drivers from rpmfusion. Installing drivers from some other source (nvidia, etc.) may see the issues you are attempting to fix.

Right, flatpak update should be enough. It doesn’t need the user to take separate “remove” and “install” actions.

On my system (using the drivers from RPMFusion), the updated flatpak runtime is only ever available following a reboot. If I run flatpak update after installing the new driver version but before rebooting, the runtime isn’t updated. (Until you reboot, the driver module in the running kernel is the old version, so Flatpak doesn’t “know” that you have the new version ready to go.)

So there is a good case for trying to automate something immediately after rebooting, like OP suggests.

While this may be true, I have never had to manually install the updated runtime for nvidia. Updating the nvidia driver has always updated the flatpak runtime at the same time so manual updates have never been required.

Do you remember if you did some special setup to make this happen?

Here’s what happens to me - I did an update today that included the Nvidia driver, so I could double check:

  1. Ran sudo dnf --refresh update and update packages (including the Nvidia driver packages from RPM Fusion).
  2. Waited 10 minutes in case the kmod rebuild makes a difference
  3. Ran flatpak update - it reported “nothing to do”
  4. Rebooted
  5. Immediately ran flatpak update after reboot, and it gave me the below updates:
        ID                                                    Branch       Op      Remote       Download
 1.     org.freedesktop.Platform.GL.nvidia-580-126-18         1.4          i       flathub      < 331.3 MB
 2.     org.freedesktop.Platform.GL32.nvidia-580-126-18       1.4          i       flathub      < 180.7 MB
 3.     org.freedesktop.Platform.GL.nvidia-580-119-02         1.4          r
 4.     org.freedesktop.Platform.GL32.nvidia-580-119-02       1.4          r

Proceed with these changes to the system installation? [Y/n]: 

(Note that one single command here installs the new 32-bit and 64-bit runtime extensions, and removes the old ones, so there’s no need for the user to perform separate install and remove actions as suggested in the OP.)

It’s the same for me with every driver update.