Only force NVIDIA VA-API/GLX env when NVIDIA drives the display
This commit is contained in:
1 parent
692c02cad5
commit
6ecf4bf200
3 files changed
+92
-6
No files matched your search
+12
-3
@@ -1,6 +1,7 @@
|
||||
local paths = require("default.hypr.paths")
|
||||
|
||||
local nvidia = paths.omarchy_path .. "/bin/omarchy-hw-nvidia"
|
||||
local nvidia_display = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-display"
|
||||
local nvidia_gsp = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-gsp"
|
||||
local nvidia_without_gsp = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-without-gsp"
|
||||
|
||||
@@ -8,12 +9,20 @@ local nvidia_without_gsp = paths.omarchy_path .. "/bin/omarchy-hw-nvidia-without
|
||||
-- lspci reads PCI config space, which resumes a runtime-suspended GPU, and on a
|
||||
-- hybrid laptop that wake alone outlasts Hyprland's 1.5s config reload budget.
|
||||
if o.shell_succeeds(o.shell_quote(nvidia)) then
|
||||
-- On hybrid laptops the display is wired to the iGPU, so forcing NVIDIA's
|
||||
-- VA-API/GLX drivers globally breaks Chromium-based browsers (black video).
|
||||
-- Only apply those when NVIDIA actually drives the display.
|
||||
local nvidia_is_display = o.shell_succeeds(o.shell_quote(nvidia_display))
|
||||
if o.shell_succeeds(o.shell_quote(nvidia_gsp)) then
|
||||
hl.env("NVD_BACKEND", "direct")
|
||||
hl.env("LIBVA_DRIVER_NAME", "nvidia")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
if nvidia_is_display then
|
||||
hl.env("LIBVA_DRIVER_NAME", "nvidia")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
end
|
||||
elseif o.shell_succeeds(o.shell_quote(nvidia_without_gsp)) then
|
||||
hl.env("NVD_BACKEND", "egl")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
if nvidia_is_display then
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user