No graphics acceleration in Flatpak

Hi there.

I’m having trouble with graphics acceleration in Flatpak in games.

My setup:
Fedora 41 with Sway
Sway running on Intel UHD Graphics 630, nvidia RTX2080 for gaming

The problem occurs when I reboot after system update (which may or may not contain new graphics driver) and run a game through either Steam or Heroic Games Launcher in Flatpak. The screen is just black, sound seems to be working as well as keyboard and mouse - I can hear menu sounds when pressing keys. Running the same game through the same app outside Flatpak does not manifest the issue, games work normally.

Steam and Heroic have GPU acceleration enabled in Flatseal and the individual games use __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 environmental variables to select nvidia.

The Flatpak nvidia driver version matches that of the kernel driver:

$ flatpak list | grep nvidia
nvidia-570-133-07	org.freedesktop.Platform.GL.nvidia-570-133-07		1.4	system
nvidia-570-133-07	org.freedesktop.Platform.GL.nvidia-570-133-07		1.4	user
nvidia-570-133-07	org.freedesktop.Platform.GL32.nvidia-570-133-07		1.4	system

$ nvidia-smi
Tue Apr 22 23:01:06 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.133.07             Driver Version: 570.133.07     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2080        Off |   00000000:01:00.0 Off |                  N/A |
|  0%   37C    P8             20W /  225W |       1MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+


+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

Usually some combination of reboots and commands:

$ dnf reinstall akmod-nvidia
$ akmods --force --rebuild
$ dracut -f --regenerate-all
$ flatpak install org.freedesktop.Platform.GL32.nvidia-XXX --reinstall
$ flatpak install org.freedesktop.Platform.GL.nvidia-XXX --reinstall

solves the issue after several tries. But I haven’t found any specific way or command that would guarantee to fix the issue. The fix usually works until next system update.

Is there any way I can debug this? To be honest, Flatpak and how the drivers work there is kind of a black magic to me.

Thanks!

I have no clue nor advice, but I’m curious why you’re using flatpak NVIDIA drivers? I didn’t even know such existed. Even regular NVIDIA drivers are a headache.

And yeah, even normal NVIDIA drivers break with kernel updates and have to be rebuilt/reinstalled with pretty much every new kernel. It happened to me three times in about four months. This is apparently “normal”. So, if that’s the case, Flatpak is not even the problem here.

I wanted to run the proprietary apps in a sandbox, that’s why I’m using Flatpak. Because of the sandbox, Flatpak app can’t use the kernel driver and needs something to get to the hardware. But as I mentioned, I don’t know much about Flatpak internals, so I can’t say much more.

I agree that the nvidia driver support is terrible and adding Flatpak as another layer does not really help that :smiley:

Ah, thanks. Yeah, Flatpak sandboxing seems like a good idea for some uses but I found early on that it causes issues since some apps get installed with permissions that are too restrictive and prevent them from working properly. A media player that can’t play media, a tagging utility that crashes when saving edited files. I blamed poor coding at first before I realized that you can adjust Flatpaks permissions and that fixed even the crashing issues.

So, could it be that some of your problems are also related to Flatpak permissions? Like for some apps, I had to give them read access to system files, for instance, or things like theming, icons, etc., wouldn’t work.

I mean, I’m new to Flatpaks too, but just throwing an idea out there.

Like, there are some advanced permissions that look like hardware related:

1 Like

Sway user here. It is a great WM.

Instead of using Flatpak, you could use Lutris to connect to your Steam account and download games.

That way you get rid of Steam app, but still run the games. You are not running them as root, so I would not be too paranoid about them being ‘proprietary’

Personally I only use offline games, usually GOG run via Lutris and Wine.

Thanks for the advice, but this does not seem to be the issue. As I said, reinstalling some stuff and rebooting usually fixes the issue until the next os update. Flatseal shows the same permissions in both cases.

1 Like

Running as non-root only protects the system, while what I’m afraid of is my data that are of course accessible to steam (I don’t have a separate account for gaming). Yes, selinux could solve that issue, but ugh, flatpak seems like the more sane option here :smiley:

For sure, but I am recommending to replace Steam with Lutris.

1 Like