You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
studio/setup.sh: validate source-built llama.cpp and guard empty CUDA arch detection #5854
PR #5826 hardened studio/setup.sh for fresh CUDA toolkits (the -allow-unsupported-compiler flag, plus a generalized CUDA/ROCm to CPU fallback). While validating that change I hit two related gaps that the prebuilt path already handles but the source-build path does not. Filing as a follow-up.
1. Empty CUDA arch detection produces a PTX-only build that can fail at runtime
The source build sets -DCMAKE_CUDA_ARCHITECTURES from nvidia-smi --query-gpu=compute_cap. If that query returns nothing (the build log then reads building (CUDA) rather than building (CUDA, sm_120)), llama.cpp builds for its default arch list and ships PTX only. On a driver older than the toolkit, loading that binary fails at runtime with:
CUDA error: the provided PTX was compiled with an unsupported toolchain.
The build itself succeeds, so neither the build-time check nor the new CPU fallback catches it, and the user ends up with a llama-server that crashes on first use.
Repro: build llama.cpp with the CUDA 13.3 toolkit and no -DCMAKE_CUDA_ARCHITECTURES, then run it on a driver that only advertises CUDA 13.0.
Suggested: if the detected arch list comes back empty, either skip CUDA and build CPU, or stop with a clear message, rather than silently producing a PTX-only build.
2. The source-build path has no post-build validation
install_llama_prebuilt.py validates the prebuilt before accepting it (it runs llama-server --n-gpu-layers 1 against a tiny model). The source-build path has no equivalent: once it links llama-server it is accepted, even if the binary cannot actually run on this GPU and driver (see 1).
Suggested: after a source GPU build, run the same lightweight GPU smoke test; if it fails, reuse the new _gpu_fallback_label path to retry a CPU build so the user still ends up with a working server.
Why it matters
A user whose prebuilt validation fails will fall through to a source build (this is one of the few real ways to reach the source path). If that source build then produces a non-running binary, the fall-through has not actually helped. Closing this loop makes the source-build fallback as trustworthy as the prebuilt path.
Activity
studio: make NVIDIA prebuilt selection track CUDA version bumps (Wind…
Studio: source-build + CPU last-resort recovery when no GPU prebuilt …
studio/setup.sh: guard empty CUDA arch detection in the source build (#…
Rebuild visual server after staged-validation CPU fallback (unslothai…
fix(studio): opt-in source-build GPU smoke validation (#7322)
Run the dyld probe even when the host macOS version is unknown
Reject a macOS llama.cpp prebuilt that dyld will not load (#9843)
Delete the stray copies rather than move them again
Trim comments in tests, scripts, CI helpers and unsloth_cli (#10113)
Recover CUDA compute capabilities without emitting a P/Invoke type