Fix Nautilus and other GTK4 apps that exit at launch or freeze on close on NVIDIA
The cause and the structure of the fix hold. omarchy#12622 (open) has the exact Gdk-Message, the passthrough VM, gtk4 4.22.4 and a table where GSK_RENDERER=gl, ngl and cairo all work. omarchy#883 carries the 2026-09-18 comment that NVIDIA bug 5436037 was fixed in 580.82.07. grep for GSK_RENDERER in /usr/share/omarchy returns nothing on 4.0.4-1. hl.env is the documented call on the Hyprland wiki environment-variables page and is what Omarchy's own default/hypr/envs.lua and nvidia.lua use, and that page also says Hyprland manages variables in the systemd and D-Bus activation environments by default, so the session-wide setting reaches a D-Bus-activated Nautilus. omarchy#9902 is the open 'user envs.lua is never loaded' issue. /usr/share/applications/org.gnome.Nautilus.desktop here has DBusActivatable=true and two Exec=nautilus lines, which the sed handles. The defect is the renderer name. This machine runs gtk4 1:4.22.4-1 (Arch extra is 4.22.5), and libgtk-4.so.1 contains the string 'The new GL renderer has been renamed to gl', so ngl is the deprecated alias and triggers a warning on every launch. Open PR omarchy#9814 chose gl for exactly that reason ('GTK 4.22 logs a rename warning for ngl'). The fix and verify now use gl. Not exercised: no NVIDIA multi-GPU setup here.
Symptom
Files (Nautilus) does nothing when launched from the menu. From a terminal it prints Gdk-Message: Error 22 (Invalid argument) dispatching to Wayland display and exits with status 1, and the journal says Lost connection to Wayland compositor. Or, on other NVIDIA machines, Nautilus and GNOME Calculator open fine but hang every time the window is closed, with no crash and nothing in dmesg.
Cause
GTK4 renders with its Vulkan renderer by default. Two NVIDIA failures sit on that path. On a machine where Hyprland's primary GPU is not the NVIDIA one (a second GPU, a virtio GPU in a passthrough VM) and the only Vulkan ICD is nvidia_icd.json, GTK renders on the NVIDIA card and hands explicit-sync dmabufs to a compositor rendering on the other GPU, and Hyprland drops the client (omarchy#12622, reproduced on Omarchy 4.0.4-1, gtk4 4.22.4, nvidia-open 610.57.04). Separately, the close-time hang reported in omarchy#883 was an NVIDIA 580 driver regression, which a commenter on that issue says NVIDIA fixed in 580.82.07. In both cases the GL renderer avoids the failing path. Omarchy 4.0.4 sets no GSK_RENDERER (confirmed by grepping /usr/share/omarchy).
Fix
Confirm the renderer is the trigger with a one-off launch. Quit any running Nautilus first, because a new launch otherwise hands off to the existing instance and the variable never applies:
nautilus -q
GSK_RENDERER=gl nautilus --new-window
Use gl, not ngl. GTK 4.22, which Omarchy 4 and current Arch ship, renamed the new GL renderer to gl and prints a deprecation warning for ngl.
If that works, set it for the session.
**Omarchy 4** (Lua config). Add this to ~/.config/hypr/hyprland.lua below the require("default.hypr.omarchy") line. Do not put it in a new ~/.config/hypr/envs.lua, because the stock hyprland.lua never requires that file (omarchy#9902):
-- GTK4: use the GL renderer instead of Vulkan on NVIDIA
hl.env("GSK_RENDERER", "gl")
Log out and back in so every app inherits it.
**Plain Arch with hyprlang** (~/.config/hypr/hyprland.conf):
env = GSK_RENDERER,gl
**Only one app:** copy its desktop file, prefix the command, and turn off D-Bus activation. Nautilus ships DBusActivatable=true, and a launcher that honours it starts Nautilus through its D-Bus service and ignores the Exec line:
mkdir -p ~/.local/share/applications
cp /usr/share/applications/org.gnome.Nautilus.desktop ~/.local/share/applications/
sed -i -e 's|^Exec=nautilus|Exec=env GSK_RENDERER=gl nautilus|' \
-e 's|^DBusActivatable=true|DBusActivatable=false|' \
~/.local/share/applications/org.gnome.Nautilus.desktop
nautilus -q
Nautilus can still be started by D-Bus without the variable, for example when another app asks it to show a folder. If that happens, use the session-wide setting instead.
If only the close-time hang occurs and the driver is a 580 release older than 580.82.07, updating the driver is the real fix.
Verify
nautilus --new-window opens and closes cleanly with no renderer warning in the terminal. In a new terminal, echo $GSK_RENDERER prints gl.