Repository navigation
Description
Summary
On NixOS 26.05 (KDE Wayland, RTX 3060, NVIDIA 595.99.02) the OBS-Studio-Rust AppImage (beta.20261014, via a buildFHSEnv/bubblewrap wrapper + nix-ld) rendered on Mesa llvmpipe at ~10 fps with no UI hint (#846). Root cause: libEGL_nvidia could not find the egl-wayland external platform JSONs, which NixOS keeps under /run/opengl-driver/share/egl/egl_external_platform.d. #722 (2fd806d) added host driver config discovery to AppRun. This research checks every hardware path against non-FHS hosts (NixOS, Guix) and sandboxes (Flatpak, bwrap FHS envs).
Conclusion: AppRun now finds driver configs (EGL vendor/platform JSON, GBM, VA, Vulkan ICDs) but not driver libraries (libcuda, libnvidia-encode, libGL*, libwayland-client). Those are excluded from the bundle and are left to the host loader path. On NixOS that path is nix-ld's NIX_LD_LIBRARY_PATH, which by default holds Mesa/glvnd but not /run/opengl-driver/lib (libcuda, libnvidia-encode) and not libwayland-client. Every failure except "graphics init failed" ends in a silent fallback (llvmpipe, x264, CPU decode, SHM capture). Nothing at startup detects it.
Evidence collected read-only on origin/master (2fd806d is the last AppRun change) and on the affected NixOS host.
Host facts (this NixOS machine)
/run/opengl-driver/libhaslibcuda.so.1,libnvidia-encode.so.1,libnvcuvid.so.1,libEGL_nvidia.so.0,libnvidia-egl-wayland2.so.1,libnvidia-egl-gbm.so.1./run/opengl-driver/lib/drihas Mesa DRI +nvidia_drv_video.so,nouveau_drv_video.so,d3d12_drv_video.so;/run/opengl-driver/lib/gbmhasdri_gbm.so,nvidia-drm_gbm.so./run/opengl-driver/share/egl/egl_external_platform.d:09_nvidia_wayland2.json 10_nvidia_wayland.json 15_nvidia_gbm.json 20_nvidia_xcb.json 20_nvidia_xlib.json./usr/share/egland/usr/libdo not exist./run/opengl-driver/share/glvnd/egl_vendor.d:10_nvidia.json 50_mesa.json; Vulkan ICDs includenvidia_icd.jsonandlvp_icd(lavapipe, software)./run/opengl-driver-32absent (no 32-bit; irrelevant for OBS x86_64).NIX_LD_LIBRARY_PATH=/run/current-system/sw/share/nix-ld/lib: containslibEGL.so.1,libGL.so.1,libGLX*,libgbm,libdrm*,libvulkan.so.1, Mesa Vulkan drivers. Contains nolibwayland*(0 matches), nolibcuda, nolibnvidia-encode.
Gap table
| Path | How located | NixOS status after #722 | Failure mode | Proposed fix |
|---|---|---|---|---|
| EGL vendor (glvnd) | __EGL_VENDOR_LIBRARY_DIRS; AppRun:130-133 adds /run/opengl-driver/share/glvnd/egl_vendor.d |
OK (config). Vendor JSON names libEGL_nvidia.so.0 by soname, so the lib must still be on the loader path |
Silent -> Mesa -> llvmpipe | AppRun: add /run/opengl-driver/lib to the host lib search (see below) |
| EGL external platforms (egl-wayland/egl-gbm/xcb) | __EGL_EXTERNAL_PLATFORM_CONFIG_DIRS; AppRun:135-138 |
Fixed by #722 (the original bug) | Silent -> Mesa claims display -> llvmpipe | Done; add regression test with fake tree |
| GLX (X11 sessions) | glvnd libGLX_<vendor> chosen by X server, loaded by soname |
Depends on loader path; libGLX_nvidia lives only in /run/opengl-driver/lib |
Silent -> libGLX_mesa llvmpipe |
Same lib-path fix |
| Mesa DRI drivers | Mesa built-in path (/run/opengl-driver/lib/dri on Nix Mesa) or LIBGL_DRIVERS_PATH |
OK with Nix Mesa; a non-Nix Mesa would not find them | Silent -> swrast/llvmpipe (egl: failed to create dri2 screen) |
Set LIBGL_DRIVERS_PATH only if unset, like VA |
| GBM backends | GBM_BACKENDS_PATH; AppRun:120-123 |
OK | Silent (EGL GBM platform fallback) | Done |
libwayland-client/egl |
Excluded from bundle (assemble-appdir.sh:50 EXCLUDE), resolved from host loader path |
Missing: not in nix-ld lib; extracted AppImage fails libwayland-client.so.0: cannot open shared object file |
Loud (no start) when run outside the FHS env | Bundle libwayland-client (ABI-stable, AppImage excludelist dropped it long ago) or add host dirs; at minimum check and print a clear message in AppRun |
NVENC (libcuda.so.1, libnvidia-encode.so.1) |
os_dlopen by soname: plugins/obs-nvenc/cuda-load.c:15, plugins/obs-ffmpeg/obs-ffmpeg.c:262/268; excluded from bundle |
Not covered: only in /run/opengl-driver/lib, which neither AppRun nor default nix-ld adds |
Silent: encoder not registered; settings only list available encoders (frontend/settings/OBSBasicSettings.cpp:5054ff), simple-mode fallback picks x264 (OBSBasicSettings_Stream.cpp:1661/1706) | AppRun: append /run/opengl-driver/lib (and /run/opengl-driver-32/lib n/a) to the host lib path for the host loader via --library-path or a scoped LD_LIBRARY_PATH only for obs, not children; NixOS docs hardware.graphics + programs.nix-ld.libraries |
| NVDEC/CUDA (media source hw decode) | libnvcuvid/libcuda via FFmpeg dlopen |
Same as NVENC | Silent -> CPU decode | Same |
| VA-API | LIBVA_DRIVERS_PATH; AppRun:125-128; libva excluded from bundle; vaInitialize plugins/obs-ffmpeg/vaapi-utils.c:95 |
Driver dir OK. libva.so.2 is not in default nix-ld lib -> host loader may not find it. NVIDIA needs nvidia_drv_video.so (nvidia-vaapi-driver), which is NVDEC-only (no encode) |
Silent: VAAPI encoders absent from list | Lib-path fix; doc hardware.graphics.extraPackages (intel-media-driver, mesa) |
| Vulkan ICDs | VK_DRIVER_FILES; AppRun:141-144 |
OK (config). nvidia_icd.json points at libGLX_nvidia.so.0 by soname -> lib path again. lavapipe ICD present, so a Vulkan consumer can silently land on CPU |
Silent | Lib-path fix; prefer hw ICD, flag lvp as software |
| AMF (AMD) | libamfrt64.so.1 dlopen |
Not packaged in nixpkgs by default (amf in amdenc/proprietary); not on any Nix path |
Silent (encoder absent) | Doc only |
| QSV / oneVPL | libvpl dispatcher + libmfx-gen/onevpl-intel-gpu runtime, searched via ONEVPL_SEARCH_PATH / system dirs |
Not handled by AppRun; NixOS keeps runtime in /run/opengl-driver/lib if in hardware.graphics.extraPackages |
Silent | Add ONEVPL_SEARCH_PATH=/run/opengl-driver/lib when unset |
| PipeWire/portal capture DMA-BUF | linux-pipewire imports DMA-BUF through EGL (gs_texture_create_from_dmabuf); renegotiates (pipewire.c:580, 1474) and drops modifiers on failure |
Works only if EGL is on the hw driver; on llvmpipe DMA-BUF import fails | Silent -> SHM/memfd copy, extra CPU | Covered by status light: log + flag "DMA-BUF disabled" |
| v4l2 MJPEG hw decode | linux-v4l2 via FFmpeg hwaccel (VA-API) | Depends on VA-API | Silent -> CPU MJPEG decode | Covered by VA-API fix + status light |
| CEF / browser source GPU | CEF GPU process; uses its own ANGLE/EGL, often disabled on Linux (--disable-gpu) |
Inherits same EGL env; on miss Chromium uses SwiftShader | Silent | Status light should include browser GPU state (chrome://gpu equivalent) |
| Renderer detection | libobs-opengl/gl-subsystem.c:274-277 logs Loading up OpenGL on adapter %s %s only |
No check | Silent (log line only) | #846 + startup warning |
Sandbox notes
- buildFHSEnv/bwrap:
/run/opengl-driveris bind-mounted, but/usr/share/egletc. are not populated from it; before appimage: use host VA drivers with audited FFmpeg compatibility and GPU checks #722 this was the bug. Libraries in/run/opengl-driver/libare only on the path if the FHS env'sld.so.conf/profile adds it (nixpkgsbuildFHSEnvdoes add/run/opengl-driver/libvia itsLD_LIBRARY_PATHprofile; plain bwrap does not). - nix-ld: only
programs.nix-ld.libraries; driver libs need/run/opengl-driver/libadded explicitly (orNIX_LD_LIBRARY_PATHextended). - Guix: no
/run/opengl-driver; drivers via profile (~/.guix-profile/lib,share/glvnd/egl_vendor.d) and the NVIDIA channel (nonguix) - AppRun probes nothing there. - Flatpak: uses GL extension runtimes (
org.freedesktop.Platform.GL.nvidia-<ver>); mismatch with host driver version silently falls back to llvmpipe. Not an AppImage concern but the same status light applies.
Gaps in tests and diagnostics
build-aux/appimage/gpu-test.c("Physical GPU checks ... No software fallback") exists, but CI'stest-appimage.sh:466setsLIBGL_ALWAYS_SOFTWARE=1because CI has no GPU, so no lane asserts "not llvmpipe".- No test exercises a NixOS-shaped tree (
/run/opengl-driver/...with no/usr/share/egl). - No startup self-check; no NVENC-missing-with-NVIDIA-GPU warning.
Options
| Option | Pros | Cons |
|---|---|---|
| A. AppRun discovery (current) | Zero user setup; already handles configs | Shell heuristics per distro; does not cover libraries; cannot verify the result |
| B. Startup self-check (warn/refuse llvmpipe when a GPU exists) | Catches every cause, any packaging, any distro; turns silent into loud | Needs GPU detection (sysfs PCI 10de/1002/8086, /dev/dri/renderD*); must not block VMs/headless (warning + opt-out env, not hard refusal by default) |
C. Official Nix flake/package (addDriverRunpath, wrapProgram with driver env) |
Correct-by-construction on NixOS; what nixpkgs obs-studio does |
Maintenance; only NixOS; users of the AppImage still need A/B |
| D. NixOS docs | Cheap | Users don't read docs before hitting the bug |
| E. CI NixOS lane with fake driver tree | Prevents regression of A | Can't prove real GPU use without hardware; needs a fake vendor EGL/ICD stub |
Recommendation
- B first (it is frontend: GPU acceleration status light (green/yellow/red) in the status bar #846 plus a log-level warning): it is the only thing that satisfies "never silently fall back", whatever the packaging. Default: loud warning + status light yellow;
OBS_REQUIRE_HW_GL=1to refuse to start. - Extend A to libraries: when the host loader is used and
/run/opengl-driver/libexists, pass it to the obs process only (loader--library-pathor AppRun-scoped env removed before spawning children), plusLIBGL_DRIVERS_PATH,ONEVPL_SEARCH_PATH. Bundle or loudly checklibwayland-client. - E: add a test-appimage lane with a NixOS-shaped fake tree (no
/usr/share/egl, configs under/run/opengl-driver, a stub vendor) asserting AppRun exports the dirs and thatlibcuda/libnvidia-encodenames resolve. - C + D later: a flake in-repo (
nix/) usingautoPatchelfHook/addDriverRunpath, and a NixOS section in the AppImage README.
Proposed follow-up issues
- bug: appimage: NVENC/NVDEC silently missing on NixOS (
libcuda/libnvidia-encodeonly in/run/opengl-driver/lib) - bug: appimage: extracted AppImage fails on NixOS,
libwayland-client.so.0not found (bundle or check) - appimage: AppRun sets
LIBGL_DRIVERS_PATHandONEVPL_SEARCH_PATHfrom/run/opengl-driverwhen unset - test: test-appimage NixOS-shaped fake driver tree lane (assert env + soname resolution)
- libobs/frontend: startup software-renderer warning +
OBS_REQUIRE_HW_GL(feeds frontend: GPU acceleration status light (green/yellow/red) in the status bar #846) - frontend: warn when an NVIDIA GPU is present but no NVENC encoder registered (and same for VA-API on Intel/AMD)
- docs: NixOS / Guix / Flatpak hardware acceleration guide (
hardware.graphics, nix-ld libraries) - packaging: evaluate an official Nix flake with
addDriverRunpath
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 23, 2026
Measured on 2026-10-23 with the released
OBS-Studio-Rust-0.1.0-beta.20261023AppImage, NixOS (RTX 3060 + RTX 2080 Ti, driver 595.99.02), under Xvfb:appimage-run(nixpkgs): OBS renders on hardware (Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 3060/PCIe/SSE2), and NVENC registers:[obs-nvenc] NVENC version: 13.0 (compiled) / 13.0 (driver), CUDA driver version: 13.20, withobs_nvenc_h264_texandobs_nvenc_hevc_tex. So the row "NVENC/NVDEC silently missing" doesn't happen through appimage-run, whose FHS env puts/run/opengl-driver/libon the path.NIX_LD_LIBRARY_PATH, no wayland): no longer a silent or confusing failure. The host-library preflight refuses with a clear fix:libwayland-client.so.0 ... run through appimage-run or nix-ld (programs.nix-ld.libraries = [ pkgs.wayland ]). The "extracted AppImage fails on libwayland-client" row now gets a clear message./run/opengl-driver/lib(obs-gpu-status: NVIDIA GPU utilization through NVML #1233, checked by the NixOS lane in test(appimage): NixOS lane checks OBS loads NVML from /run/opengl-driver (#1028) #1971), and a NixOS-shaped/run/opengl-drivertree in CI (test-appimage-nixos.sh, plus first-start's fake tree).Still open from the list: NVENC under nix-ld when the user adds wayland but not
/run/opengl-driver/lib(AppRun doesn't add it to the library path),LIBGL_DRIVERS_PATH/ONEVPL_SEARCH_PATHfrom/run/opengl-driver, and the docs.zackees commentedon Oct 25, 2026
/ready
Triage: the research is done and measured (2026-10-23 comment), and most rows are already fixed (#722, #1233, #1971, the nix-ld preflight message). What's left is concrete:
/run/opengl-driver/libto the library path when it exists (NVENC under nix-ld without appimage-run).LIBGL_DRIVERS_PATH/ONEVPL_SEARCH_PATHfrom/run/opengl-driver.Acceptance for 1 and 2:
test-appimage-nixos.shcovers them (per AGENTS.md's packaging rule, shown failing without the change). P3, size:S.zackees commentedon Oct 26, 2026
Status of the triage list:
/run/opengl-driver/lib: done in build-aux: AppRun adds the NixOS driver libraries to nix-ld's path (#891) #2436 (merged). AppRun appends the directory toNIX_LD_LIBRARY_PATH. On an RTX 3060 (driver 595.99.02) with the packaged AppImage, the log said "NVENC not supported" before and shows NVENC 13.0 with H.264 and HEVC after. Also fixed along the way: appimage: crashes at start on NixOS Wayland: bundled libxkbcommon finds no keyboard data (/usr/share/X11/xkb) #2437, the crash at start on NixOS Wayland from missing xkb data (build-aux: AppRun points libxkbcommon at the host's keyboard data (#2437) #2439, merged).LIBGL_DRIVERS_PATHandONEVPL_SEARCH_PATH: I propose dropping both./run/opengl-driveralready renders withoutLIBGL_DRIVERS_PATH(Mesa llvmpipe through EGL in every run here). Setting it on other hosts would override Mesa's own default.ONEVPL_SEARCH_PATHwould affect nothing. It belongs with appimage: Investigate and ship Intel QSV, validated once on real hardware and pinned by a recorded fixture #1863 if QSV ships.Once #2440 merges, this can close unless someone wants item 2 kept.
zackees commentedon Oct 26, 2026
#2440 merged. With #2436 and #2439 that covers items 1 and 3. Item 2 was dropped for the reasons in the previous comment; reopen if you want it.
build-aux: AppRun adds the NixOS driver libraries to nix-ld's path (o…
README: How to run the AppImage on NixOS (obs-rust#2440)