Repository navigation
Description
Problem
The AppImage takes the GPU driver stack from the host on purpose (#625, #722): libEGL, libGL/libOpenGL, libgbm, libdrm, libva*, libvulkan, libwayland-* and NVIDIA's libraries are excluded from the bundle (assemble-appdir.sh, EXCLUDE). But FFmpeg's libavutil and OBS's VA-API encoder link libva.so.2, libva-drm.so.2 and libva-x11.so.2 with DT_NEEDED. On a host without libva the loader fails before OBS's main() runs:
obs-studio-rust-gui: error while loading shared libraries: libva.so.2: cannot open shared object file: No such file or directory
Seen on NixOS 26.05 with a master AppImage (#722 onward) run through appimageTools.wrapType2: libva is not in the FHS env, in nix-ld's library directory, or in /run/opengl-driver/lib. The beta.20261014 AppImage bundled libva and started. Most users only see the dock icon doing nothing, because the message goes to a terminal they don't have open.
libva is optional: OBS works without VA-API (NVENC, x264 and the rest). A missing optional library must not stop OBS from starting. A missing required one must give a message the user can act on.
Proposal: a loader that knows required from optional
1. Optional host libraries are loaded lazily through shims (libva first)
- Generate shims with Implib.so at build time from the real libraries on the build base (AlmaLinux 8's libva 2.13):
libobs-va.so.2,libobs-va-drm.so.2,libobs-va-x11.so.2. Each exports every symbol of the original; the first calldlopens the host's library and fills the table. assemble-appdir.shrunspatchelf --replace-needed libva.so.2 libobs-va.so.2(and the same for-drmand-x11) on every bundled ELF file. The shims must not be calledlibva.so.2, because glibc matches loaded libraries by soname, so a shim with the real name would get itself back fromdlopen.- The
--dlopen-callbacksearch runs in this order:$OBS_LIBVA_PATH, then/run/opengl-driver/lib(NixOS),/usr/lib/x86_64-linux-gnu,/usr/lib64,/usr/lib, then theldconfigcache (the soname alone). The host's own libva is used, so it stays matched to the host's VA drivers (the reason appimage: use host VA drivers with audited FFmpeg compatibility and GPU checks #722 excluded it). - If no libva is found, every VA call returns
VA_STATUS_ERROR_UNKNOWN.vaInitializefails, VA-API encoders and decoders are unavailable, and OBS starts. It logs one line once:libva not found on this system (searched: ...); VA-API hardware encoding and decoding are disabled. The state is exposed for the frontend: GPU acceleration status light (green/yellow/red) in the status bar #846 status light.
2. Required host libraries are checked before OBS starts
AppRun (or a small preflight helper run with the AppImage's own environment) resolves the libraries OBS cannot run without: libEGL.so.1, libOpenGL.so.0 or libGL.so.1, libgbm.so.1, libdrm.so.2, and libwayland-client.so.0 (needed even on X11, because Qt and OBS link it). If any is missing, it exits with status 127 and a message like this:
OBS-Studio-Rust needs these libraries from your system, and they were not found:
libEGL.so.1 (EGL, from your graphics driver)
Install them with your package manager (Debian/Ubuntu: libegl1; Fedora: libglvnd-egl; Arch: libglvnd).
On NixOS, enable hardware.graphics and run the AppImage through appimage-run or nix-ld.
The message goes to stderr, and to notify-send or zenity when one exists, so someone launching from a dock sees it too. The list of required versus optional libraries lives in one file that both the preflight and the test read.
Tests (packaging rule, #426)
test-appimage.sh gets these lanes, each running the AppImage the way a user does, with a saved profile:
- libva removed from the container. The AppImage starts, records with x264, and logs the libva line. RED today: the AppImage fails at load time with
libva.so.2: cannot open shared object file. - libva present. VA-API encoders are listed, and
/proc/<pid>/mapsshows the host's libva, not a bundled one. - A required library removed (for example libEGL). The AppImage exits with status 127 and the message names it.
- NixOS-shaped: no libva in the standard dirs, but present in a fake
/run/opengl-driver/lib. The shim finds it there.
Related
- appimage: use host VA drivers with audited FFmpeg compatibility and GPU checks #722: host GPU, VA and EGL stack
- research: NixOS / non-FHS hardware acceleration dependency gaps #891: NixOS and non-FHS dependency gaps; this is one of its follow-ups
- frontend: GPU acceleration status light (green/yellow/red) in the status bar #846 / meta: GPU acceleration status light, follow-ups after #846 #939: the GPU status light, which shows "VA-API unavailable (libva missing)"
- appimage: target glibc 2.28 (manylinux_2_28 base) and stop bundling glibc #926 / appimage: Build on a glibc 2.28 base and stop bundling glibc #927: the glibc 2.28 base this is built on
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
appimage: Host-library loader: lazy shims for optional libraries, pre…
appimage: Wire in the host-library loader; typed host-libs.json; no-d…
appimage: GREEN on the glibc 2.28 base, dependencies from obs-studio-…
appimage: Build on a glibc 2.28 base and stop bundling glibc (#927)
zackees commentedon Oct 23, 2026
Claiming: #959 (taking over the idle claim, with maintainer approval).
libobs-va*.so.2,patchelf --replace-neededinassemble-appdir.sh) with the search order from the proposal and a single log line when libva is missing. Tests:test-appimage.shlanes 1 (libva removed: starts and records), 2 (libva present: host libva mapped) and 4 (NixOS-shaped/run/opengl-driver/lib). RED is lane 1 against the current AppImage.The first PR (RED) goes up as soon as the lane 1 test exists.
zackees commentedon Oct 23, 2026
Status: both parts of the proposal already shipped inside #927 (
build-aux/appimage/hostlib/: the libva shims and theobs-hostlib-checkpreflight in AppRun). #1981 adds the packaged-AppImage lane 1 (no libva: OBS starts) totest-appimage.shand CI. Lanes 2–4 remain; next I'm wiringhostlib/test-hostlib.shor adding the matching scenarios.zackees commentedon Oct 23, 2026
Done. The loader (libva shims and the
obs-hostlib-checkpreflight,build-aux/appimage/hostlib/) shipped in #927. Test coverage, lane by lane:test-appimage.sh first-start-no-libvaon AlmaLinux 8 and Ubuntu 22.04 (appimage: test that OBS starts on a host without libva (#959) #1981);hostlib/test-hostlib.sh, now run in the AppImage build job (appimage: run the host-library loader test in CI (#959) #1982);test-appimage-nixos.sh(existing).The AppImage jobs run on schedule, dispatch and releases, not on PRs, so the first CI run of 1 and 2 is the next nightly. Locally both pass on today's continuous AppImage and in the build image.
appimage: test that OBS starts on a host without libva (obs-rust#959) (…
appimage: run hostlib/test-hostlib.sh in the AppImage build (obs-rust…