You are not logged in.

#1 2025-08-10 09:36:38

g89vito
Member
Registered: 2024-05-03
Posts: 8

[solved] nvidia optimus coredump in flatpak environment

Hi

I have a strange problem with my Acer ANR16-41: Ryzen 7 8845HS + RTX 4060 8GB
My new setup is up-to-date: linux 6.16 - kde (wayland) - nvidia-open ...

My laptop works perfectly, both in hybrid GPU mode or directly with the RTX 4060. In hybrid GPU mode, I start every application with prime-run, so after that RTX 4060 is activated; unfortunately, this mode does not work with flatpak applications, particularly with Steam. The terminal error is not very detailed; it says a coredump was created, but in reality, its not present on the system (coredumpctl list is empty).

At this point something strange happens: if I start a native system application (for example prime-run firefox) and then start "prime-run flatpak run com.valvesoftware.Steam" magically steam starts normally and recognizes the RTX; when i reboot the system, it returns to the starting point, the applications go into coredump or do not recognize the RTX.

Possible solutions?

Last edited by g89vito (2025-08-10 15:48:14)

Offline

#2 2025-08-10 11:04:19

Xephon
Member
Registered: 2024-12-22
Posts: 189

Re: [solved] nvidia optimus coredump in flatpak environment

All prime-run does is setting environment variables

__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia

To set those for flatpak run

flatpak override --env="__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia" full.flatpak.application.Name

Offline

#3 2025-08-10 11:22:12

g89vito
Member
Registered: 2024-05-03
Posts: 8

Re: [solved] nvidia optimus coredump in flatpak environment

I know that "prime-run" is a alias; I have already tried "flatpak override" but unfortunately the problem persists.
I think is a flatpak bug, its not able to "cold-activate" the discrete GPU. But as I already said, if I activate it first by launching a "native" application, then it recognizes the RTX.

Offline

#4 2025-08-10 13:19:26

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,230

Re: [solved] nvidia optimus coredump in flatpak environment

prime-run is *not* an "alias" but a shell script.

You need to have the exact same version of nvidia drivers in your flatschpak as on the host. Do you?
Since steam exclusively uses X11 for now (in doubt via xwayland): do you get the same behavior on KDE/X11?

Offline

#5 2025-08-10 14:34:12

g89vito
Member
Registered: 2024-05-03
Posts: 8

Re: [solved] nvidia optimus coredump in flatpak environment

yes, same driver versions 575.64.05

i tested on kde/x11 and works fine.
why this? xwayland is enabled, is a driver issue?

Offline

#6 2025-08-10 14:46:28

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,230

Re: [solved] nvidia optimus coredump in flatpak environment

Check nvidia_smi, do the kwin_wayland resp. Xorg processes use the GPU?
What about other xwayland clients? (I suspect glxgears or even xeyes would do)

Offline

#7 2025-08-10 15:08:33

g89vito
Member
Registered: 2024-05-03
Posts: 8

Re: [solved] nvidia optimus coredump in flatpak environment

nvidia-smi is empty no processes is recognize on startup, integrated graphics is the primary gpu (amd ryzen).
Obviously only processes launched with prime-run appear on nvidia-smi, such as glxgears.

prime-run startplasma-wayland works as expected, RTX is on, works fine

Last edited by g89vito (2025-08-10 15:15:24)

Offline

#8 2025-08-10 15:18:08

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,230

Re: [solved] nvidia optimus coredump in flatpak environment

The main questions are still
1. whether that also is true for the Xorg process when running KDE/X11
2. whether non-flatschpak xwayland clients exhibit the same behavior as steam/flatschpak

Also: Do you have the nvidia-persistenced enabled?
Does it change anything if you do?

Offline

#9 2025-08-10 15:47:14

g89vito
Member
Registered: 2024-05-03
Posts: 8

Re: [solved] nvidia optimus coredump in flatpak environment

omg i have enabled nvidia-persistenced service, now gpu optimus works well in kde_wayland session, both native and flatpak applications.
its strange gpu optimus works fine in the x11 session without this service, no issues with flatpak applications

never heard of nvidia-persistenced in a wiki.

thanks a lot

Offline

#10 2025-08-10 15:56:23

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,230

Re: [solved] nvidia optimus coredump in flatpak environment

https://docs.nvidia.com/deploy/driver-p … nce-daemon

its strange gpu optimus works fine in the x11 session without this service

If you're still curious:

seth wrote:

Check nvidia_smi, do[es] the […] Xorg process[] use the GPU?

Though avoidable that'd be rather the normal condition and in that case Xorg effectively becomes the persisting daemon.

Offline

#11 2025-08-10 16:25:21

g89vito
Member
Registered: 2024-05-03
Posts: 8

Re: [solved] nvidia optimus coredump in flatpak environment

kde_x11 session + primary gpu amd: nvidia_smi have /usr/lib/Xorg running, in kde_wayland session no process uses RTX.
I think the lack of control over RTX state on Wayland is resolved by the nvidia_persistence service

Last edited by g89vito (2025-08-10 16:30:48)

Offline

Board footer

Powered by FluxBB