Skip to content

Keep hybrid VA-API on the render GPU - #9138

Closed
yashranaway wants to merge 2 commits into
omacom:quattrofrom
yashranaway:fix/nvidia-vaapi-hybrid-gpu
Closed

yashranaway wants to merge 2 commits into
omacom:quattrofrom
yashranaway:fix/nvidia-vaapi-hybrid-gpu

Conversation

@yashranaway

Copy link
Copy Markdown
Contributor

<<<< AI wording below >>>>

Problem

On hybrid Intel or AMD plus NVIDIA laptops, the session-wide LIBVA_DRIVER_NAME=nvidia override sends video decoding to the discrete GPU even when the integrated GPU owns rendering. This can freeze hardware-accelerated video and unnecessarily wake the discrete GPU.

Fixes #9096.

Fix

Add a cached sysfs detector for NVIDIA-only display configurations and set LIBVA_DRIVER_NAME=nvidia only when every display controller is NVIDIA. Hybrid systems now keep automatic VA-API driver selection while retaining the existing NVIDIA backend and GLX settings.

Verification

  • ./test/shell.d/hw-nvidia-test.sh
  • bash test/shell.d/bin-style-test.sh
  • bash -n bin/omarchy-hw-nvidia-only test/shell.d/hw-nvidia-test.sh
  • git diff --check
  • Added Intel and AMD hybrid fixtures plus NVIDIA-only coverage
  • Live hybrid-GPU video verification is still needed

@nixfred

nixfred commented Aug 30, 2026

Copy link
Copy Markdown

Live hardware verification on an AMD + NVIDIA hybrid laptop:

  • Omarchy 4.0.1-1
  • NVIDIA AD107M / RTX 4050 Mobile (10de:28a1)
  • AMD HawkPoint2 iGPU (1002:1901)
  • Hyprland and Brave were rendering through the AMD render node, while the session-wide LIBVA_DRIVER_NAME=nvidia made Brave load nvidia_drv_video.so and open /dev/nvidia*.
  • Repro was severe page jitter while scrolling X across autoplaying videos. It occurred with both two-finger scrolling and dragging Brave's scrollbar, so it was not a touchpad-input issue.
  • Launching the same native-Wayland Brave session with LIBVA_DRIVER_NAME=radeonsi removed the jitter; the user confirmed X video scrolling was smooth.
  • This PR's omarchy-hw-nvidia-only returns 1 against the laptop's real sysfs tree, as intended.

Verification on this branch:

  • ./test/shell.d/hw-nvidia-test.sh passes.
  • bash test/shell.d/bin-style-test.sh passes.
  • ./test/all reaches the end. Its six failures are unrelated/environmental and reproduce on current quattro (missing omarchy-pkgs checkout plus local graphical/network assumptions).

This supplies the live AMD-hybrid verification requested in the PR description.

@yashranaway
yashranaway marked this pull request as ready for review September 7, 2026 20:28
@yashranaway

Copy link
Copy Markdown
Contributor Author

Thanks for checking the detector on real AMD/NVIDIA hardware and confirming the VA-API workaround, I have marked this ready for review.

@mvaleed mvaleed left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up on this issue after facing it on my Lenovo legion 5. Appreciate the fix!

@rdoupe

rdoupe commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Same hybrid LIBVA / LIBVA_DRIVER_NAME gate as open PRs #7851, #9483, #9812, #10588, #10589.

This PR already has a human approval. Suggest treating those as duplicates of #9138 (close or label as duplicate) so review stays in one place.

@devwizr

devwizr commented Sep 19, 2026

Copy link
Copy Markdown

Confirmed on another AMD + NVIDIA hybrid laptop:

  • Omarchy 4.0.4-1
  • Kernel 7.2.5-3-omarchy
  • AMD Radeon 780M driving the display
  • NVIDIA RTX 4070 Laptop GPU
  • Brave Origin 153.1.95.104
  • LIBVA_DRIVER_NAME=nvidia caused black YouTube video frames
  • Launching Brave with LIBVA_DRIVER_NAME=radeonsi fixed playback
  • The permanent Hyprland override also works after re-login

VA-API H.264 decoding was tested successfully on both render nodes, so the
problem is the cross-GPU selection rather than missing codecs or drivers.

@bjarneo

bjarneo commented Sep 20, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvidia.lua sets LIBVA_DRIVER_NAME=nvidia on hybrid Intel+NVIDIA laptops; Brave/Chromium video playback stalls the GPU process

6 participants