Skip to content

build-aux: Bundle all of glibc in the AppImage, not just what OBS links - #499

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-glibc-companions
Oct 13, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/appimage-glibc-companions

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Description

The AppImage now bundles all of glibc, not just the parts OBS links. NVIDIA's libcuda loads again on hosts with a newer glibc than the build host's, so NVENC is back.

  • assemble-appdir.sh bundles glibc and its loader, so everything in the AppImage runs on glibc 2.43. It took only the glibc libraries in OBS's own closure: libc.so.6, libm.so.6, libmvec.so.1, plus libresolv and the NSS libraries it copies by name.
  • The host's GPU driver is loaded into OBS on that loader and libc. The NVIDIA driver links more of glibc: libcuda.so.1, libEGL_nvidia.so.0 and libGLX_nvidia.so.0 need librt.so.1, libpthread.so.0 and libdl.so.2. None of those were in the AppImage, so they came from the host. The host's copies use private symbols of the host's glibc. On glibc 2.44, librt.so.1 fails with undefined symbol: __pointer_chk_guard, version GLIBC_PRIVATE, obs-nvenc-test reports reason=cuda_lib, and obs-nvenc.so registers no encoders.
  • After the library closure, assemble-appdir.sh now copies every shared library of the package that owns the bundled libc.so.6 (libc6 on the Ubuntu 26.04 build host): librt, libpthread, libdl, libutil, libanl, libnsl, libBrokenLocale, libc_malloc_debug, libmemusage, libpcprofile, and the rest of NSS. libthread_db is left out because it is a debugger plugin and the debugger provides its ps_* symbols. The list comes from the package's file list, not a hand-kept list, so all of glibc comes from one build. If no package owns libc.so.6, the build fails instead of shipping part of glibc again.
  • README: a note under "How it works", and the bundle test's new check under "Tests".
  1. build-aux: Test that the AppImage bundles the glibc libraries drivers link (RED): the bundle scenario of test-appimage.sh runs in CI's stock Debian 13, Ubuntu 22.04 and Fedora containers. When libc.so.6 is bundled, it resolves each glibc library a host driver may link (libm, libmvec, librt, libpthread, libdl, libutil, libanl, libresolv, libnss_files, libnss_dns). It uses LD_PRELOAD by name on obs with the bundled loader and LD_BIND_NOW, which takes the same route through obs's RPATH as a driver's DT_NEEDED entry. It fails unless each library comes from the AppImage and binds.
  2. build-aux: Bundle all of glibc in the AppImage, not just what OBS links (GREEN): the fix.

Motivation and Context

Fixes #498. On NVIDIA systems the AppImage has no NVENC. A profile set to NVENC opens with a "Missing Encoders" dialog (ffmpeg_nvenc, Module "obs-nvenc" not loaded) on every start. A distribution build of OBS on the same GPU works. This affects v0.1.0-beta.20261012 and the current continuous AppImage.

The AppImage packaging, including the decision to bundle glibc, is by probonopd (1da5903, 1af9eaa).

Why this one: NVENC is the encoder most NVIDIA users record and stream with, and the AppImage is the one Linux build meant to run anywhere. Every NVIDIA user on a current rolling distribution loses hardware encoding without any message beyond the log.

How Has This Been Tested?

The fixed AppImage is a simulation, not a full CI build. I took the released AppDir (33.0.0-beta6-799-gd711a972c) and, in an ubuntu:26.04 container, ran this branch's new glibc step from assemble-appdir.sh and then set-runpaths.sh, as the build does. That container has libc6 2.43-2ubuntu2.4, the same version as the release's glibc. I packed the result with the workflow's pinned appimagetool 1.9.1. The step added 12 libraries. This PR's AppImage workflow run builds it for real.

On an RTX 2070 desktop (NVIDIA 610.57.04, host glibc 2.44), headless (private Xvfb, private D-Bus, private home, OBS with --multi):

  • obs-nvenc-test:
    • release: Cannot load libcuda.so.1, reason=cuda_lib, nvenc_supported=false.
    • fixed: driver_ver=610.57.04, cuda_ver=13.30, nvenc_ver=13.1, latest_architecture_name=Turing, nvenc_supported=true, with H.264 and HEVC supported.
  • Same simple-mode profile with the recording encoder set to NVENC (nvenc), recording started over obs-websocket for 10 s:
    • release: startup stops at the "Missing Encoders" dialog (ffmpeg_nvenc, plugin_not_loaded), obs-websocket answers 207 "not ready", and nothing is recorded.
    • fixed: obs_nvenc_h264_tex and obs_nvenc_hevc_tex registered, [obs-nvenc: 'simple_video_recording'] created, 293 frames output. ffprobe: stream|codec_name=h264|profile=High|width=1280|height=720|r_frame_rate=30/1, format|format_name=matroska,webm|duration=9.766000, 292 frames decoded. Xvfb's GL is software, so obs-nvenc used its non-texture path (falling back to non-texture encoder).
  • A host-style library built on that machine with DT_NEEDED librt.so.1, libpthread.so.0 and libdl.so.2 and no RPATH, preloaded into obs with the bundled loader and LD_BIND_NOW:
    • release: resolves /usr/lib/librt.so.1, undefined symbol: __pointer_chk_guard.
    • fixed: all three resolve from the AppImage and bind.
    • The same check with libcuda.so.1, libEGL_nvidia.so.0 and libGLX_nvidia.so.0 gives 1 undefined symbol each in the release and 0 in the fixed AppImage.

CI's test script (test-appimage.sh) in the same stock containers CI uses:

  • bundle with the RED test:
    • release AppImage: FAILED on Debian 13, Ubuntu 22.04 and Fedora 44, each listing librt, libpthread, libdl, libutil and libanl as taken from the container.
    • fixed AppImage: passed on all three (684 ELF files checked, 672 before plus the 12 new libraries, all binding with LD_BIND_NOW). A first version also bundled libthread_db, and this check caught it (undefined ps_* symbols), so it is left out.
  • first-start and probes, fixed AppImage: passed on all three.
  • saved-profile, fixed AppImage, Debian 13: passed. verify-recording.sh: 14 s, 320x240, 419 frames, 0 freezes in the screen and camera regions, 440 Hz tone throughout.

No regression on AMD (an integrated Radeon GPU, Mesa radeonsi, host glibc 2.44):

  • As shipped, VAAPI already fails the same way in the release and the fixed AppImage (VAAPI: Failed to initialize display). The bundled libva can't load the host driver; that is a separate, known issue.
  • With the host's libva in place of the bundled one, as in earlier release checks, the fixed AppImage records 10 s with ffmpeg_vaapi: ffprobe codec_name=h264|profile=High|width=1280|height=720, 9.98 s, 299 frames. The release gives the same result.

Not tested:

  • A full CI build of the AppImage. The PR's workflow run does that and runs the new check on it.
  • NVENC's texture path and OBS on a real NVIDIA desktop session with GLX/EGL. These runs were headless, with software GL. The loader check above shows libEGL_nvidia and libGLX_nvidia now bind.
  • The libraries added to the simulated AppImage come from the archive's libc6 2.43-2ubuntu2.4. The release's libc.so.6 comes from the CI runner and has the same version but a different build ID. In a real build, all of them come from the build host's one libc6.
  • ci/local_gate.py was not run; the change is limited to the AppImage scripts.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@zackees

zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Demonstrated RED→GREEN in CI. I pushed the RED commit 229ac73 alone to a temporary branch and dispatched appimage.yaml (run 38367442507):

  • RED: the build passed, and Ubuntu 22.04, Debian 13 and Fedora all failed: glibc's libanl.so.1 / libdl.so.2 / libpthread.so.0 is not bundled with libc.so.6: a host driver that links it gets /lib64/....
  • GREEN: this PR's own checks pass the AppImage build and all three distributions.

rdoupe and others added 2 commits October 13, 2026 01:31
… link (RED)

The AppImage bundles glibc (libc.so.6, libm.so.6, the loader) but only
the parts of it that OBS itself links. The host's GPU drivers are loaded
into OBS with that bundled loader and libc, and they link more of glibc:
the NVIDIA driver's libcuda and libEGL_nvidia need librt.so.1,
libpthread.so.0 and libdl.so.2. Those then resolve to the host's copies,
which belong to the host's glibc and need private symbols of its version.
On a host with a newer glibc than the bundled one, libcuda fails to load
("undefined symbol: __pointer_chk_guard, version GLIBC_PRIVATE"),
obs-nvenc-test reports reason=cuda_lib and NVENC is missing from the
encoder list, while a distribution build of OBS works on the same GPU.

The bundle scenario now resolves each glibc library a host driver may
link (libm, libmvec, librt, libpthread, libdl, libutil, libanl,
libresolv, libnss_files, libnss_dns) through obs's RPATH, as a driver's
DT_NEEDED entry would, with the bundled loader and LD_BIND_NOW, and fails
unless it comes from the AppImage and binds. On the current continuous
AppImage it fails for librt, libpthread, libdl, libutil and libanl.

Refs obs-rust#498.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ks (GREEN)

The AppImage bundles glibc and its loader so it runs on distributions
older than the build host, but assemble-appdir.sh took only the parts of
glibc in OBS's own library closure: libc.so.6, libm.so.6, libmvec.so.1,
plus the NSS and resolver libraries it copies by name. The host's GPU
drivers are loaded into OBS on that bundled loader and libc, and they
link more of glibc: the NVIDIA driver's libcuda, libEGL_nvidia and
libGLX_nvidia need librt.so.1, libpthread.so.0 and libdl.so.2. Those
were found on the host, belong to the host's glibc and need its private
symbols. On a host with a newer glibc than the build host's, libcuda
fails to load ("/usr/lib/librt.so.1: undefined symbol:
__pointer_chk_guard, version GLIBC_PRIVATE"), obs-nvenc-test reports
reason=cuda_lib, and NVENC is missing from the encoder list; a profile
set to NVENC opens with a "Missing Encoders" dialog on every start.

After the library closure, bundle every shared library of the package
that owns the bundled libc.so.6 (libc6 on the Ubuntu build host), so the
whole of glibc comes from one build. libthread_db is left out: it is a
debugger plugin whose ps_* symbols the debugger provides. The build fails
if no package owns libc.so.6 rather than shipping a partial glibc again.

The AppImage packaging is by probonopd (1da5903, 1af9eaa).

Fixes obs-rust#498.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=abfee81918dc83b66e26f06df7af22d8c73d30bb secs=473 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791880789,"gate":"rust/all/fmt","host":"linux-x86_64","key":"51480a1aeba7790e90dd0b64910899c2e09a86b486058b754b464c908d350b0f","lane":"lint","parents":["118a99a7a9d1914679fd0f8a0985f22cde05af08"],"secs":177,"stamp":"d97b9fc84ac877fec7618124a0b67284","tree":"abfee81918dc83b66e26f06df7af22d8c73d30bb","v":1,"via":"run"}
Ci-Attestation: {"at":1791880789,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"51480a1aeba7790e90dd0b64910899c2e09a86b486058b754b464c908d350b0f","lane":"lint","parents":["118a99a7a9d1914679fd0f8a0985f22cde05af08"],"secs":177,"stamp":"0215b0eedc0dd3bacb687d332cbf7393","tree":"abfee81918dc83b66e26f06df7af22d8c73d30bb","v":1,"via":"run"}
Ci-Attestation: {"at":1791880789,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"6b5c8b344ce63c72bdcea24b84115574362e794ebf62668eac02855dd217cdb7","lane":"rust-test","parents":["118a99a7a9d1914679fd0f8a0985f22cde05af08"],"secs":217,"stamp":"4718678d85805bf763ce1feb08d13aff","tree":"abfee81918dc83b66e26f06df7af22d8c73d30bb","v":1,"via":"run"}
Ci-Attestation: {"at":1791880789,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"d62aa9e429cfdf7bf7d551ea318fe4b3d0675acd4a357f78986566c016bf8aee","lane":"tier2-linux","parents":["118a99a7a9d1914679fd0f8a0985f22cde05af08"],"secs":79,"stamp":"487e53d847624063d8040c97534d93dd","tree":"abfee81918dc83b66e26f06df7af22d8c73d30bb","v":1,"via":"run"}
@zackees

zackees commented Oct 13, 2026

Copy link
Copy Markdown
Member

Rebased on master, local gate passed; pushed as c9fbdb3. Merging once CI is green.

@zackees
zackees force-pushed the fix/appimage-glibc-companions branch from d9e60ae to c9fbdb3 Compare October 13, 2026 08:39
@zackees
zackees merged commit f30d4bc into obs-rust:master Oct 13, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: build-aux: NVENC can't load from the Linux AppImage, so NVIDIA users get no GPU encoding

2 participants