unsloth/tests/studio/install
Daniel Han 10bc8aa538 Keep probing for nvidia-smi after an unusable one on PATH
_has_usable_nvidia_gpu gated its Windows fixed-location fallback on the
PATH lookup missing, not on the GPU check failing. A stale or driverless
nvidia-smi exits non-zero listing nothing, so the search stopped there
and the function reported no NVIDIA GPU even with a working driver
binary under NVSMI or System32.

That answer routes a mixed AMD iGPU plus NVIDIA dGPU Windows host into
_ensure_rocm_torch() and replaces its CUDA stack with ROCm wheels.

install.ps1 and studio/setup.ps1 already do the right thing: both call
Test-NvidiaSmiHasGpu on the PATH result and fall through to the two fixed
paths when it fails, with the same reasoning recorded at install.ps1:1708
("a stale/driverless nvidia-smi can exit 0 while listing no GPU"). This
brings the Python helper to the same rule: collect the candidates, then
take the first that lists a GPU.

Reproduced with real stub executables through the real subprocess call,
before and after:

    PATH exe   fixed-location exe   before   after
    absent     working              True     True
    stale      working              False    True
    working    -                    True     True
    none       none                 False    False

Only the stale row changes. An AMD-only host with a leftover nvidia-smi
still gets False, so it is not denied the ROCm wheels.

tests/studio/install/test_nvidia_smi_candidate_probing.py pins all four
rows plus the CUDA_VISIBLE_DEVICES cases: 1 failed / 8 passed before,
9 passed after.
2026-07-27 23:18:39 +00:00
..
conftest.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
smoke_test_llama_prebuilt.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
smoke_test_parallel_studio_home.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_cuda_repair.py install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_download_host_resolve.py Studio: resolve llama.cpp prebuilts via the release-assets CDN to avoid GitHub API rate limits (#7086) 2026-07-14 03:30:17 -07:00
test_gpu_detection_followups.py install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_hf_auth.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_install_llama_prebuilt_logic.py fix(studio): opt-in source-build GPU smoke validation (#7322) 2026-07-23 19:13:54 -07:00
test_install_node_prebuilt_logic.py Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
test_install_whisper_prebuilt_logic.py Studio whisper: pair slim bundles on the ggml commit, not the full llama tag (#7381) 2026-07-23 20:18:36 -07:00
test_launch_studio_launcher.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_llama_pr_force_and_source.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_llama_prebuilt_no_space.py Studio: fail fast on out-of-disk instead of a doomed llama.cpp source build (#7420) 2026-07-26 00:11:38 -07:00
test_macos_version_compat.py Studio macOS: faster startup, MLX self-heal, drop obsolete prebuilt pins (#6494) 2026-06-22 02:20:08 -07:00
test_managed_node_runtime.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_nvidia_smi_candidate_probing.py Keep probing for nvidia-smi after an unusable one on PATH 2026-07-27 23:18:39 +00:00
test_pr4562_bugfixes.py tests: read checked-in files as UTF-8 instead of the platform default (#7438) 2026-07-26 23:31:56 -07:00
test_pr5940_followups.py install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_prebuilt_core.py Studio: add local speech-to-text dictation engine (#7095) 2026-07-23 01:39:03 -07:00
test_probe_timeouts.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_rocm_arch_table_parity.py AMD: CI coverage for recent fixes, plus three wrong gfx ids (#7431) 2026-07-25 18:58:02 -05:00
test_rocm_native_linux_lib_dirs.py AMD: CI coverage for recent fixes, plus three wrong gfx ids (#7431) 2026-07-25 18:58:02 -05:00
test_rocm_rdna_routing.py Fix the CPU-only ROCm routing errors and two font-scale UI flakes (#7469) 2026-07-26 04:48:49 -07:00
test_rocm_support.py AMD: enable ROCm torch on gfx906 (MI50 / Radeon VII) on Linux (#7354) 2026-07-27 05:22:19 -07:00
test_selection_logic.py tests: record the gfx1152 llama.cpp bundle gap so the next one is not silent (#7491) 2026-07-27 03:46:38 -07:00
test_setup_whisper_status.py Studio: add local speech-to-text dictation engine (#7095) 2026-07-23 01:39:03 -07:00