Skip to content

Bundle libxml2 + ICU in the baremetal package so it runs on newer distros (fixes #4362)#4363

Open
exzile wants to merge 1 commit into
openvinotoolkit:mainfrom
exzile:fix/bundle-libxml2-baremetal
Open

Bundle libxml2 + ICU in the baremetal package so it runs on newer distros (fixes #4362)#4363
exzile wants to merge 1 commit into
openvinotoolkit:mainfrom
exzile:fix/bundle-libxml2-baremetal

Conversation

@exzile

@exzile exzile commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

The baremetal Linux release tarball fails to start on distros newer than the build base, because it does not bundle libxml2 — a runtime dependency of the ovms binary.

ldd /opt/ovms/bin/ovms reports libxml2.so.2 => not found. create_package.sh bundles the bazel-out artifacts plus the OpenVINO/OpenCV/TBB/OpenCL libraries, but libxml2 is pulled in from the base image (Dockerfile.ubuntu apt-get install ... libxml2), so the portable tarball never included it. On Ubuntu 22.04/24.04 the host provides libxml2.so.2, masking the gap. On a host whose libxml2/ICU soname differs it breaks — e.g. Ubuntu 26.04 ships libxml2.so.16 + ICU 78 (no libxml2.so.2, no ICU 74):

ovms: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory

The full unmet chain (via readelf -d) is ovms → libxml2.so.2 → libicuuc.so.74 → libicudata.so.74.

Reported in #4362.

Fix

Bundle libxml2 and its ICU dependency chain into /ovms_release/lib/ in create_package.sh, alongside the existing libOpenCL copy and before the patchelf --set-rpath '$ORIGIN/../lib' pass, so the copied libraries get an rpath that resolves them within the package.

if [[ "$BASE_OS" =~ "ubuntu" ]] ; then
	cp -P /usr/lib/x86_64-linux-gnu/libxml2.so.2* /ovms_release/lib/
	cp -P /usr/lib/x86_64-linux-gnu/libicuuc.so.* /ovms_release/lib/
	cp -P /usr/lib/x86_64-linux-gnu/libicudata.so.* /ovms_release/lib/
fi

Only the minimal chain is bundled — libz, liblzma, libstdc++, libm, libc have stable sonames present on every target and are intentionally left to the host.

Verification

On Ubuntu 26.04 (glibc 2.43), with the current v2026.2.1 ovms_ubuntu24 tarball the binary won't start (libxml2.so.2: cannot open shared object file). After adding these three libraries to ovms/lib/, ldd ovms is fully resolved and OVMS starts and serves an LLM on the GPU (Intel Arc Pro B60) end-to-end via /v3/chat/completions. This PR makes create_package.sh produce that self-contained tarball directly.

Notes / scope

  • ubuntu x86_64 only. This is the reported and verified case. The redhat package (and aarch64) likely need the analogous copy from their own libdirs, but I could only verify ubuntu x86_64, so I left them untouched rather than ship unverified paths.
  • Size: adds ~30 MB, almost entirely libicudata (the ICU data blob libxml2 requires). If that's a concern, an alternative is to link a libxml2 built --without-icu (or statically), which would avoid bundling ICU — happy to pursue that direction instead if maintainers prefer.
  • Licenses: libxml2 (MIT) and ICU (Unicode license) are now shipped in the tarball; thirdparty-licenses/ may want their texts added.

…tros

The ovms binary links libxml2.so.2, but create_package.sh only bundles the
bazel-out artifacts plus the OpenVINO/OpenCV/TBB/OpenCL libraries. libxml2 is
pulled in from the base image (Dockerfile.ubuntu apt-installs it into the runtime
image), so the portable tarball never included it. On Ubuntu 22.04/24.04 the host
provides libxml2.so.2, which masks the gap; on a newer distro whose libxml2/ICU
soname differs (Ubuntu 26.04 ships libxml2.so.16 + ICU 78) the tarball fails to
start:

  ovms: error while loading shared libraries: libxml2.so.2: cannot open shared
  object file: No such file or directory

Bundle libxml2.so.2 and its ICU dependency chain (libxml2 -> libicuuc ->
libicudata) from the build base, placed before the patchelf rpath pass so they
resolve one another within the package. Verified: the ubuntu24 tarball now starts
and serves models on the GPU on Ubuntu 26.04 (Intel Arc Pro B60).

Fixes openvinotoolkit#4362

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: exzile <joeypongallo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant