Skip to content

macOS: pin the RPC RDMA transport off instead of auto-detecting it - #131

Merged
danielhanchen merged 1 commit into
masterfrom
fix-macos-rpc-rdma-autodetect
Aug 27, 2026
Merged

danielhanchen merged 1 commit into
masterfrom
fix-macos-rpc-rdma-autodetect

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The break

Every macOS lane in unslothai/unsloth CI, and every macOS user who installed after b10639-mix-f6f92fe went out:

dyld[41694]: Library not loaded: /usr/lib/librdma.dylib
  Referenced from: .../llama.cpp/build/bin/libggml-rpc.0.dylib
  Reason: tried: '/usr/lib/librdma.dylib' (no such file), ... (not in dyld cache)
llama-server failed to launch on macOS 15.7.7 (dyld load / symbol error)

Cause

ggml/src/ggml-rpc/CMakeLists.txt auto-detects the transport:

if (APPLE)
    set(RDMA_LIB_NAME rdma)
find_library(RDMA_LIB ${RDMA_LIB_NAME})
if (RDMA_LIB)
    option(GGML_RPC_RDMA "ggml: enable RDMA transport for RPC" ON)

This workflow passes -DGGML_RPC=ON and leaves RDMA to that detection. The runner resolved librdma, so the option defaulted ON and /usr/lib/librdma.dylib was linked into libggml-rpc. That library comes with the runner image, not with macOS.

b10639-mix-f6f92fe (2026-08-27) is the first release carrying upstream b114b4739 (2026-08-25, "rpc: support apple RDMA as an RPC transport"). b10472-mix-4b653db predates it and is unaffected.

Why the load gate missed it

assert_macho_minos.sh does launch the binaries - llama-cli --version forces dyld to resolve the full link graph. But it runs on the build host, which is the one machine where librdma exists. A build-host-only dependency is invisible to any check that runs on the build host.

The change

  • -DGGML_RPC_RDMA=OFF on the cmake line. A redistributable must not have its configuration decided by whatever happened to be installed where it was built. OFF specifically, because RDMA-over-Thunderbolt is not something a downloaded prebuilt's consumers can use; RPC itself stays ON.
  • A gate that checks both what was asked for (CMakeCache.txt) and what was actually linked (otool -L), because those can disagree - a stale cache or a future transitive link would satisfy one and not the other.

Only the macOS legs are touched. Linux/Windows RPC builds are unaffected.

Verification

I have no macOS host, so the dyld behaviour is argued from the CI log above rather than reproduced. What I did verify locally, by extracting the step and driving it against fixtures:

cache linked result
GGML_RPC_RDMA:BOOL=ON - exit 1
GGML_RPC_RDMA:BOOL=OFF clean exit 0
GGML_RPC_RDMA:BOOL=OFF binary links librdma exit 1

Also bash -n clean, and the workflow YAML parses with the new step landing between Build and the load gate. xargs -r is deliberately not used - it is a GNU extension and these are BSD userland runners.

Still needed after this

This fixes the build. b10639-mix-f6f92fe still needs rebuilding and republishing - until then, installs continue to pick up the broken bundle. The same release also broke whisper.cpp pairing, which now reports it wants b10472-mix-4b653db.

Related: unslothai/unsloth#9843 makes the installer refuse a bundle like this rather than logging "prebuilt installed and validated" and failing at first launch.

Not addressed

The general class - a release artifact silently picking up a dependency that only exists on the builder - is only closed for RDMA here. An allowlist of permitted absolute install names, diffed per release, would close it properly; I did not attempt that without a macOS host to derive the baseline from.

ggml-rpc auto-detects RDMA. On Apple it find_library(rdma)s and, when the
runner has one, defaults GGML_RPC_RDMA to ON and links /usr/lib/librdma.dylib
into libggml-rpc. That library ships with the runner image, not with macOS, so
b10639-mix-f6f92fe -- the first release carrying upstream b114b47 -- loaded on
the builder and died everywhere else:

  dyld: Library not loaded: /usr/lib/librdma.dylib
    Referenced from: .../libggml-rpc.0.dylib
  llama-server failed to launch on macOS 15.7.7

The existing load gate could not catch it. It does launch the binary, but on
the one host where the library exists.

A redistributable must not have its configuration decided by whatever happened
to be installed where it was built, so the value is pinned. OFF specifically,
because RDMA-over-Thunderbolt is not something the prebuilt's consumers can use.

The new gate checks both what was asked for (CMakeCache) and what was linked
(otool), since those can disagree. Verified all three paths: cache ON fails,
cache OFF with a clean link passes, and cache OFF with a binary that still
links librdma fails.

@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: cb8c7be2d4

ℹ️ 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".

Comment on lines +106 to +110
# ggml-rpc AUTO-DETECTS RDMA: on Apple it find_library(rdma)s and, when the
# runner has one, defaults GGML_RPC_RDMA to ON and links /usr/lib/librdma.dylib
# into libggml-rpc. That library ships with the runner image, not with macOS,
# so the bundle loaded on the builder and died everywhere else:
#

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 Condense the incident narrative in this comment

This 13-line block hard-wraps several sentences and repeats details already conveyed by -DGGML_RPC_RDMA=OFF and the assertion step, while embedding release-specific incident history that will quickly become stale. Keep only a short, durable explanation of why RDMA must remain disabled; the repository explicitly requires concise, nonredundant comments without fixed-column wrapping.

AGENTS.md reference: AGENTS.md:L74-L78

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit 5ee1248 into master Aug 27, 2026
4 checks passed
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