System-wide DRI_PRIME environment variable for all Flatpaks - is there a solution?

Hello everyone,

I’m running Arch Linux with GNOME on a laptop with hybrid graphics:

  • Device 0: AMD Radeon 890M (integrated GPU)
  • Device 1: AMD Radeon RX 7700S (discrete GPU via PCIe Gen 4)

The Problem:

Many of my Flatpak applications (Bitwarden, etc.) are being assigned to the discrete GPU (Device 1) by GNOME/Mutter, even though they don’t use any GPU acceleration and just waste resources. This seems to happen automatically, and I haven’t found a clear pattern for why certain apps get assigned to which GPU.

I want to force all Flatpak applications to use the integrated GPU (DRI_PRIME=0) by default to save power and system resources.

What I’ve tried:

  1. Using Flatseal to set DRI_PRIME=0 per application — this works but requires manual configuration for every single app

My Questions:

  1. Is there a way to set environment variables system-wide for all Flatpaks without configuring each app individually?
  2. Are there other approaches to control GPU assignment for Flatpak applications?

Additional context:

  • Flatpak version: 1.16.3

Any insights or workarounds would be greatly appreciated!

Thanks in advance!

You may set flatpak override --user --env=DRI_PRIME=0 and it will work for all apps.