GTK4 apps hang on nVidia

Vortex Acherontic 217 words 2 minutes linux gtk4 nvidia gnome
GTK Logo

With GTK4 the GTK-Developers added a new render backend which can either use OpenGL or Vulkan to draw windows on to the screen. However with the nvidia 580 driver series the default (vulkan) can cause GTK4 / libadwaita application to hang upon closing. (Force quit)

To fix this issue create a new file at: ~/.config/environment.d/envvars.conf with GSK_RENDERER=ngl as it's content.

Flatpak: If most applications run via flatpak this file will have no effect and thus this environment variable needs to be set as a flatpak override: flatpak override --user --env=GSK_RENDERER=ngl.

Flatseal: Some can also use Flatseal to set this override. Navigate to All Applications / Global scroll down until you read Variables and enter GSK_RENDERER=ngl

For KDE users this override must be set either by using Flatseal or the command line. Plasmas own application permission screen does not allow for global overrides.

To revert this setting to it's default either remove these overrides / envvars.conf file or set it to GSK_RENDERER=vulkan before launching an GTK4 application to test if the issue has been fixed.

Sources:

  • Arch Linux Forums: https://bbs.archlinux.org/viewtopic.php?id=307611
  • nVidia Developer Forums: https://forums.developer.nvidia.com/t/580-release-feedback-discussion/341205/20