Repository navigation
Wire the OpenMP runtime into slim bundles alongside ggml - #18
Merged
Merged
Conversation
The scheduled slim run failed on linux/arm64: whisper-server exited 127 with "libomp.so.5: cannot open shared object file". llama's arm64 slice is clang-built, so the libggml-base.so we wire in NEEDS libomp.so.5 with RUNPATH $ORIGIN. That library ships inside the llama bundle and is not a system library, but the wiring globbed only libggml* (plus libomp*.dll for windows-arm64), so it never landed next to whisper-server. linux/x64 is gcc-built and resolves libgomp.so.1 from the host, which is why only arm64 broke. Wire libomp*.so / .so.* / .dylib as well, and split the globs so the two groups are documented apart. Names already present in the bundle are still skipped, so re-running over an extracted bundle stays a no-op and only the extracted copy is ever touched, never the packaged archive. Verified against the published v1.9.2-unsloth.5 bundles and their paired llama.cpp releases: walking the arm64 loader closure statically leaves libomp.so.5 unresolved before this change and nothing unresolved after it, the x64 bundle still wires the same 21 objects and passes end to end (help, closure, real /inference transcription), and a second validate run leaves the bundle dir byte-identical.
danielhanchen
added a commit
to unslothai/unsloth
that referenced
this pull request
Aug 9, 2026
…8230) * fix(studio): wire llama's OpenMP runtime into slim whisper installs The slim wiring mirrors libggml*/ggml*.dll plus libomp*.dll from the paired llama bin dir. The DLL glob was added for llama's clang-built windows-arm64 ggml-base.dll; the ELF side was left out on the assumption that Linux ggml takes libgomp.so.1 from the host. That holds for the gcc-built x64 slice but not for arm64: llama's arm64 libggml-base.so is clang-built and NEEDS libomp.so.5 with RUNPATH $ORIGIN, and that library ships inside the llama bundle rather than on the host. Every slim install on linux arm64 therefore wired a ggml stack whose loader immediately failed with "libomp.so.5: cannot open shared object file", so dictation fell back to Transformers. Add libomp*.so* and libomp*.dylib to the globs, and bump SLIM_RUNTIME_WIRING_VERSION so installs made under the old wiring re-wire instead of reporting themselves current: their marker does not list libomp.so.5, so the missing-library check that would otherwise repair them never fires. whisper.cpp side is unslothai/whisper.cpp#18 (CI wiring) and #19, which adds the library to requires_ggml_sonames. That gate reads the llama bin dir, where libomp.so.5 is a real file, so the new manifests pair correctly with both the old and the new installer. Verified against the real published llama.cpp arm64 and x64 cpu bundles: wiring the arm64 bundle now places libomp.so.5 beside whisper-server and pulls in no llama libraries; every soname the new whisper manifests require exists as a file in the paired llama bin dir on both arches; and an x64 whisper-server wired through link_ggml_runtime starts and returns a real transcription. All 350 whisper/llama/prebuilt-core install tests pass. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Tighten the libomp wiring comments for PR #8230 * Fix the sidecar's ROCm wiring version check for PR #8230 --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pull Bot
pushed a commit
to Penguinjanator/whisper.cpp
that referenced
this pull request
Aug 9, 2026
unslothai#19) Wiring the OpenMP runtime in CI (unslothai#18) fixed the build, but the contract the Studio installer actually reads did not change: requires_ggml_sonames still listed only the two ggml sonames, so an installer wiring from that list (or from a libggml* glob) still lands an arm64 bundle whose whisper-server cannot load. Windows has the same hole - ggml-base.dll imports libomp140.<arch>.dll on BOTH arches, verified in the PE import tables of the paired llama bundles - and only passed CI because the wiring globs libomp*.dll. Make the soname contract per-arch in the platform strategies rather than per-job, so the manifest is derived where the rest of the packaging contract lives: libomp.so.5 on linux/arm64, libomp140.<arch>.dll on both Windows arches. linux/x64 (gcc, libgomp from the host) and macOS (Apple clang, no OpenMP) are unchanged, and the existing GGML_SONAMES override still wins, so the macOS jobs that pass their own per-arch closure are untouched. Then close the loop in CI: on Linux, validate_bundle.py now asserts that every library the loader resolves out of the paired llama bundle appears in requires_ggml_sonames. CI wires by glob and the installer wires from the list, so without this the two drift and the build goes green while every install is broken - exactly what happened here. A declared name the llama bundle does not provide is a warning, not a failure, so a llama-side change cannot block a release on its own. Verified by packaging synthetic linux slim bundles for both arches (arm64 gains libomp.so.5, x64 unchanged), by running the full validation against the published v1.9.2-unsloth.5 x64 bundle and its paired llama release (contract OK, real /inference transcription), and by a 13-case suite covering both real llama bundles plus a synthetic ELF chain that proves the gate fails on an undeclared lib, passes once declared, and only warns on a stale entry. Co-authored-by: danielhanchen <[email protected]>
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.
What broke
The nightly slim run failed on
linux/arm64(run 31283085719):Slim bundles ship no ggml, so validation wires it in from the paired
unslothai/llama.cppcpu bundle. That llama arm64 slice is clang-built:libomp.so.5ships inside the llama bundle and is not a system library, butwire_ggmlglobbed onlylibggml*(pluslibomp*.dll, added earlier for windows-arm64), so it never landed next towhisper-serverand$ORIGINhad nothing to resolve.linux/x64is gcc-built and picks uplibgomp.so.1from the host, which is why only arm64 broke; macOS is Apple clang with no OpenMP at all.The change
wire_ggmlalso globslibomp*.so,libomp*.so.*andlibomp*.dylib, and the two pattern groups are split so the OpenMP rationale sits next to the patterns instead of inside the loop. Behaviour is unchanged everywhere the llama bundle ships no libomp.Wiring stays idempotent: names already present are skipped, only the extracted bundle is touched, never the packaged archive. Both properties are now stated in the docstring.
Verification
Against the published
v1.9.2-unsloth.5bundles and their paired llama releases:NEEDEDclosure of the real bundle statically givesunresolved -> ['libomp.so.5']before this change andunresolved -> noneafter it.validate_bundle.py --ggml-dir --cpu-onlyrun wires the same 21 objects as the passing CI job, then--helpOK, closure OK, and a real/inferencePOST returns'And so my fellow Americans ask not what your country can do for you...'.wired 0and leaves the directory tree byte-identical.Follow-up, not in this PR
requires_ggml_sonamesin the published manifest lists only the two ggml sonames, so an installer that wires from that list (or from alibggml*glob) still produces an unloadable bundle on arm64 Linux, and on Windows, whereggml-base.dllimportslibomp140.<arch>.dllon both arches. The manifest fix plus a CI gate that asserts every library the loader takes from the llama dir is published inrequires_ggml_sonamesboth touch.github/workflows/, which my token cannot push; I will open that as a separate PR.