diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index fc3c65bc4b..abe31ebfff 100755 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -1433,7 +1433,7 @@ def detect_host() -> HostInfo: # Detect AMD ROCm (HIP) -- require actual GPU, not just tools installed has_rocm = False - if not is_macos: + if is_linux: for _cmd, _marker in ( (["rocminfo"], "gfx"), (["amd-smi", "list"], "gpu"), @@ -1449,6 +1449,16 @@ def detect_host() -> HostInfo: if _marker in _result.stdout.lower(): has_rocm = True break + elif is_windows: + # Windows: check for HIP runtime DLL or hipinfo tool + if shutil.which("hipinfo") or shutil.which("amd-smi"): + has_rocm = True + elif any( + Path(d).joinpath("amdhip64.dll").exists() + for d in os.environ.get("PATH", "").split(os.pathsep) + if d + ): + has_rocm = True return HostInfo( system = system, diff --git a/tests/studio/install/test_rocm_support.py b/tests/studio/install/test_rocm_support.py index 5955d79aec..fe76d920a5 100644 --- a/tests/studio/install/test_rocm_support.py +++ b/tests/studio/install/test_rocm_support.py @@ -403,6 +403,13 @@ class TestHostInfoRocm: source = inspect.getsource(prebuilt_mod.detect_host) assert "ROCM_PATH" in source or "rocm" in source.lower() + def test_detect_host_windows_rocm_detection(self): + """detect_host() source should have Windows-specific HIP detection.""" + import inspect + + source = inspect.getsource(prebuilt_mod.detect_host) + assert "hipinfo" in source or "amdhip64" in source + # ============================================================================= # TEST: install_python_stack.py -- _detect_rocm_version