Skip to content

fix(studio): wire llama's OpenMP runtime into slim whisper installs - #8230

Merged
danielhanchen merged 4 commits into
mainfrom
fix-whisper-slim-libomp-wiring
Aug 9, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
fix-whisper-slim-libomp-wiring

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Companion to unslothai/whisper.cpp#18 and unslothai/whisper.cpp#19. Those fix the build and the published contract; this fixes what the installer actually wires, which is what users run.

The bug

SLIM_GGML_LIBRARY_GLOBS mirrors libggml* / ggml*.dll / libomp*.dll from the paired llama bin dir into the whisper bin dir. The DLL glob was added for llama's clang-built windows-arm64 ggml-base.dll; the ELF side was skipped on the stated assumption that Linux ggml takes libgomp.so.1 from the host.

That holds for the gcc-built x64 slice, but not for arm64. From the published app-b10327-mix-b1e9972-linux-arm64-cpu.tar.gz:

libggml-base.so         NEEDED libomp.so.5   RUNPATH $ORIGIN
libggml-cpu-armv8.0_1   NEEDED libomp.so.5   RUNPATH $ORIGIN

libomp.so.5 ships inside the llama bundle and is not a host library. So on linux arm64 every slim install wired a ggml stack the loader could not bring up:

whisper-server: error while loading shared libraries: libomp.so.5:
cannot open shared object file: no such file or directory

whisper-server never starts and dictation silently falls back to Transformers. The same defect broke the whisper.cpp release CI, which is how it surfaced.

Changes

  • libomp*.so* and libomp*.dylib join SLIM_GGML_LIBRARY_GLOBS. Linux x64 (gcc, libgomp.so.1 from the host, exactly as llama's own binaries resolve it) and macOS (Apple clang, no OpenMP) ship no libomp, so the globs match nothing and those platforms are byte-identical.
  • SLIM_RUNTIME_WIRING_VERSION 2 -> 3. Without this, an install made under the old wiring reports itself current forever: the missing-library repair check only looks at names in its own marker, and the old marker never listed libomp.so.5. The bump is what actually repairs the broken arm64 installs already out there.

The fail-closed rule is unchanged: OpenMP without any ggml library still raises PrebuiltFallback, now covered for the ELF case too.

On the manifest side

whisper.cpp#19 adds libomp.so.5 to requires_ggml_sonames on linux/arm64 and libomp140.<arch>.dll on Windows. slim_pairing_for_artifact checks those names against the llama bin dir, where they are real files, so the new manifests pair correctly with both the old and the new installer. No coordinated rollout is needed; this PR is what makes the wiring match the contract.

Verification

Against the real published llama.cpp bundles, not fixtures:

  • Wiring the arm64 cpu bundle now places libomp.so.5 beside whisper-server (16 libs) and pulls in no libllama*.
  • Every soname the new whisper manifests require exists as a file in the paired llama bin dir, on both arches, so the pairing gate passes.
  • An x64 whisper-server from the published v1.9.2-unsloth.5 slim bundle, wired through link_ggml_runtime and launched with --no-gpu, returns a real transcription of samples/jfk.wav.
  • Two new regression tests mirroring the existing Windows libomp pair: the ELF wiring includes libomp.so.5 and excludes libllama.so, and libomp alone still fails closed.
  • 350 passed, 1 skipped across the whisper, llama, prebuilt-core, setup-status and checksum install suites.

danielhanchen and others added 2 commits August 9, 2026 07:57
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fef32267aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

SLIM_RUNTIME_WIRING_VERSION = 2
# 3: libomp*.so* / libomp*.dylib joined the wiring, so slim installs made
# under version 2 are missing libomp.so.5 on linux arm64 and must re-wire.
SLIM_RUNTIME_WIRING_VERSION = 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the sidecar's ROCm wiring version in sync

For every newly installed slim ROCm runtime, this writes runtime_wiring_version: 3, but slim_runtime_intact() in studio/backend/core/inference/stt_ggml_sidecar.py still requires the version to equal 2. Consequently both Linux and Windows ROCm installs produced by this change are immediately reported as unavailable, and dictation asks users to reinstall even though all linked libraries are present; update the sidecar's accepted version together with this bump.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct and my regression: with the bump to 3 the sidecar's ROCm branch rejected every new install, and the installer treats 3 as current so update never repaired it. Reproduced (v2 intact, v3 rejected with the reinstall warning). Fixed in 816d5b3 by pinning a floor (>= 2, the first wiring that records linked_runtime_directories) instead of one exact version, plus regression tests for v3 accepted and v1 still rejected.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 816d5b3c0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 954468a into main Aug 9, 2026
61 of 66 checks passed
@danielhanchen
danielhanchen deleted the fix-whisper-slim-libomp-wiring branch August 9, 2026 08:35
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