Repository navigation
Conversation
On hybrid NVIDIA + Intel/AMD iGPU laptops, Hyprland composites on the iGPU while GLVND loads NVIDIA EGL first, so Chromium defaults to NVIDIA EGL and fails to import its DMA-BUF buffers as EGLImages on the iGPU side. This surfaces as EGL_BAD_MATCH (0x3009) spam, black screens, flicker, and GPU process crashes. Install a per-app override at ~/.local/share/applications/chromium.desktop that runs Chromium with __EGL_VENDOR_LIBRARY_FILENAMES pointing at Mesa's 50_mesa.json (and LIBVA_DRIVER_NAME matched to the iGPU) so it renders on the same GPU as the compositor. The system-wide EGL stack is left untouched, so Hyprland and everything else keep working unchanged. Gated on hybrid NVIDIA + iGPU detection and skipped when the user already has their own chromium.desktop override. A matching migration applies the fix on existing installs. Closes omacom#4901 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR aims to resolve Chromium black screens/flicker and EGL DMA-BUF import errors on hybrid NVIDIA + Intel/AMD iGPU systems by forcing Chromium-only EGL vendor selection to Mesa via a user .desktop override, leaving the system-wide EGL stack unchanged.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add an install-time hardware script to generate a per-user
chromium.desktopoverride that prefixesExec=with Mesa EGL + iGPU VAAPI env vars. - Run the new hardware script during installs after NVIDIA/Vulkan setup.
- Add a migration that applies the same fix on existing systems by delegating to the install-time script.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
install/config/hardware/fix-hybrid-chromium.sh |
Detects hybrid NVIDIA+iGPU and creates a user .desktop override to force Mesa EGL for Chromium only. |
install/config/all.sh |
Hooks the new hybrid Chromium fix into the install config sequence. |
migrations/1776262789.sh |
Applies the fix to existing installs by invoking the same script used during install. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | ||
| sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | ||
| "$STOCK_DESKTOP" >"$USER_DESKTOP" |
There was a problem hiding this comment.
The rewritten Exec= lines start with env ..., which breaks bin/omarchy-launch-browser (it parses the first token from Exec= and will get env, then tries to execute it as the browser). This will likely break Omarchy keybindings/launch flows that rely on omarchy-launch-browser. Consider updating omarchy-launch-browser to skip an optional leading env + VAR= assignments when extracting the real executable, or choose an override approach that keeps the actual browser executable as the first Exec token.
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | ||
| sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | ||
| "$STOCK_DESKTOP" >"$USER_DESKTOP" |
There was a problem hiding this comment.
The sed rewrite only matches Exec= lines that begin with /usr/bin/chromium. If the stock desktop entry uses Exec=chromium ... (a pattern already used elsewhere in this repo’s .desktop handling), the substitution won’t apply but the script will still create ~/.local/share/applications/chromium.desktop, preventing subsequent runs from applying the fix. Consider matching both forms (e.g., chromium and /usr/bin/chromium) and/or only writing the override when at least one Exec= line was actually rewritten.
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | |
| sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | |
| "$STOCK_DESKTOP" >"$USER_DESKTOP" | |
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too. | |
| # Match both `Exec=chromium ...` and `Exec=/usr/bin/chromium ...`, and only create | |
| # the user override if at least one Exec= line was actually rewritten. | |
| ORIGINAL_DESKTOP_CONTENT="$(cat "$STOCK_DESKTOP")" | |
| REWRITTEN_DESKTOP_CONTENT="$( | |
| sed -E "s|^Exec=((/usr/bin/)?chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | |
| "$STOCK_DESKTOP" | |
| )" | |
| if [[ "$REWRITTEN_DESKTOP_CONTENT" != "$ORIGINAL_DESKTOP_CONTENT" ]]; then | |
| printf '%s\n' "$REWRITTEN_DESKTOP_CONTENT" >"$USER_DESKTOP" | |
| fi |
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | ||
| sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | ||
| "$STOCK_DESKTOP" >"$USER_DESKTOP" |
There was a problem hiding this comment.
The override is written directly to ~/.local/share/applications/chromium.desktop via redirection. If sed fails (e.g., unreadable stock desktop, unexpected format), this can leave behind an empty/partial override that then blocks future runs because the script exits early when the file exists. Consider writing to a temp file and moving it into place only on success.
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | |
| sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | |
| "$STOCK_DESKTOP" >"$USER_DESKTOP" | |
| TMP_USER_DESKTOP="$(mktemp "${USER_DESKTOP}.tmp.XXXXXX")" || exit 1 | |
| trap 'rm -f "$TMP_USER_DESKTOP"' EXIT | |
| # Rewrite every Exec= line so Desktop Actions (new-window, incognito) get the fix too | |
| if sed -E "s|^Exec=(/usr/bin/chromium.*)|Exec=env __EGL_VENDOR_LIBRARY_FILENAMES=$MESA_EGL LIBVA_DRIVER_NAME=$VAAPI_DRIVER \\1|" \ | |
| "$STOCK_DESKTOP" >"$TMP_USER_DESKTOP"; then | |
| mv "$TMP_USER_DESKTOP" "$USER_DESKTOP" | |
| trap - EXIT | |
| else | |
| exit 1 | |
| fi |
Address Copilot review feedback on omacom#5312: - Add bin/omarchy-launch-chromium that sets __EGL_VENDOR_LIBRARY_FILENAMES and LIBVA_DRIVER_NAME before exec'ing /usr/bin/chromium. Keeps the first Exec= token a single command so bin/omarchy-launch-browser's sed-based extraction still finds a real executable (previously got "env", which broke the keybinding browser launch flow). - Rewrite every Exec= line to point at the wrapper (absolute path, since .desktop files don't expand $VARS). - Broaden the sed pattern to match both Exec=/usr/bin/chromium and bare Exec=chromium, bounded by whitespace or end-of-line so we don't match chromium-browser or similar variants. - Atomic write: produce the new .desktop in a tmpfile, verify the sed actually made a substitution (so we don't leave a dead override that blocks future runs if the stock .desktop format drifts), then mv into place. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Thanks for the careful write-up in #4901. I reviewed head Two things need to change before this can land:
These checks passed: on a stubbed Intel + NVIDIA laptop layout, the override routes all three A question for the maintainer: this targets This is waiting on the maintainer to decide which branch it belongs on, and then on the detection change above. Because only hybrid hardware shows the bug, it will also need a reporter from #4901 or #2800 to confirm the fix on their machine at the final commit. |
On quattro, install/config/hardware is root-owned system setup, so the leaf that writes ~/.local/share/applications moves to install/user/hardware and is wired into install/user/all.sh. The migration takes a fresh timestamp so it sorts after quattro's existing ones. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Listing both an NVIDIA and an Intel/AMD GPU also matches a Ryzen desktop with an NVIDIA card, where Hyprland composites on NVIDIA and forcing Mesa EGL recreates the cross-GPU mismatch. omarchy-hw-nvidia-display reads boot_vga, as the Hyprland NVIDIA env does, and neither helper wakes a suspended GPU. It also stops the leaf failing under run_logged's bash -e on every machine without NVIDIA, where the empty lspci grep ended the script. Co-Authored-By: Claude Opus 5.5 <[email protected]>
lspci resumes a runtime-suspended NVIDIA GPU, and this runs on every browser and web app launch. The missing summary metadata failed test/cli. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… drives the display The override outlives the GPU layout it was installed for, so a laptop switched to NVIDIA-only would still pin Chromium to Mesa, which has no device there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
The leaf ends in trap - EXIT, so a failed mv of the override still returned 0 under plain bash and the migration was marked done without it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
|
This now targets What changed on the branch:
What was checked: all of this ran on a disposable Omarchy worker with no NVIDIA hardware, so the bug itself could not be reproduced there. I ran the leaf under Two things left for the maintainer, because fixing them means changing shared launcher code rather than this PR:
What this waits on: someone with a hybrid laptop whose built-in display runs on the Intel/AMD GPU. @josefdc, or anyone from #2800 or #4901 (@shapelesh's report is on 4.0.4). git clone https://github.com/josefdc/omarchy.git ~/omarchy-5312
git -C ~/omarchy-5312 checkout 636a793f3a35dc8007e7526280f3e4abf9e7828a
omarchy dev link ~/omarchy-5312 # reboots into the checkout
bash ~/omarchy-5312/install/user/hardware/fix-hybrid-chromium.shThen open Chromium from the launcher, check |
|
I tested this branch's assumptions against a real hybrid machine and opened a small stacked extension: josefdc#1 The machine is a MacBookPro11,3 (Haswell Iris Pro + GT 750M/Nouveau). It is a case the current boot_vga gate misses: NVIDIA is boot_vga and owns every connector, but AQ_DRM_DEVICES puts Intel first and Hyprland renders there. The Chromium failure was GPU-specific: its GPU process dumped core in libgallium while using NVIDIA's renderD128, and the kernel logged Nouveau DATA_ERROR / INVALID_VALUE bursts for Chromium. Intel is renderD129. Since September 13, a local workaround has kept Chromium on Intel with DRI_PRIME, Mesa EGL, Haswell's i965 VA-API driver, and a dynamically resolved --render-node-override; there have been no later Chromium coredumps or Chromium-attributed Nouveau errors through October 10. The stacked PR generalizes that workaround by following AQ_DRM_DEVICES, resolving PCI/render-node mappings through sysfs, preserving the existing boot_vga fallback, and adding regression coverage. It can be merged into this PR's branch without creating a competing upstream PR. |
quattro added vm-no-animations.sh beside fix-nouveau-cursor.sh, where this branch runs fix-hybrid-chromium.sh; both now run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
What was checked: on a disposable Omarchy worker with no NVIDIA hardware, Since the last review, A smaller point the second opinion found: @imr-git's report describes a different layout: NVIDIA is This is still waiting on a hybrid laptop whose built-in display runs on the Intel or AMD GPU. The questions from the last comment still stand, now at the new head. Does Chromium log git clone https://github.com/josefdc/omarchy.git ~/omarchy-5312
git -C ~/omarchy-5312 checkout 1b35ef48f9eff685280052b514d31f52e0cf87ff
omarchy dev link ~/omarchy-5312 # reboots into the checkout
bash ~/omarchy-5312/install/user/hardware/fix-hybrid-chromium.shThen open Chromium from the launcher, check |
|
| for device in /sys/bus/pci/devices/*; do | ||
| [[ -f $device/boot_vga ]] && (( $(< "$device/boot_vga") == 1 )) || continue | ||
| case $(< "$device/vendor") in | ||
| 0x8086) export LIBVA_DRIVER_NAME=iHD ;; |
There was a problem hiding this comment.
Older Intel video decoding breaks
On hybrid laptops with older Intel GPUs that require i965, this forces LIBVA_DRIVER_NAME=iHD instead. Those GPUs cannot use that driver, so Chromium loses hardware video decoding. Keep automatic driver selection for older Intel GPUs, or check the GPU generation before choosing iHD.
| sed -E "s@^Exec=(/usr/bin/chromium|chromium)( |\$)@Exec=$WRAPPER\2@" \ | ||
| "$STOCK_DESKTOP" >"$TMP_DESKTOP" |
There was a problem hiding this comment.
Replacing the first Exec command with omarchy-launch-chromium breaks the window lookup in omarchy-launch-browser. It builds the window-class pattern from that command's name, so it now searches for ^omarchy-launch-chromium.*$ rather than Chromium. Opening a URL can leave the existing browser window unfocused. Teach the launcher to use Chromium's window class for this wrapper.
| sed -E "s@^Exec=(/usr/bin/chromium|chromium)( |\$)@Exec=$WRAPPER\2@" \ | ||
| "$STOCK_DESKTOP" >"$TMP_DESKTOP" |
There was a problem hiding this comment.
Every link starts another process
The new Exec command disables the shortcut for sending URLs directly to a running Chromium window. omarchy-cmd-browser-handoff accepts /usr/bin/chromium but rejects this wrapper, so every browser and web-app launch starts another process. Its own comment puts that extra startup at about 165 ms. Recognize this known wrapper for an already-running browser, while keeping the wrapper for cold starts.
|
Update on the MacBookPro11,3 stack: josefdc#1 is now rebased onto this PR's current 1b35ef4 head. It also addresses all three October 10 review findings:
New focus and handoff regression tests pass, along with the Chromium GPU, default-browser, copy-URL, web-app, hardware, and command-style suites. test/cli passes completely on the rebased stack. The full headless shell run completed with every browser/Chromium test passing; its unrelated failures were environment/baseline checks involving read-only runtime paths and the absent companion omarchy-pkgs checkout. |
|
This PR's head is still Two of the three are fixed. The Haswell VA-API point is not fixed for the case it was about. A stock install gives "HD Graphics 4600" and "Iris Pro" GPUs A smaller conflict: in the A question for @imr-git: where is Scope is for the maintainer to decide. The muxed layout, where NVIDIA is What this still waits on: the same as before, a hybrid laptop whose built-in display runs on the Intel or AMD GPU, testing |
|
I updated the stacked change in josefdc#1 to
On the MacBook, export AQ_DRM_DEVICES="$HOME/.config/hypr/gpu-intel:$HOME/.config/hypr/gpu-nvidia"Those links are:
The nine related test scripts pass, as do |
|
This PR's head is still The Leaving Scope is still for the maintainer to decide. Whether the muxed layout belongs in this PR or one of its own is up to the maintainer, and taking the stack into this branch is up to @josefdc. What this PR still waits on is the same as before: someone with a hybrid laptop whose built-in display runs on the Intel or AMD GPU testing |
|
I tested this on the hardware it was written for, and on current Machine: ASUS Vivobook Pro 15 (K6502VJ). Intel Iris Xe (Raptor Lake-P, Method: for each case I started a separate Chromium (throwaway
In every case So, answering the two open questions:
My April reproduction was on Chromium 145, and that build didn't pick the render node this way. I think Chromium's own render-node selection, plus 6ecf4bf dropping the global NVIDIA VA-API env, covers #4901 on iGPU-display hybrids. This PR would add a user @imr-git, your MacBookPro11,3 case may be covered the same way. Your crash was on August 28, and with |
|
Thanks for testing this on the original hardware, @josefdc. This comment covers your report above; the PR's head is still What the report shows. On the layout this PR targets (Intel Iris Xe drives the display, RTX 3050 on What it does not cover. AMD iGPUs, Chromium derivatives, older NVIDIA drivers and the muxed layout from @imr-git's MacBookPro11,3 were not tested. A short session also cannot rule out a failure that only shows up now and then. None of that makes this PR's override, wrapper and migration necessary, because they now have no failing case to justify them. Anyone from #4901 or #2800 who still sees the errors with plain What happens next. This waits on the maintainer, and the recommendation is to close it as no longer needed. Closing is their call, so I have not closed it. |
|
Update on the MacBookPro11,3 test and the stacked change: I pushed I also tested Chromium 154 through plain During roughly one hour of Jellyfin playback, the screen went black and I had to restart the machine. The previous-boot journal recorded 283,840 Nouveau GPU trap messages beginning during playback and continuing until the restart. There was no Chromium coredump or OOM event. The traps were attributed to Hyprland’s Nouveau channel, so I am not claiming this was a Chromium process crash. The same Jellyfin app previously ran for over two hours through the Intel wrapper without these traps. This leaves the muxed MacBook layout as a real remaining case, while the original iGPU-display case no longer reproduces. Would you prefer that I extract the MacBook/AQ_DRM_DEVICES fix into a smaller standalone PR against |
|
Follow-up on the MacBookPro11,3: I repeated the Jellyfin test with plain /usr/bin/chromium, the Chromium GPU overrides cleared, native Wayland, and the GPU process still using NVIDIA renderD128. The only session change was AQ_FORCE_LINEAR_BLIT=0. The episode completed after about 70 minutes. Chromium remained native Wayland (xwayland: false), the GPU process stayed on renderD128 with gpu-recent-crash-count=0, and the kernel journal recorded 0 gr: TRAP, 0 GPC/PROP traps, and 0 Nouveau DATA_ERROR/INVALID events. There was no coredump or OOM event. For comparison, the earlier native-Wayland run without that setting produced the trap storm and black screen. An XWayland control run on renderD128 completed without a black screen or traps, but still logged 21 Nouveau DATA_ERROR/INVALID events. This isolates the failure more closely to the native-Wayland Aquamarine/Hyprland cross-GPU blit path on Nouveau than to a Chromium process crash. AQ_FORCE_LINEAR_BLIT=0 is a promising workaround on this machine, although one clean run is not proof of a complete fix. I removed the temporary setting and rebooted after the test. Given this result, I do not think the MacBook case is a reason to expand the Chromium wrapper in this PR. It looks better suited to a compositor-level workaround or upstream investigation, while #5312 can be decided on the original iGPU-display case. |
|
Thanks for the two MacBookPro11,3 runs, @imr-git. This PR's head is still What changes. The MacBook was the one case left open as a possible reason for a narrower Chromium fix. As you report it, plain Chromium 154 on NVIDIA What it does not show. It is one run per condition, the XWayland control still logged Nouveau What happens next. Nothing changes from the last comment: this waits on the maintainer, and the recommendation is to close it as overtaken by Chromium's own render-node selection and 6ecf4bf on |
Summary
Fixes #4901 — Chromium black screens, flicker, and GPU process crashes on hybrid NVIDIA + Intel/AMD iGPU laptops.
On these machines Hyprland composites on the integrated GPU, but GLVND's default priority order loads NVIDIA EGL first (
10_nvidia.jsonpriority 10 vs Mesa's50_mesa.jsonpriority 50). Chromium therefore renders on NVIDIA and tries to import its DMA-BUF buffers as EGLImages on the iGPU side, failing withEGL_BAD_MATCH (0x3009)hundreds of times a second and producing the visible breakage.This PR installs a per-app override so Chromium only uses Mesa EGL (same GPU as the compositor). The system-wide EGL stack is untouched, so Hyprland itself and every other app keep NVIDIA EGL where they need it.
Changes
install/config/hardware/fix-hybrid-chromium.sh— new install-time scriptlspci~/.local/share/applications/chromium.desktopderived from the stock/usr/share/applications/chromium.desktop, rewriting everyExec=line to prefixenv __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json LIBVA_DRIVER_NAME=<iHD|radeonsi>chromium.desktopoverrideinstall/config/all.sh— run the script afternvidia.sh/vulkan.shmigrations/1776262789.sh— delegate to the same script so existing installs get the fix on nextomarchy-updateWhy a desktop override, not a wrapper or envs.conf
envs.conf(global) — tried and breaks Hyprland: the compositor can't initialize EGL on its preferred vendor and crashes on startup, requiring TTY recovery.~/.local/bin/chromiumwrapper — works but depends onPATHordering and doesn't transparently apply to Desktop Actions; users also bypass it by typing/usr/bin/chromium..desktopoverride (this PR) — doesn't depend onPATH, survives upgrades, transparently covers launcher/Walker/menu invocations and both Desktop Actions (new-window and incognito) since everyExec=line is rewritten.Scope
Chromium only (the browser Omarchy ships by default). The same pattern works for Brave / Chrome / Helium / Thorium — reporters in #4901 confirmed — but extending it is left for a follow-up to keep this PR small.
Verified results (from
chrome://gpu)eglCreateImageerrorsHardware: 13th Gen Intel Iris Xe + RTX 3050, Omarchy 3.4.1, Chromium 145. Other reporters in #4901 confirmed the same fix on AMD iGPU + NVIDIA dGPU (and on Helium, a Chromium derivative).
Test plan
bash -nclean on all three filesHOME; a full install run is out of reach here)Closes #4901