Repository navigation
Don't pin VA-API to NVIDIA on hybrid GPU systems - #9812
Closed
ifigueroap wants to merge 1 commit into
Closed
ifigueroap wants to merge 1 commit into
ifigueroap wants to merge 1 commit into
Conversation
nvidia.lua exports LIBVA_DRIVER_NAME=nvidia for the whole session whenever it finds an NVIDIA GPU with GSP firmware. That is right for an NVIDIA-only machine, but on a hybrid laptop the iGPU normally drives the panel, so every app decodes video on the dGPU and each frame then crosses the PRIME boundary to reach an iGPU-composited display. Video flickers while scrolling. Gate the pin on a new omarchy-hw-nvidia-only detector. Left unset, libva picks the driver matching whichever GPU an app actually renders on, which is the per-device answer a hybrid system needs. The detector reads sysfs rather than reusing omarchy-hw-hybrid-gpu, which shells out to lspci: nvidia.lua already documents that lspci reads PCI config space, resuming a runtime-suspended GPU, and that the wake alone outlasts Hyprland's 1.5s config reload budget. NVD_BACKEND and __GLX_VENDOR_LIBRARY_NAME are left alone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BT3H7mj63CxzHWKLd4apWk
Member
|
Automated duplication check: this pull request looks similar to #7851, which covers the same LIBVA-only NVIDIA gating on hybrid-GPU systems. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a hybrid GPU laptop, video flickers while scrolling — reproducible on Twitter/X, where videos scroll in and out of the viewport continuously.
Root cause
default/hypr/nvidia.luaexportsLIBVA_DRIVER_NAME=nvidiafor the whole session whenever it finds an NVIDIA GPU with GSP firmware. The systemd user manager inherits it, so desktop launches get it too.That is correct on an NVIDIA-only machine. On a hybrid laptop the iGPU normally drives the panel, so pinning VA-API to the NVIDIA driver makes every app decode video on the dGPU, and each decoded frame then crosses the PRIME boundary to reach an iGPU-composited display.
Measured on the affected machine before the fix — Edge's GPU process:
while the panel is on the Intel iGPU (
card2-eDP-2,i915).Fix
Gate the pin on a new
omarchy-hw-nvidia-onlydetector. Left unset, libva picks the driver matching whichever GPU an app actually renders on — the per-device answer a hybrid system needs.NVD_BACKENDand__GLX_VENDOR_LIBRARY_NAMEare left alone.The detector reads sysfs rather than reusing
omarchy-hw-hybrid-gpu, which shells out tolspci.nvidia.luaalready documents why that matters: lspci reads PCI config space, resuming a runtime-suspended GPU, and the wake alone outlasts Hyprland's 1.5s config reload budget.Verification
Hardware: Intel Raptor Lake-P
[8086:a7ab]+ NVIDIA GA107BM RTX 3050 Laptop[10de:25ac], panel on the iGPU, Omarchy 4.0.2,nvidia-open-dkms610.57.04, Hyprland/Wayland.Applying the change (via an equivalent per-app override) and restarting the browser:
nvidia_drv_video.soiHD_drv_video.solibEGL_nvidia.solibEGL_mesa.so/dev/nvidia0fdsFlicker is gone. Hardware decode is retained, now on the iGPU:
Worth noting that unsetting the variable was sufficient on its own — EGL moved to Mesa as a consequence, without needing
__EGL_VENDOR_LIBRARY_FILENAMES. That is why this PR changes only the one export.Note this requires an iGPU VA-API driver to be present (
intel-media-driverhere). Without one, decode falls back to software instead of decoding on the wrong GPU — which is the safer failure, and no worse than the current behaviour on machines where the NVIDIA VA-API driver is absent.Tests
test/shell.d/hw-nvidia-test.shcovers the new detector across every existing fixture, plus a new Intel + NVIDIA hybrid case.test/clipasses.test/shellhas 3 failures (config-test,snapper-test,unowned-system-paths-test) that reproduce identically on unmodifiedquattro.🤖 Generated with Claude Code
https://claude.ai/code/session_01BT3H7mj63CxzHWKLd4apWk