omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Hybrid iGPU-primary laptops: nvidia.lua forces NVIDIA env session-wide — video corruption (root cause of #4901) and blocked dGPU runtime suspend

Open karluiz opened this issue 3 months ago • 11 comments

System details

  • CPU: Intel Core Ultra 9 275HX (Arrow Lake)
  • GPU (integrated): Intel Arrow Lake-S — drives the internal eDP panel
  • GPU (discrete): NVIDIA GeForce RTX 5080 Max-Q (no display connected; HDMI/one DP are wired to it)
  • Drivers: nvidia-open-dkms 610.57.04, Mesa 26.2.1, intel-media-driver 26.2.4, libva-nvidia-driver 0.0.17
  • Omarchy: 4.0.1
  • Kernel: 7.1.9-arch1-2
  • Laptop: Lenovo Legion 7i Pro (99.9 Wh battery)

Problem

On hybrid laptops where the iGPU drives the panel, default/hypr/nvidia.lua detects the NVIDIA GPU and unconditionally sets, during config parse:

hl.env("NVD_BACKEND", "direct")
hl.env("LIBVA_DRIVER_NAME", "nvidia")
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")

Then default/hypr/autostart.lua exports the resulting environment session-wide on hyprland.start:

hl.exec_cmd("systemctl --user import-environment $(env | cut -d'=' -f 1)")
hl.exec_cmd("dbus-update-activation-environment --systemd --all")

So every app (launcher, web apps, Electron apps, browsers) inherits LIBVA_DRIVER_NAME=nvidia and __GLX_VENDOR_LIBRARY_NAME=nvidia. On an iGPU-primary hybrid this has three consequences:

1. Cross-GPU video corruption (the root cause behind #4901 / #3899)

Chromium/Electron apps decode video on the NVIDIA GPU (NVDEC via libva-nvidia-driver) while presenting on the Intel GPU. Importing those DMA-BUFs into the iGPU fails (eglCreateImage → EGL_BAD_MATCH), producing corrupted video, ghosting while scrolling, and stuttering animations. #4901 documents the Chromium symptoms and workarounds in depth; the reason vainfo defaults to NVDEC in the first place is this hl.env in nvidia.lua.

It's not just Chromium: any Electron app is affected (reproduced with Discord GIF rendering and a custom Electron app whose particle animations froze periodically).

2. The dGPU can never runtime-suspend → measurable battery drain

With LIBVA_DRIVER_NAME=nvidia, any app that touches video decode opens CUDA (/dev/nvidia-uvm). An open nvidia-uvm fd blocks RTD3 runtime suspend unconditionally (even with DynamicPowerManagement fine-grained active), pinning the dGPU at ~5 W forever.

Measured on this machine (99.9 Wh battery, ~15 W idle draw): the dGPU alone accounts for ~1/3 of idle battery drain. Verified with /sys/bus/pci/devices/<dgpu>/power/runtime_suspended_time: 0 ms of suspension while a browser was open; with LIBVA_DRIVER_NAME=iHD the dGPU stays in D3cold even during YouTube playback (decode runs on the Intel media engine, which is also more power-efficient).

3. User overrides are silently defeated

hl.env is last-wins during parse, and nvidia.lua runs inside require("default.hypr.omarchy"). A user who sets hl.env("LIBVA_DRIVER_NAME", "iHD") at the top of hyprland.lua (before the require, where the template invites configuration) gets silently overridden. Debugging this is extra confusing because /proc/<hyprland-pid>/environ still shows the exec-time environment, not the parse-time setenv values that children actually inherit.

Expected behavior

On hybrids where the boot display (eDP) is connected to the iGPU, video decode and GLX should default to the iGPU. The NVIDIA-specific env should apply only when the NVIDIA GPU is primary (drives the connected display), e.g.:

# panel-on-iGPU detection sketch: check which card exposes the connected eDP
for c in /sys/class/drm/card*-eDP-*; do
  [[ $(< "$c/status") == connected ]] && ...
done

Alternatively (or additionally), nvidia.lua could skip each hl.env when the variable is already set by user config.

Workaround that fixes everything (validated)

In ~/.config/hypr/hyprland.lua, after require("default.hypr.omarchy"):

hl.env("LIBVA_DRIVER_NAME", "iHD")           -- radeonsi for AMD iGPUs
hl.env("__GLX_VENDOR_LIBRARY_NAME", "mesa")

Games that should use the dGPU keep working by scoping __NV_PRIME_RENDER_OFFLOAD=1 etc. to their own launch scripts.

Results after the override + relogin: no video corruption in Chromium/Electron, dGPU suspends (D3cold) even during video playback, idle draw dropped ~5 W (~6.5 h → ~9 h estimated on this machine).

Steps to reproduce

  1. Omarchy on a hybrid laptop whose eDP panel is on the iGPU (mux in hybrid mode), with libva-nvidia-driver installed.
  2. Boot, run vainfo → reports "VA-API NVDEC driver" instead of the iGPU driver.
  3. systemctl --user show-environment | grep -E 'LIBVA|GLX' → nvidia values.
  4. Open YouTube in Chromium; watch /sys/bus/pci/devices/<dgpu>/power/runtime_status stay active (and runtime_suspended_time frozen) while the Chromium GPU process holds /dev/nvidia-uvm.
  5. Apply the override above, relogin, repeat: iHD, uvm closed, dGPU suspended.

karluiz avatar Aug 29 '26 18:08 karluiz

Follow-up with a finding that closes the loop on the #4901 workarounds:

After cleaning the session environment (the override in the issue description) and relogging, we re-tested Chromium with GPU compositing enabled (no `--disable-gpu-compositing`, no special flags at all):

  • No ghosting while scrolling / moving the mouse
  • No video corruption; playback smooth at 2560x1600@240
  • `iHD_drv_video.so` loaded, zero `/dev/nvidia-uvm` fds
  • dGPU stayed in D3cold (`runtime_status: suspended`) during YouTube playback

So on iGPU-primary hybrids, the Chromium symptoms in #4901 (EGL_BAD_MATCH storms, black screens, ghosting) appear to be entirely downstream of the session-wide NVIDIA env from `nvidia.lua`: with `LIBVA_DRIVER_NAME` and `__GLX_VENDOR_LIBRARY_NAME` pointing at the iGPU stack, full hardware acceleration (raster + decode + GPU compositing) works out of the box and `--disable-gpu-compositing` becomes unnecessary.

karluiz avatar Aug 29 '26 19:08 karluiz

Additional data point from the other end of the hardware range: the same "dGPU can never runtime-suspend" symptom from §2, on a machine where the LIBVA_DRIVER_NAME → CUDA mechanism demonstrably isn't the cause. It looks like the no-GSP branch of nvidia.lua may need its own fix.

System details

  • CPU: Intel Core i7-10810U (Comet Lake)
  • GPU (integrated): Intel Comet Lake UHD Graphics [8086:9bca] — card2 / renderD129, drives the only connected output (card2-eDP-1)
  • GPU (discrete): NVIDIA Quadro P520 (GP108GLM, Pascal) [10de:1d34] — card1 / renderD128, no display attached; aquamarine logs Skipping device .../0000:6c:00.0/drm/card1, not a KMS device
  • Drivers: nvidia-580xx-dkms 580.178.04, Mesa 26.2.1
  • Omarchy: 4.0.1-1
  • Kernel: 7.1.9-arch1-2

Which branch runs here

Pascal has no GSP, so default/hypr/nvidia.lua takes the second branch:

elseif o.shell_succeeds(o.shell_quote(nvidia_without_gsp)) then
  hl.env("NVD_BACKEND", "egl")
  hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
end

Confirmed in the live session (environment of a Hyprland child):

NVD_BACKEND=egl
__GLX_VENDOR_LIBRARY_NAME=nvidia

Note there is no LIBVA_DRIVER_NAME — that is only set on the GSP branch.

The dGPU still never suspends

/sys/bus/pci/devices/0000:6c:00.0/power_state                  D0
                                 /power/runtime_status         active
                                 /power/control                on
                                 /power/runtime_suspended_time  0
                                 /power/runtime_active_time     3161136   # == full uptime

Zero milliseconds of runtime suspension, for the entire session.

And it is not the CUDA path described in §2:

$ lsmod | grep nvidia_uvm
nvidia_uvm  ...  used_by=0     # loaded, but no process holds a CUDA context

No process holds /dev/nvidia-uvm. What pins the card is the desktop session itself:

Hyprland (4667)         3x /dev/nvidia0  2x /dev/nvidiactl  1x renderD128 (nvidia)
                        6x card2 (i915)  6x renderD129 (i915)
voxtype-osd-gtk (4783)  7x /dev/nvidia0  4x /dev/nvidiactl  1x /dev/nvidia-modeset
chrome                  1x renderD129 (i915) only — clean

The compositor scans out entirely on the Intel card and still keeps three fds open on /dev/nvidia0. quickshell appears in the same holder list at other times.

Hypothesis (not yet verified)

__GLX_VENDOR_LIBRARY_NAME only steers libglvnd's GLX vendor dispatch. It does not affect EGL device enumeration, which walks /usr/share/glvnd/egl_vendor.d/ — and 10_nvidia.json sorts ahead of 50_mesa.json, so an EGL client that enumerates devices will open the NVIDIA driver regardless of that variable. On the no-GSP branch that leaves nothing steering the session away from the dGPU: NVD_BACKEND=egl arguably points it at the card, and the single override that is set governs a different API.

If that holds, the no-GSP branch would need an EGL-side equivalent of what the LIBVA_DRIVER_NAME=iHD override does for VA-API in §3 — on iGPU-primary hybrids, something like:

__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json

I have not confirmed that this fixes it. The override is staged in ~/.config/environment.d/ here but needs a fresh login, and the checks that would settle it have not run yet: holders of /dev/nvidia* empty, modprobe -r nvidia succeeding, and the card actually reaching D3cold. I will follow up with those numbers either way — posting now in case the Pascal / no-GSP variant is useful while this is being looked at.

karem505 avatar Aug 30 '26 22:08 karem505

Independent confirmation on near-identical hardware, plus one negative result that I think is worth adding to the symptom list because it actively misleads diagnosis.

Same CPU, different dGPU and OEM

  • CPU: Intel Core Ultra 9 275HX (Arrow Lake) — same as the reporter
  • iGPU: Intel Arrow Lake-S [8086:7d67], i915, card0 — drives the internal eDP panel
  • dGPU: NVIDIA GeForce RTX 5070 Max-Q [10de:2d18], card1 — zero connected outputs
  • Omarchy: 4.0.1-1 · Kernel: 7.1.9-arch1-2
  • Drivers: intel-media-driver 26.2.4-1, libva-nvidia-driver 0.0.17-1, libva 2.24.0
  • HP laptop (not Lenovo), so this is not OEM-specific.

The detector verdicts on this machine, confirming the code path in the report:

omarchy-hw-nvidia:             TRUE
omarchy-hw-nvidia-gsp:         TRUE   -> sets LIBVA_DRIVER_NAME=nvidia
omarchy-hw-nvidia-without-gsp: false

And the panel/output topology that makes the choice wrong here:

card0 (Intel):  connected outputs = card0-eDP-1
card1 (NVIDIA): connected outputs = <none>

New symptom: it is not only video elements

The corruption is usually reported against <video> (autoplay feeds, YouTube). Here it first showed up on a WebRTC/canvas remote-console UI (a GL.iNet GLKVM web UI) with no <video> autoplay involved — it rendered garbled, then black, in Chrome. The same URL was fine from another machine. So the blast radius is any cross-GPU DMA-BUF import path, not just page video, which makes it easy to misattribute to the remote device rather than the local GPU routing.

Negative result worth recording: --disable-features=VaapiVideoDecoder does NOT fix it

This is the obvious first thing to try, and it fails in a way that produces a false conclusion. On this machine the flag was confirmed live in the running process and changed nothing — which led me to rule VA-API out entirely and spend a session chasing Tailscale MTU and compositor theories instead.

Disabling Chromium's decoder feature is not the same as giving libva a working, matched driver: LIBVA_DRIVER_NAME=nvidia is still exported session-wide and the NVIDIA VA driver still loads. I ended up masking the problem with --disable-gpu-compositing in chrome-flags.conf, which "works" and cements the wrong root cause.

After setting LIBVA_DRIVER_NAME=iHD per this issue's workaround, I removed --disable-gpu-compositing and the console renders correctly with full GPU acceleration. That is the cleanest confirmation I have that the env var, not compositing, was the cause.

Note both VA drivers are functional in isolation here — this is a wrong GPU bug, not a missing-driver bug:

LIBVA_DRIVER_NAME=nvidia -> "VA-API NVDEC driver [direct backend]"   (decode only, VLD)
LIBVA_DRIVER_NAME=iHD    -> "Intel iHD driver ... 26.2.4"            (VLD + EncSlice)

On the runtime-suspend claim

I can only report the post-change state, since I did not measure before switching — so this corroborates rather than reproduces. With iHD in effect the dGPU does reach D3:

runtime_status:         suspended
runtime_suspended_time: 4777977 ms
control:                auto

One thing the iHD workaround does not cover

The user-config override fixes LIBVA_DRIVER_NAME, but the other two exports from nvidia.lua survive it session-wide:

$ systemctl --user show-environment | grep -E 'LIBVA|NVD_BACKEND|__GLX'
LIBVA_DRIVER_NAME=iHD
NVD_BACKEND=direct
__GLX_VENDOR_LIBRARY_NAME=nvidia

__GLX_VENDOR_LIBRARY_NAME=nvidia is still forced on a machine whose panel and compositor run on Intel. If the fix here gates the NVIDIA env on "does the dGPU drive a connected output", it would be worth gating all three together rather than LIBVA_DRIVER_NAME alone.

FWIW the detection sketch in this issue matches what I'd independently arrived at: the robust signal is whether any 0x10de card owns a connected DRM output, which is cheap to read from sysfs and does not resume a runtime-suspended GPU — consistent with the existing comments in omarchy-hw-nvidia* about avoiding lspci.

rogerfsh avatar Aug 31 '26 05:08 rogerfsh

Another data point, from the AMD side and focused on the power consequence rather than the video corruption — plus one blocker that I don't think has been mentioned in this thread or the related ones.

Hardware

  • CPU/iGPU: Ryzen 7 5800H (Cezanne) — drives the internal eDP-1
  • dGPU: RTX 3060 Mobile — HDMI-A-1 and DP-1 are wired to it
  • nvidia-open-dkms 610.57.04 · Mesa 26.2.1 · Kernel 7.1.11 · Omarchy 4 (dev)

Same GSP branch as the report (omarchy-hw-nvidia-gsp succeeds), so LIBVA_DRIVER_NAME=nvidia + __GLX_VENDOR_LIBRARY_NAME=nvidia are set. This matches @NamanBalaji's 5800H + RTX 3050 in #8726.

What the env actually costs, measured

With everything fixed the machine went from 23.7 W to 10.7 W at idle on battery — the dGPU alone was ~10 W, more than half the system draw.

But I want to be precise about attribution, because I initially got it wrong: nvidia.lua's env was not, by itself, what kept the dGPU awake at idle. I tested this directly — with LIBVA_DRIVER_NAME/__GLX_VENDOR_LIBRARY_NAME restored to nvidia, the dGPU still reached D3cold and stayed there 100% of a 90 s window, once two other blockers were removed.

What the env does cost is routing real work to the dGPU: any hardware-decoded video wakes it and holds it awake for the duration. So on this hardware the env is a "wakes on use" problem, not a "never sleeps" problem. Worth separating, because chasing idle draw through the env alone leads nowhere.

The blocker I haven't seen mentioned: nvidia_drm fbdev=1

The driver enables fbdev emulation by default alongside modeset=1 — nothing in Omarchy asks for it. It creates a console framebuffer in the dGPU's VRAM that is never released:

$ sudo cat /sys/kernel/debug/dri/0000:01:00.0/framebuffer
framebuffer[832]:
        allocated by = [fbcon]
        refcount=1
        size=1600x900

Because the allocation belongs to the driver and not to a process, it is invisible in nvidia-smi — which reports 0% utilization and no processes while the card sits at ~10 W with Video Memory: Active. That is what made this hard to find.

options nvidia_drm fbdev=0 removes it. modeset stays on, so the outputs wired to the dGPU keep working — worth stressing, since on this laptop HDMI and DP are both on the NVIDIA and losing them is not an acceptable trade.

Methodology note

lsof/fuser on /dev/nvidia* and /dev/dri/render* is not evidence. Four processes showed up holding those nodes here and none was the cause; I eliminated them one by one with no effect. The authoritative sources are:

  • /sys/kernel/debug/dri/<pci-addr>/clients — DRM clients with master/active
  • /sys/kernel/debug/dri/<pci-addr>/framebuffer — allocations with owner + refcount
  • power/runtime_active_time and power/runtime_suspended_time deltas, which don't perturb the device (unlike nvidia-smi, which resumes it)

Happy to split the fbdev part into its own issue if that's cleaner — it is arguably a separate root cause from nvidia.lua, though both hit the same hybrid-laptop population.

kevinbsr avatar Sep 01 '26 01:09 kevinbsr

Open PR #9483 addresses this exact NVIDIA environment-selection bug. It adds omarchy-hw-nvidia-drives-display and only exports the NVIDIA session variables when an NVIDIA card owns a connected display, leaving iGPU-primary hybrids on their display-driving stack. Linking the existing implementation here.

rookepoole avatar Sep 01 '26 08:09 rookepoole

Additional data point: Arrow Lake-S + RTX 5070 Ti — native Wayland corruption only fixed by XWayland

System

  • Omarchy 4.0.1-1
  • Hyprland 0.56.2-1
  • Chromium 151.0.7922.173-1
  • Kernel 7.2.1-1-cachyos
  • Intel Arrow Lake-S iGPU (i915) drives the internal eDP-2 panel; renderD129
  • NVIDIA GB205M / RTX 5070 Ti Laptop GPU, nvidia-open-dkms 610.57.04; renderD128
  • Internal display: 2560x1600 @ 240 Hz, scale 1.6

Symptoms

After the Omarchy update, native-Wayland Chromium web apps sometimes rendered mostly transparent or with stale/missing content. Elements appeared only when the mouse hovered over them. Scrolling caused severe jumping/ghosting. This was reproducible in the X.com web app and other Chromium web apps.

Launching Chromium on native Wayland produced hundreds of these errors:

eglCreateImage failed with 0x00003009
Unable to initialize binding from pixmap
OzoneImageBacking::ProduceSkiaGanesh failed to create GL representation

Tests and workaround

  1. Added these overrides after require("default.hypr.omarchy"):

    hl.env("LIBVA_DRIVER_NAME", "iHD")
    hl.env("__GLX_VENDOR_LIBRARY_NAME", "mesa")
    
  2. Re-exported them into the user systemd/DBus environment and restarted wayland-wm-app-daemon.service. The UWSM daemon was confirmed to have iHD + mesa.

  3. After both overrides, the EGL error storm stopped, but the visible corruption and jumping persisted in the live session. A full logout was not tested because it would have interrupted the diagnostic session.

  4. --use-gl=desktop was not viable: the Chromium GPU child fell back to --use-gl=disabled.

  5. Switching only Chromium/web apps to XWayland fixed the problem immediately:

    --ozone-platform=x11
    --ozone-platform-hint=x11
    

    hyprctl clients then reported xwayland: true, and scrolling became stable with no missing/repaint-on-hover content.

This may be useful when validating #9483 and the environment-loading behavior discussed in #9902.

RevenantJS avatar Sep 03 '26 04:09 RevenantJS

Confirmed in source. This is the same defect as #8215, which carries the fuller diagnosis and the regression pin — treating that as the canonical issue for the cluster, with #4901 as the older provenance report.

The mechanism, verified

Your §1 is correct, including the export path: default/hypr/nvidia.lua:10-19 is loaded from default/hypr/envs.lua:39, and default/hypr/autostart.lua:3-4 pushes the result into systemd and D-Bus session-wide. The gates (bin/omarchy-hw-nvidia:11-14, bin/omarchy-hw-nvidia-gsp:14-18) answer only "is an NVIDIA display-class device present, and is its ID >= 0x1e00" — never whether it renders or scans out. It went live in 4.0.1 via 33d7363c, which fixed o.shell_succeeds() and thereby un-masked a branch that had been dead since 4.0.0.

@karem505's Pascal report is a prediction coming true

The no-GSP branch at nvidia.lua:15-17 was flagged during earlier triage of #8215 as "a branch nobody has reported yet" — equally ungated, equally un-masked by the same 4.0.1 commit. @karem505's Quadro P520 is that report, and it is materially different from §2: the dGPU is pinned awake with no LIBVA_DRIVER_NAME set at all and nvidia_uvm used_by=0, so the CUDA mechanism in §2 is definitively not what holds it there. That also means none of the three open PRs fixes that machine — all of them work on the GSP branch. The __EGL_VENDOR_LIBRARY_FILENAMES hypothesis is consistent with how libglvnd works (__GLX_VENDOR_LIBRARY_NAME steers GLX dispatch only, and 10_nvidia.json sorts ahead of 50_mesa.json in the EGL vendor directory), but it is untested and worth following up with the numbers @karem505 promised.

@rogerfsh's point that __GLX_VENDOR_LIBRARY_NAME=nvidia survives the LIBVA workaround lines up with @jtmorris's measurement in #8328 — ~6 W and the dGPU active in 99% of browsing samples versus 9% — so gating all three together rather than LIBVA_DRIVER_NAME alone has evidence behind it. @kevinbsr's nvidia_drm fbdev=1 finding is a separate defect and deserves its own issue: an fbcon framebuffer allocated in dGPU VRAM and never released, invisible to nvidia-smi because it belongs to the driver rather than a process. Nothing in nvidia.lua causes it and no fix to this issue will address it.

§3 is not quite right, and the real problem is worse

An hl.env placed after require("default.hypr.omarchy") does reliably win — it is the last assignment during parse, and six reporters across this cluster have verified it in-process. An override placed before the require loses, but that is the documented layering being used in the wrong order: config/hypr/hyprland.lua:16-18 says plainly that the personal files load after the defaults. So "silently defeated" overstates it.

What is genuinely broken is the file channel. ~/.config/hypr/envs.lua is never loaded. config/hypr/hyprland.lua requires hypr.monitors, hypr.input, hypr.bindings, hypr.looknfeel and hypr.autostart, and nothing anywhere in the repository requires hypr.envs — the only match is default.hypr.envs at default/hypr/omarchy.lua:16. There is no designated user file for env overrides the way there is for monitors and input. That is #9902, which also reports an Omarchy updater writing an iHD fix into that dead file. Your alternative suggestion — that nvidia.lua skip each hl.env when the variable is already set — would be one answer to it, and is worth raising there.

Where this stands

Three PRs target this line with three different predicates: #7851 (2+ display vendors, LIBVA_DRIVER_NAME only), #9483 (NVIDIA owns a connected display, all the NVIDIA vars — closest to your §"Expected"), and #8263 (the complement, initramfs side). The remaining question is not a defect to correct but a choice: which predicate, which variables it covers, and how anything built on connector state should behave across a docking event, given hl.env runs at config parse and cannot rewrite a running process's environment. That is the maintainer's to decide, so nothing further is needed from you here.


Reviewed by Claude Opus 5 and independently by Codex at xhigh reasoning effort. Codex agreed on the root cause and the 4.0.1 attribution, and independently reached the same reading of the override ordering above — that the after-defaults placement wins and the "silently defeated" claim does not hold for it. Independence is not guaranteed where it merely agrees. Neither reviewer reproduced the corruption or the power behaviour: no triage worker has NVIDIA or hybrid graphics, so the mechanism is proven in source and the symptoms rest on your measurements and the others in this cluster.

omarchybot avatar Sep 03 '26 12:09 omarchybot

Confirmed on an Intel-primary/NVIDIA hybrid laptop, with a concrete Discord incoming-stream symptom:

  • Intel Raptor Lake-P / Iris Xe (internal display)
  • NVIDIA AD107M / RTX 4060 Max-Q
  • Omarchy 4.0.2-1, Chromium 151.0.7922.173, Wayland

Before the per-app test, the session inherited LIBVA_DRIVER_NAME=nvidia, NVD_BACKEND=direct, and __GLX_VENDOR_LIBRARY_NAME=nvidia. Discord itself loaded, but an incoming stream never painted in the Chromium app.

Update: launching Discord with a Discord-only LIBVA_DRIVER_NAME=iHD override restored incoming-stream video on this machine. The A/B result confirms that the inherited NVIDIA video-decoder selection was involved in this failure, although it does not by itself identify every failing WebRTC decode/compositing stage.

This is the Intel-side counterpart to #4901 and complements the AMD report in #8726. #8215 appears to be the broader regression thread, while #9483 is the current implementation PR.

CompleteDotTech avatar Sep 04 '26 22:09 CompleteDotTech

A caveat on the nvidia_drm fbdev=0 recommendation above, for laptops with a firmware MUX (this Dell G15 5515 has one: "Enable Hybrid Graphics/Advanced Optimus" in the BIOS).

With fbdev=0 and the MUX switched to discrete, the iGPU disappears and nothing evicts the boot framebuffer. simpledrm stays registered as a second DRM card with a phantom Unknown-1 output, Aquamarine autodetects it as a secondary GPU, EGL fails on it and Hyprland aborts into safe mode (no bar, everything at 60 Hz). The SDDM greeter shows the same phantom output and crashes on exit. With the driver's default fbdev=1 this most likely doesn't happen, since nvidia-drm takes the framebuffer over.

So if fbdev=0 is adopted for hybrid laptops, the NVIDIA card needs pinning when it ends up alone. #11880 does that for the session and the greeter, and only acts when NVIDIA is the sole GPU next to a firmware framebuffer. Everything else keeps autodetection.

kevinbsr avatar Sep 15 '26 01:09 kevinbsr

On my AMD Ryzen + NVIDIA RTX 3060 laptop, video playback in Chromium on X.com and YouTube failed with repeated EGL_BAD_MATCH errors until LIBVA_DRIVER_NAME=nvidia was overridden. While testing a connector-based PR on my machine and verifying /usr/lib/libva-drm.so, I realized modern libva already maps nvidia-drm to nvidia automatically per DRM node—meaning we are building complex hardware gates for an environment variable that is no longer necessary in the first place.

Regarding the maintainer summary above on "which variables it covers and how anything built on connector state should behave across a docking event":

There is strong evidence that LIBVA_DRIVER_NAME=nvidia should simply be dropped from default/hypr/nvidia.lua entirely, rather than gated behind connector or presence predicates:

  1. libva already maps NVIDIA automatically: In modern libva (>= 2.15), /usr/lib/libva-drm.so includes nvidia-drm -> nvidia in its built-in driver table alongside amdgpu -> radeonsi and i915/xe -> iHD. Hardcoding LIBVA_DRIVER_NAME=nvidia was a legacy workaround from when nvidia-drm wasn't in libva's table. Today, unsetting it costs nothing on pure NVIDIA systems.

  2. Per-node autodetection proven on both GPUs: As @ChaseC-130 demonstrated in #7851, calling vaInitialize() directly with LIBVA_DRIVER_NAME unset gives the correct driver on both nodes simultaneously:

    • renderD129 (amdgpu): loads radeonsi_drv_video.so (works)
    • renderD128 (nvidia): loads nvidia_drv_video.so (works) Setting the variable globally breaks this autodetection; unsetting it restores it.
  3. The 4.0.0 baseline confirms it: In Omarchy 4.0.0, the os.execute() / ECHILD bug (#7755) caused nvidia.lua to silently fail to set any variables. Video playback worked across all machines; the regression reports only began in 4.0.1 when nvidia.lua actually started exporting LIBVA_DRIVER_NAME=nvidia.

  4. It dissolves the docking / hotplug dilemma: If LIBVA_DRIVER_NAME is deleted:

    • Laptop display on iGPU + external monitor on dGPU will automatically decode videos on the respective GPU without needing hl.env to rewrite running environments on hotplug.
    • The choice of predicate (#7851 vs #9483) then only needs to govern __GLX_VENDOR_LIBRARY_NAME and NVD_BACKEND for dGPU power savings, rather than juggling video decode compatibility.

zinkkrysty avatar Sep 19 '26 18:09 zinkkrysty

Automated duplication check: this issue looks similar to #8215, which covers the same forced NVIDIA VA-API breaks hybrid laptop video. I keep that one open and close this one to keep the discussion in one place.

If you feel this is the wrong decision, please open the issue again with a note on the difference.

bjarneo avatar Sep 20 '26 20:09 bjarneo