omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

GTK apps (e.g. Nautilus) freeze on close under Hyprland/NVIDIA unless forcing GSK_RENDERER=ngl

Open bitclaw opened this issue 1 year ago • 4 comments

Summary

Hit an issue where Nautilus froze every time I closed the window. To debug:

  • Ran Nautilus from terminal with GDK_BACKEND=wayland to watch logs
  • Tailed journalctl --user -f and dmesg -w — no OOM/segfaults, just a hang
  • Verified that GDK_BACKEND=x11 closed cleanly → narrowed to Wayland path
  • Tried GTK_USE_PORTAL=0 alone and it still froze
  • Forced GSK_RENDERER=gl, it closed cleanly, but showed a deprecated warning
  • Finally used GSK_RENDERER=ngl, works, closes fine

So it’s GTK4’s Vulkan renderer hanging on teardown (NVIDIA Quadro M1200 here, but likely all NVIDIA).

FYI I also confirmed the calculator hangs as well.

Steps to Reproduce

  1. Run Nautilus under Wayland:
GDK_BACKEND=wayland nautilus --no-desktop
  1. Close the window
  2. Observe freeze (no crash, just hang)

Workaround

Run the app with ngl renderer instead of Vulkan:

GDK_BACKEND=wayland GTK_USE_PORTAL=0 GSK_RENDERER=ngl nautilus --no-desktop

Permanent local fixes

a) App-specific (minimal):

Patch the desktop entry so Nautilus always runs with ngl:

# In case it doesn’t already exist
mkdir -p ~/.local/share/applications
cp /usr/share/applications/org.gnome.Nautilus.desktop ~/.local/share/applications/

# Then edit ~/.local/share/applications/org.gnome.Nautilus.desktop
# Change this line:
# Exec=nautilus --new-window %U

# To this:
Exec=env GSK_RENDERER=ngl nautilus --new-window %U

b) Global (affects all GTK4 apps):

Add to Hyprland envs:

# ~/.config/hypr/envs.conf
env = GSK_RENDERER,ngl

bitclaw avatar Aug 18 '25 04:08 bitclaw

For most users GSK_RENDERER=ngl is probably safe (Intel/AMD Mesa, NVIDIA proprietary, ARM Mesa), but forcing it globally could surprise people who actually want the Vulkan path (perf/experiments), so:

  1. Keep this issue as documentation for others who hit the same freeze.
  2. Optional default, but guarded in ~/.local/share/omarchy/default/hypr/envs.conf add a commented hint:
# GTK4: if apps freeze on close under Wayland/NVIDIA, uncomment:
# env = GSK_RENDERER,ngl
  1. Autodetect (NVIDIA only)

Add this to the end of ~/.local/share/omarchy/install/desktop/hyprlandia.sh (better scope than top-level install.sh, and runs after Hypr config exists):

# NVIDIA-only: avoid GTK4 Vulkan teardown hangs on Wayland
if lspci -nnk | grep -qi 'VGA.*NVIDIA'; then
  mkdir -p "$HOME/.config/hypr"
  if ! grep -q '^env = GSK_RENDERER,ngl$' "$HOME/.config/hypr/envs.conf" 2>/dev/null; then
    printf 'env = GSK_RENDERER,ngl\n' >> "$HOME/.config/hypr/envs.conf"
  fi
fi

This keeps Mesa users (Intel/AMD/ARM) on defaults while fixing the known NVIDIA/Wayland teardown hang. Users can revert by removing that line and reloading Hyprland.

bitclaw avatar Aug 18 '25 04:08 bitclaw

Reference of this issue: https://forums.developer.nvidia.com/t/580-release-feedback-discussion/341205/20

sailoz avatar Aug 18 '25 04:08 sailoz

Thank you for documenting this and the GSK_RENDERER=ngl workaround. The NVIDIA discussion linked from this report tracks this close-hang regression as bug 5436037. NVIDIA asked users to test driver 580.82.07, and the affected users confirmed that GTK4 applications closed normally again with the default Vulkan renderer: https://forums.developer.nvidia.com/t/580-65-06-gtk-4-apps-hang-when-attempting-to-exit-close/341308/9

This looks suitable to close as resolved upstream. If the same close-hang is still reproducible with a newer driver, the exact NVIDIA and GTK versions would help distinguish a recurrence from the separate, newer black-window reports.

sprajs avatar Sep 18 '26 21:09 sprajs

This hang appears to be fixed upstream in the NVIDIA driver, and both drivers Omarchy installs today include that fix.

What was checked:

  • The close-time hang matches NVIDIA bug 5436037, a regression introduced in 580.65.06. Driver 580.82.07 fixed it, with the release note "Fixed a bug regression introduced in 580.65.06 that could cause Vulkan applications to hang on Wayland", and users in NVIDIA's thread confirmed GTK4 apps close normally again with the default Vulkan renderer. Thanks to @sprajs for tracking that down.
  • install/hardware/nvidia.sh installs nvidia-580xx-dkms for Maxwell through Volta (this report's Quadro M1200 is Maxwell) and nvidia-open-dkms for Turing and newer. On a current Omarchy 4.0.4 worker, the repositories carry 580.178.04 and 610.57.04, both newer than 580.82.07.
  • Omarchy sets no GSK_RENDERER on quattro, so GTK4 uses its Vulkan renderer. The workaround isn't needed once the fixed driver is installed.
  • I couldn't reproduce the hang because the workers have no NVIDIA GPU. The conclusion rests on NVIDIA's fix and on the versions Omarchy ships, not on a test run.

Open PR #9814 sets GSK_RENDERER=gl on NVIDIA machines. It targets a different problem, GTK4 windows going blank or being killed on multi-GPU setups (#12622), so it isn't linked here as this issue's fix.

The second opinion came from Codex at medium effort. It agreed: Maxwell gets the 580xx packages, both install paths ship drivers past the fix, and #9814 is a separate matter. It reached the same conclusion from the same facts, so its independence isn't guaranteed.

Next: the maintainer decides whether to close this as resolved upstream. If the hang still happens on a driver at or above 580.82.07, please post the output of pacman -Q | grep -E 'nvidia|gtk4' and say which app hung. That would separate a recurrence from the newer multi-GPU reports.

omarchybot avatar Oct 07 '26 22:10 omarchybot