diff --git a/studio/setup.sh b/studio/setup.sh index b5c60030c3..9b29def859 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -862,6 +862,10 @@ else # name-inferred arch). Implies --has-rocm on the installer side. if [ -n "${_setup_gfx:-}" ]; then _PREBUILT_CMD+=(--rocm-gfx "$_setup_gfx") + elif [ "$_setup_amd_detected" = true ]; then + # AMD was detected but gfx resolution failed; tell the installer ROCm is + # present so it can still attempt a prebuilt. Mirrors setup.ps1 behaviour. + _PREBUILT_CMD+=(--has-rocm) fi _PREBUILT_LOG="$(mktemp)" set +e diff --git a/tests/studio/install/test_rocm_support.py b/tests/studio/install/test_rocm_support.py index 5b6586f9c9..1d6e4f4c51 100644 --- a/tests/studio/install/test_rocm_support.py +++ b/tests/studio/install/test_rocm_support.py @@ -2682,6 +2682,13 @@ class TestRocmGfxForwarding: assert "--rocm-gfx" in source assert '"$_setup_gfx"' in source + def test_setup_sh_forwards_has_rocm(self): + # When AMD is detected but gfx resolution fails, setup.sh must still + # forward --has-rocm so the installer knows ROCm is present. + source = _SETUP_SH_PATH.read_text(encoding = "utf-8") + assert "--has-rocm" in source + assert "_setup_amd_detected" in source + def test_setup_ps1_forwards_rocm_gfx(self): source = _SETUP_PS1_PATH.read_text(encoding = "utf-8") assert "--rocm-gfx" in source