Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Adds sysfs-based hybrid-GPU detection to avoid forcing NVIDIA VA-API on multi-vendor systems.
Changes:
- Detects display GPUs from multiple vendors.
- Applies NVIDIA VA-API override only on non-hybrid systems.
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.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
default/hypr/nvidia.lua |
Conditionally applies the NVIDIA VA-API driver. |
bin/omarchy-hw-hybrid-gpu-sysfs |
Adds fast sysfs-based hybrid-GPU detection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Confirming this on an AMD iGPU + NVIDIA machine — the issue, this PR, and #4901 are all Razer Blade 14: Ryzen 9 5900HX / Cezanne iGPU (
Setting One caveat worth recordingThe description says With the VA-API fix applied and GLX pointed at mesa, Brave's GPU process on this machine Adding a Mesa EGL override on top of this PR is what actually settled the stutter. So this And a trap, if anyone is tempted to fold the EGL half in hereSetting The monitor modesets and reports Two smaller notes that cost me time:
|
|
Confirming on a third Intel+NVIDIA pairing, with Google Chrome 151 rather than Chromium, and with numbers from an automated A/B run. Machine: Microsoft Surface Laptop Studio — Intel TigerLake Iris Xe
What the stock env does here ( A/B on reddit.com (25 s scripted wheel-scroll via DevTools protocol, fresh profile, everything identical except the variable):
Same result with the variable unset as with Two notes for reviewers:
Related: #8215, #8328, #8726, #4901. Investigation and this comment were authored with Claude Fable 5 in the Claude Code harness; measurements were taken on the machine described above and the fix was verified manually by the account owner. |
|
Confirmed on another Intel + NVIDIA hybrid, with the original failure occurring specifically at YouTube's ad-to-main-video transition. Machine: HP Victus 15-fa0xxx — Alder Lake-P UHD On the stock 4.0.1 environment, both Chromium and Brave could render ads, but the whole window became unresponsive when the main video loaded. The GPU logs showed the same cross-device import failure described here: Validation of this PR's exact policy:
This confirms that unsetting only the forced VA-API driver is sufficient on this Intel-rendered native-Wayland configuration; a session-wide EGL override is not needed here. |
|
Confirming the same Machine: ASUS TUF Gaming F17 FX707VV4 — Raptor Lake-P Iris Xe Stock
Not opening a duplicate PR — this one already has the detector + |
On hybrid laptops the iGPU drives the display, and apps like Chromium deliberately skip the NVIDIA device and decode video on the iGPU. Forcing LIBVA_DRIVER_NAME=nvidia there loads libva-nvidia-driver for a render node it cannot serve, so hardware video decode fails entirely and browsers fall back to software decode (see omacom#4901). Gate the variable on a new sysfs-based hybrid detector so single-GPU NVIDIA systems keep the explicit driver (avoiding the nouveau ambiguity) while hybrid systems let libva pick per device. Like the existing detectors it reads cached sysfs IDs instead of lspci, which would resume a runtime-suspended dGPU and blow Hyprland's config reload budget.
0dc7a54 to
da6356f
Compare
|
Rebased onto the latest |
|
Confirming on an AMD+NVIDIA hybrid, and adding a symptom beyond broken/black video: System
SymptomOn image-heavy sites (amazon.ca product grids, youtube.com), Chrome/Brave/Chromium show patchy rectangular corruption while scrolling. Tiles render as uninitialized GPU memory — at one point the page content area displayed the desktop wallpaper texture (stale VRAM). The browser GPU process logs floods of: The browser renders on the AMD render node ( BisectIdentical Chromium launch on amazon.ca, only the environment varied:
Ruled out along the way: Mesa 26.2.1 (downgraded full stack to 26.1.8 — no change), Chromium version (151 and 152 both affected), Hyprland damage tracking, explicit sync ( WorkaroundUser-level override in hl.env("LIBVA_DRIVER_NAME", "radeonsi")Agreed with the direction here and in #8989/#9483: nvidia.lua should only export the NVIDIA VA-API/GLX env when the NVIDIA GPU actually drives the session, and on iGPU-primary hybrids should point libva at the iGPU's driver ( |
|
Confirming on a second AMD iGPU + NVIDIA pairing, measured at the decode engine rather than from logs. Machine: ASUS ROG Zephyrus G14 GA402XV — Radeon 780M / Phoenix1
A/B. Same page (local loop of autoplaying H.264), same binary, fresh profile, only the variable differing.
Chrome had already selected the AMD node itself ( Unsetting is sufficient and safe here — libva's per-device auto-selection gives the right answer on both nodes. Calling The first line is the fault in isolation: the export overrides libva even when the caller opened an AMD device. The third is why dropping it costs nothing on NVIDIA-only machines. One measurement caveat, as it bears on how #9812 verified. On the EGL half. After this change Chrome's GPU process here still maps Detector comparison. Four open PRs propose four detectors; all four return the correct verdict on this hardware, well inside the config-reload budget: One difference worth flagging for whoever picks between them, from reading the code rather than from measurement: this laptop's HDMI port is wired to the dGPU ( Follow-up: subjective confirmation from the machine owner — with Investigated with Claude Opus 5 in Claude Code; all measurements were taken on the machine described above. |
|
Reviewed against What What ran: How the two approaches differ, for whoever closes this:
Second opinion: Codex Medium read the same tree and came to the same conclusion, that |
|
The link is already there. The earlier comment here mentions #11690, so GitHub lists this pull request in #11690's timeline ("omarchybot mentioned this pull request", September 28). Anyone who reads #11690 can follow it back to the investigation and hardware reports in this thread, so nothing more needs to be added on that side. Nothing else has changed: |
Problem
On hybrid Intel+NVIDIA laptops,
default/hypr/nvidia.luasetsLIBVA_DRIVER_NAME=nvidiafor any GSP-capable NVIDIA GPU. On hybrid systems the iGPU drives the display, and Chromium's GPU process deliberately skips the NVIDIA DRM device (logsShould skip nVidia device named: nvidia-drm) and uses the Intel render node. With libva forced to the NVIDIA driver, VA-API cannot initialize for the Intel node: the Chromium GPU process loadsnvidia_drv_video.sobut neveriHD_drv_video.so, so hardware video decode is dead and playback falls back to software decode. In practice, buffered 24-30fps VOD mostly survives on CPU, but 60fps live streams stutter and freeze the browser. Same root cause as the VAAPI part of #4901.Fix
Only force
LIBVA_DRIVER_NAME=nvidiawhen the system is not hybrid. The newomarchy-hw-hybrid-gpu-sysfsdetector reports hybrid when display-class PCI devices from more than one vendor are present. Like the existingomarchy-hw-nvidia*detectors it reads cached sysfs IDs instead of lspci (which resumes runtime-suspended GPUs and can exceed Hyprland's config reload budget), and unlikeomarchy-hw-hybrid-gpuit never queries supergfxd, so it is always fast enough to run during config reload.With the variable unset, libva auto-selects the driver per device (iHD for the Intel node, nvidia for the dGPU node) — verified with ffmpeg VA-API decode on both render nodes of a hybrid laptop.
NVD_BACKEND=directand__GLX_VENDOR_LIBRARY_NAME=nvidiaare unchanged: the former only matters when libva-nvidia-driver is actually used, the latter only affects GLX/XWayland clients.Testing
OMARCHY_PCI_DEVICES_PATH: single NVIDIA → no, Intel+NVIDIA → yes, dual NVIDIA → no, Intel+AMD → yes, non-GPU only → no; real hybrid laptop (Core Ultra 9 285H + RTX 5090, Omarchy 4.0.0) → yes.LIBVA_DRIVER_NAME=iHD) makes newly launched apps — including ones started throughuwsm app— pick up the corrected driver, and Chromium VA-API initializes against the Intel iGPU../test/allpasses except 4 pre-existing environment-dependent failures (tests requiring anomarchy-pkgscheckout or a graphical session); they fail identically on unmodified master.Refs #4901