From f68bda56c74edbe315ff925f3e794d9e9d3b9366 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 19 Sep 2026 03:49:04 -0700 Subject: [PATCH] frank-large: serve script feeds the launcher its runtime root from the SDK venv The CIRU launcher gates on hip/lib/libamdhip64.so + rocr/lib/libhsa-runtime64.so under its runtime root and exits 2 without them; the build links the private venv through its RUNPATH, so point those entries at the venv's unversioned devel symlinks (idempotent ln -sfn). Without this the unit crash-looped for the full 2400s health gate on first deploy. --- scripts/serve-frank-large.sh | 14 ++++++++++++++ tests/frank_large_unit.bats | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/scripts/serve-frank-large.sh b/scripts/serve-frank-large.sh index 3cbfda3..aa56899 100755 --- a/scripts/serve-frank-large.sh +++ b/scripts/serve-frank-large.sh @@ -53,6 +53,20 @@ if [[ ! -x "$SERVER_BIN" ]]; then echo "build it: bash $RUNTIME_DIR/scripts/ciru/setup-linux-amd.sh --install-host-deps" >&2 exit 1 fi + +# The launcher gates on a runtime root holding hip/lib/libamdhip64.so and +# rocr/lib/libhsa-runtime64.so (it prepends both to LD_LIBRARY_PATH). Our +# build links the private SDK venv through its RUNPATH, so point those +# entries at the venv's unversioned devel symlinks. Idempotent: ln -sfn. +VENV_LIB="$(ls -d "$RUNTIME_DIR"/.venv-rocm/lib/python*/site-packages/_rocm_sdk_devel/lib 2>/dev/null | head -1 || true)" +if [[ -z "$VENV_LIB" || ! -e "$VENV_LIB/libamdhip64.so" || ! -e "$VENV_LIB/libhsa-runtime64.so" ]]; then + echo "missing SDK venv runtime under $RUNTIME_DIR/.venv-rocm (libamdhip64.so, libhsa-runtime64.so)" >&2 + echo "build it: bash $RUNTIME_DIR/scripts/ciru/setup-linux-amd.sh --install-host-deps" >&2 + exit 1 +fi +mkdir -p "$RUNTIME_DIR/runtime/hip/lib" "$RUNTIME_DIR/runtime/rocr/lib" +ln -sfn "$VENV_LIB/libamdhip64.so" "$RUNTIME_DIR/runtime/hip/lib/libamdhip64.so" +ln -sfn "$VENV_LIB/libhsa-runtime64.so" "$RUNTIME_DIR/runtime/rocr/lib/libhsa-runtime64.so" if [[ ! -r "$MODEL_DIR/Qwen3.8-Flash-CIRU-STRIX-Orca.gguf" ]]; then echo "missing target model: $MODEL_DIR/Qwen3.8-Flash-CIRU-STRIX-Orca.gguf" >&2 echo "fetch and assemble it: bash $SCRIPT_DIR/download-frank-large-orca.sh" >&2 diff --git a/tests/frank_large_unit.bats b/tests/frank_large_unit.bats index f0a0c48..5f8ca54 100755 --- a/tests/frank_large_unit.bats +++ b/tests/frank_large_unit.bats @@ -72,6 +72,17 @@ REMOTE_DEPLOY="$REPO_ROOT/scripts/deploy-remote.sh" grep -q 'preserve_thinking' "$SERVE" } +@test "the serve script feeds the launcher its runtime root from the SDK venv" { + # The launcher exits 2 without hip/lib/libamdhip64.so + + # rocr/lib/libhsa-runtime64.so under its runtime root; the build links + # the private venv, so the serve script must point those entries there + # or the unit crash-loops on the gate (seen 2026-09-19). + grep -q '_rocm_sdk_devel/lib' "$SERVE" + grep -q 'runtime/hip/lib/libamdhip64.so' "$SERVE" + grep -q 'runtime/rocr/lib/libhsa-runtime64.so' "$SERVE" + grep -q 'missing SDK venv runtime' "$SERVE" +} + @test "the payload is fetched resumably and verified by sha256" { grep -q 'jcbtc/Qwen3.8-Flash-CIRU-STRIX-Orca' "$FETCH" grep -q -- '-fL -C -' "$FETCH"