Skip to content

CPU prebuilts: build the Linux arm64 bundle on ubuntu-22.04-arm (glibc 2.35 floor) - #33

Merged
danielhanchen merged 1 commit into
unslothai:masterfrom
oobabooga:cpu-arm64-jammy
Jul 8, 2026
Merged

danielhanchen merged 1 commit into
unslothai:masterfrom
oobabooga:cpu-arm64-jammy

Conversation

@oobabooga

Copy link
Copy Markdown
Member

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).

@danielhanchen

Copy link
Copy Markdown
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):

  • floor: GLIBC_2.38 / GLIBCXX_3.4.32
  • fails to load:
    • libc.so.6: version 'GLIBC_2.38' not found (required by libllama-server-impl.so)
    • libstdc++.so.6: version 'GLIBCXX_3.4.32' not found, CXXABI_1.3.15 not found

After (this PR: clang-19 on ubuntu-22.04-arm, exact cmake flags GGML_NATIVE=OFF, GGML_BACKEND_DL=ON, GGML_CPU_ALL_VARIANTS=ON, GGML_RPC=ON, server on):

  • CMAKE_CXX_COMPILER = /usr/bin/clang++-19, GGML_NATIVE = OFF
  • clang-19 compiles every arm CPU variant, including the SME ones jammy's gcc can't target:
    • ggml-cpu-armv9.2_1 (armv9.2-a+dotprod+fp16+sve+i8mm+sme)
    • ggml-cpu-armv9.2_2 (+sve2+sme)
  • floor audit across llama-server + every libggml-*.so: max GLIBC_2.34 / GLIBCXX_3.4.30 (at or below the jammy floor; also fits Debian 12's 3.4.30)
  • runtime smoke: llama-server loads Llama-3.2-1B Q4_K_M and answers "What is 1+1?" -> 2, so clang-19 does not miscompile ggml and the runtime CPU-variant dispatch is fine

Forward compat: the same 22.04-built binary runs and answers 2 on ubuntu-24.04-arm and ubuntu-26.04-arm as well.

Two non-blocking notes:

  1. ubuntu-22.04 / -arm runner deprecation begins 2026-09-17 (fully removed 2027-04-17), so this glibc-2.35 floor host has a finite CI runway. Worth a follow-up before then if we still want the low floor (self-hosted jammy, a container base, or a manylinux-style toolchain).
  2. This only touches the arm64 leg; x64 already builds on ubuntu-22.04 and is unchanged, so no regression there.

LGTM.

@danielhanchen
danielhanchen merged commit 88d6b99 into unslothai:master Jul 8, 2026
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.

2 participants