Load Jetson multimedia libraries at runtime instead of linking them - #1365
Open
stephen-derosa wants to merge 2 commits into
Open
Load Jetson multimedia libraries at runtime instead of linking them#1365stephen-derosa wants to merge 2 commits into
stephen-derosa wants to merge 2 commits into
Conversation
Contributor
Changeset ✓This PR includes a changeset covering all affected packages:
|
stephen-derosa
force-pushed
the
sderosa/BOT-530-dont-force-link-jetson
branch
2 times, most recently
from
August 26, 2026 23:18
98cd792 to
fad0e39
Compare
stephen-derosa
requested review from
chenosaurus
and
a lite review from Copilot
August 27, 2026 21:07
…The Jetson MMAPI backend hard-linked libnvv4l2, libnvbufsurface and libv4l2, so an aarch64 binary built with Jetson support failed to load on non-Jetson ARM systems with cannot open shared object file before any LiveKit code ran — the existing JetsonVideoEncoderFactory::IsSupported probe never got a chance to run.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
stephen-derosa
force-pushed
the
sderosa/BOT-530-dont-force-link-jetson
branch
from
September 3, 2026 17:47
3cc459c to
c4e1d5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The Jetson MMAPI backend hard-linked
libnvv4l2,libnvbufsurfaceandlibv4l2,so an aarch64 binary built with Jetson support failed to load on non-Jetson ARM
systems — the loader errors out before
JetsonVideoEncoderFactory::IsSupported()ever runs. It also pinned the build host's L4T SONAMEs.
This applies the same Implib.so lazy-loading treatment CUDA and VAAPI already use:
libv4l2.so/libnvbufsurface.so, generated from L4T r36.4.7.jetson_runtime_loader.{h,cpp}— the stubs' dlopen callback (searches the L4T vendordirs, tolerates SONAME drift) and a
lk_jetson_runtime_libs_available()probe.IsCodecSupported()andDmaBufVideoFrameBuffer::ToI420()check that probe beforetouching a lazily-bound symbol, since a stub aborts if its library is missing.
LK_JETSON_MMAPI_DIRoverrides the hardcoded/usr/src/jetson_multimedia_api.Result: one portable aarch64 binary that uses the Jetson encoder on L4T and falls back
elsewhere.
Breaking changes
None. The backend already required JetPack 5 / L4T R34+ — it calls
NvBufSurfaceFromFdunconditionally, and
libnvbufsurfacefirst ships in R34.1. The removednvbuf_utilslink was vestigial: no symbol from it was ever referenced, and JetPack 6 no longer ships
that library at all.
Testing
In a
linux/arm64container with no Jetson libraries, against the real L4T r36.4.7sources and libraries: the vendored MMAPI objects link with
-Wl,--no-undefinedandDT_NEEDEDlists only libstdc++/libgcc_s/libc; the probe reports unavailable and exitscleanly without the libraries, and resolves trampolined calls correctly with them.
Target HW Testing