Repository navigation
CPU prebuilts: build the Linux arm64 bundle on ubuntu-22.04-arm (glibc 2.35 floor) - #33
Merged
Merged
Conversation
Member
|
I ran into this exact arm64 loader-floor bug while testing the CPU prebuilts for ggml-org#6311: the 24.04-built arm64 bundle needs GLIBC_2.38 and will not load on Ubuntu 22.04 / Debian 12 arm64, while the x64 bundle (built on 22.04) is fine. This is the right fix. I validated it end to end on GitHub-hosted arm64 CPU runners. Before (current published arm64 bundle, on ubuntu-22.04-arm):
After (this PR: clang-19 on ubuntu-22.04-arm, exact cmake flags
Forward compat: the same 22.04-built binary runs and answers Two non-blocking notes:
LGTM. |
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.
The Linux arm64 CPU bundle is built on ubuntu-24.04-arm, so it requires GLIBC_2.38 / GLIBCXX_3.4.32. It fails to load on Ubuntu 22.04 or Debian 12 arm64 with a version-not-found loader error (found by @danielhanchen's runner matrix in unslothai/unsloth#6311). The x64 leg builds on ubuntu-22.04 and does not have this problem. Upstream's own ubuntu-arm64 bundle has the identical floor, so this was inherited, not new.
Fix
Build the arm64 leg on ubuntu-22.04-arm, matching the x64 leg's base. The bundle's floor drops to GLIBC_2.34 / GLIBCXX_3.4.30, which Ubuntu 22.04 and Debian 12 satisfy.
The toolchain step changes with it. Jammy's gcc (<= 12) cannot target the armv9.2-a+sme CPU variants that GGML_CPU_ALL_VARIANTS fans out, and a toolchain-PPA gcc would reference newer libstdc++ symbols and recreate the floor this PR removes. So the arm64 leg now uses clang 19 from apt.llvm.org, which compiles the SME variants while linking against the system (jammy) libstdc++. This replaces the GCC-14 miscompile workaround, only needed on the ubuntu-24.04 runner. clang-built ggml CPU bundles are already the norm elsewhere: upstream's Windows CPU releases, macOS, and Android all use clang.
Verification
Ran the full prebuilt workflow with this change on my fork (https://github.com/oobabooga/llama.cpp/actions/runs/28913632512): linux/arm64 and linux/x64 CPU jobs green. The produced arm64 bundle has floors GLIBC_2.34 / GLIBCXX_3.4.30 (was GLIBC_2.38 / GLIBCXX_3.4.32), ships all 8 CPU variant libraries including both armv9.2 SME legs, and keeps the same NEEDED set and $ORIGIN RUNPATH.
Then ran the bundle on a real ubuntu-22.04-arm runner (glibc 2.35, the host class that failed before): ldd resolves, llama-server --version passes, and llama-completion generates correct text from a tiny GGUF end to end (https://github.com/oobabooga/llama.cpp/actions/runs/28915006185).