diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index 97962311fc..705ba708d2 100644 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -7092,7 +7092,16 @@ def main() -> int: return EXIT_SUCCESS if args.smoke_test is not None: - host = detect_host() + # Honor the same host overrides as the install path so a caller that + # forwards --has-rocm / --rocm-gfx (setup.sh/setup.ps1 do, because the + # installer's own probe can miss amd-smi-only hosts) is held to the GPU + # offload check instead of silently resolving a CPU kind. + host = _apply_host_overrides( + detect_host(), + override_has_rocm = args.has_rocm, + override_rocm_gfx = args.rocm_gfx, + force_cpu = args.cpu_fallback, + ) try: resolved_kind = smoke_test_server_binary( args.smoke_test, diff --git a/studio/setup.ps1 b/studio/setup.ps1 index b52b02a8d2..3a4e9d4ca3 100644 --- a/studio/setup.ps1 +++ b/studio/setup.ps1 @@ -3051,7 +3051,10 @@ if (-not $NeedLlamaSourceBuild) { if (Test-Path -LiteralPath $builtServer) { Write-Host "" Write-Host "--- GPU smoke test ---" -ForegroundColor Cyan - & python "$PSScriptRoot\install_llama_prebuilt.py" --smoke-test "$builtServer" --install-dir "$LlamaCppDir" 2>&1 | Out-String | Write-Host + # $LlamaCudaBuild gates this block, so the build is CUDA; pass the + # explicit kind so the installer's own probe cannot resolve a CPU + # kind and skip the offload gate. + & python "$PSScriptRoot\install_llama_prebuilt.py" --smoke-test "$builtServer" --install-dir "$LlamaCppDir" --install-kind "windows-cuda" 2>&1 | Out-String | Write-Host $smokeExit = $LASTEXITCODE if ($smokeExit -eq 2) { substep "GPU build runs on CPU only (GPU backend failed to initialize)" "Yellow" diff --git a/studio/setup.sh b/studio/setup.sh index b941fd6a82..10aa831b72 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -1362,11 +1362,23 @@ else # _gpu_fallback_label is empty for a pure CPU build (nothing to verify). if [ "$BUILD_OK" = true ]; then _SMOKE_LABEL="$(_gpu_fallback_label)" - if [ -n "$_SMOKE_LABEL" ] && [ -f "$_BUILD_TMP/build/bin/llama-server" ]; then + # Pass the GPU kind setup resolved, not the installer's own probe: + # on amd-smi-only / name-inferred ROCm hosts the child probe can miss + # the GPU and resolve a CPU kind, which would skip the offload gate. + _SMOKE_KIND="" + if [ "$_TRY_METAL_CPU_FALLBACK" = true ]; then + _SMOKE_KIND="macos-arm64" + elif [ "$GPU_BACKEND" = "cuda" ]; then + _SMOKE_KIND="linux-cuda" + elif [ "$GPU_BACKEND" = "rocm" ]; then + _SMOKE_KIND="linux-rocm" + fi + if [ -n "$_SMOKE_LABEL" ] && [ -n "$_SMOKE_KIND" ] && [ -f "$_BUILD_TMP/build/bin/llama-server" ]; then # if/else keeps set -e from aborting before we read the code. if python "$SCRIPT_DIR/install_llama_prebuilt.py" \ --smoke-test "$_BUILD_TMP/build/bin/llama-server" \ - --install-dir "$_BUILD_TMP" > "$_BUILD_TMP/gpu-smoke.log" 2>&1; then + --install-dir "$_BUILD_TMP" \ + --install-kind "$_SMOKE_KIND" > "$_BUILD_TMP/gpu-smoke.log" 2>&1; then _SMOKE_RC=0 else _SMOKE_RC=$?