Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio installer (AMD, Linux): CPU torch for a lone gfx90c instead of kernel-less ROCm wheels (#15002)

Leo Borcherdinge3f20445aefa
diff --git a/install.sh b/install.sh
index 24d6ea2d640..4c39f04a86a 100755
--- a/install.sh
+++ b/install.sh
@@ -6036,8 +6036,8 @@ get_torch_index_url() {
fi
# end of the miscomputing-arch gate -- tests/sh/test_rocm_bad_arch_gate.sh lifts
# the block between the header comment above and this line, so keep both exact.
- # RDNA 1 / Polaris / gfx1153 read fine and still have no wheels: no pytorch.org tag and no
- # AMD per-arch index carries their kernels (only the opt-in multi-arch index does), so the generic tag below installed a multi-GB
+ # RDNA 1 / Polaris / gfx1153 / gfx90c (Renoir-Barcelo iGPU) read fine and still have no wheels: no pytorch.org tag and no
+ # AMD per-arch index carries their kernels (at most the opt-in multi-arch index does), so the generic tag below installed a multi-GB
# torch that faults on its first GPU op (#8529). Only when EVERY probed arch is one, so
# a covered peer keeps its wheels. A readable HSA_OVERRIDE_GFX_VERSION is the arch the
# runtime runs, whatever amd-smi reads, so it alone is judged unless an arch is declared.
@@ -6045,8 +6045,16 @@ get_torch_index_url() {
_amd_hsa_gfx=$(_hsa_override_gfx_arch "${HSA_OVERRIDE_GFX_VERSION:-}" 2>/dev/null) || _amd_hsa_gfx=""
[ -n "$_amd_hsa_gfx" ] && [ -z "${UNSLOTH_ROCM_GFX_ARCH:-}" ] && _amd_unsup_src="$_amd_hsa_gfx"
_amd_unsup_all=$(printf '%s\n' "$_amd_unsup_src" | sed 's/:.*$//' | tr '[:upper:]' '[:lower:]' \
- | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
+ | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803|90c)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
END { if (!bad && l != "") print l }')
+ # An existing ROCm torch on gfx90c is run via HSA_OVERRIDE_GFX_VERSION=9.0.0: updates keep it.
+ if [ "$_amd_unsup_all" = gfx90c ]; then
+ case "${_PREV_TORCH_VER:-}" in
+ *+rocm*)
+ echo "[INFO] Keeping ROCm PyTorch on gfx90c: this environment already runs ${_PREV_TORCH_VER}. Start Unsloth Studio with HSA_OVERRIDE_GFX_VERSION=9.0.0 to use the GPU." >&2
+ _amd_unsup_all="" ;;
+ esac
+ fi
if [ -n "$_amd_unsup_all" ]; then
echo "[WARN] AMD GPU detected ($_amd_unsup_all) -- Unsloth has no ROCm PyTorch wheels for that arch, installing CPU PyTorch." >&2
echo "[WARN] The ROCm PyTorch wheels carry no kernels for it: they would install, then fail on the first GPU operation." >&2
@@ -6056,6 +6064,9 @@ get_torch_index_url() {
echo "[INFO] GGUF chat can still use this GPU through Vulkan: export UNSLOTH_LLAMA_CPP_BACKEND=vulkan and re-run this installer (it selects the llama.cpp bundle at install time)." >&2
fi
echo "[INFO] If you run this GPU with HSA_OVERRIDE_GFX_VERSION, export it and re-run this installer to keep ROCm PyTorch." >&2
+ if [ "$_amd_unsup_all" = gfx90c ]; then
+ echo "[INFO] gfx90c can run ROCm PyTorch's gfx900 kernels: export HSA_OVERRIDE_GFX_VERSION=9.0.0 (also when you start Unsloth Studio) and re-run this installer. Unsloth does not test this." >&2
+ fi
if _amd_therock_extra=$(_therock_device_extra_for_gfx "${_amd_unsup_all%%,*}" 2>/dev/null); then
echo "[INFO] Untested: AMD's TheRock publishes nightly ${_amd_unsup_all%%,*} wheels. To try them, export both and re-run:" >&2
echo "[INFO] export UNSLOTH_TORCH_INDEX_URL='$THEROCK_MIRROR'" >&2
@@ -6393,7 +6404,7 @@ THEROCK_MIRROR="${UNSLOTH_THEROCK_MIRROR:-https://rocm.nightlies.amd.com/whl-mul
# The device extra TheRock publishes for a gfx, or non-zero when it builds none. Only arches
# Unsloth's indexes do not cover, so it never competes with get_torch_index_url; gfx803 is
-# absent because TheRock has no Polaris target.
+# absent because TheRock has no Polaris target, gfx90c because its torch has no device-gfx90c extra.
_therock_device_extra_for_gfx() {
case "$1" in
gfx1010|gfx1011|gfx1012|gfx1153) echo "device-$1" ;;
@@ -7691,7 +7702,7 @@ elif _has_amd_rocm_gpu; then
_amd_hsa_gfx=$(_hsa_override_gfx_arch "${HSA_OVERRIDE_GFX_VERSION:-}" 2>/dev/null) || _amd_hsa_gfx=""
[ -n "$_amd_hsa_gfx" ] && [ -z "${UNSLOTH_ROCM_GFX_ARCH:-}" ] && _amd_unsup_read="$_amd_hsa_gfx"
_amd_unsup_read=$(printf '%s\n' "$_amd_unsup_read" | sed 's/:.*$//' | tr '[:upper:]' '[:lower:]' \
- | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
+ | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803|90c)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
END { if (!bad && l != "") print l }') || _amd_unsup_read=""
fi
if [ "$_torch_index_pinned" = true ]; then
@@ -7755,6 +7766,9 @@ case "$TORCH_INDEX_URL" in
substep "GGUF chat can still use this GPU through Vulkan: export UNSLOTH_LLAMA_CPP_BACKEND=vulkan and re-run this installer." "$C_WARN"
substep "That variable selects the llama.cpp bundle at install time, so setting it afterwards has no effect until you install or update again." "$C_WARN"
fi
+ if [ "$_unsup_disp_gfx" = gfx90c ]; then
+ substep "gfx90c can run ROCm PyTorch's gfx900 kernels: export HSA_OVERRIDE_GFX_VERSION=9.0.0 (also when you start Unsloth Studio) and re-run this installer. Unsloth does not test this."
+ fi
else
substep "AMD GPU detected, but no usable ROCm/HIP install -- installing CPU-only PyTorch." "$C_WARN"
substep "Install the ROCm/HIP SDK and re-run this installer for GPU PyTorch." "$C_WARN"
diff --git a/studio/backend/tests/test_install_resolve_prebuilt.py b/studio/backend/tests/test_install_resolve_prebuilt.py
index 2726275c77b..81482d2e509 100644
--- a/studio/backend/tests/test_install_resolve_prebuilt.py
+++ b/studio/backend/tests/test_install_resolve_prebuilt.py
@@ -4147,7 +4147,8 @@ def _linux_amd(*targets, **overrides):
@pytest.mark.parametrize(
- "targets", [("gfx1010",), ("gfx1011",), ("gfx1012",), ("gfx803",), ("gfx1010", "gfx803")]
+ "targets",
+ [("gfx1010",), ("gfx1011",), ("gfx1012",), ("gfx803",), ("gfx90c",), ("gfx1010", "gfx803")],
)
def test_linux_amd_without_rocm_kernels_takes_the_vulkan_route(targets, linux_no_rocm_env):
host = _linux_amd(*targets)
@@ -4160,7 +4161,15 @@ def test_linux_amd_without_rocm_kernels_takes_the_vulkan_route(targets, linux_no
@pytest.mark.parametrize(
- "targets", [("gfx1010", "gfx1100"), ("gfx1100",), ("gfx1030",), ("gfx906",), ("gfx1151",)]
+ "targets",
+ [
+ ("gfx1010", "gfx1100"),
+ ("gfx90c", "gfx1100"),
+ ("gfx1100",),
+ ("gfx1030",),
+ ("gfx906",),
+ ("gfx1151",),
+ ],
)
def test_linux_any_rocm_capable_card_keeps_todays_path(targets, linux_no_rocm_env):
# Vulkan honours no HIP mask, so one ROCm-capable card keeps the whole host on ROCm.
diff --git a/studio/backend/utils/hardware/hardware.py b/studio/backend/utils/hardware/hardware.py
index 416e9a9dbd0..24680392b2d 100644
--- a/studio/backend/utils/hardware/hardware.py
+++ b/studio/backend/utils/hardware/hardware.py
@@ -1136,7 +1136,7 @@ _GPU_NAME_GFX_TABLE: "list[tuple[str, str]]" = [
_ROCM_SUPPORTED_GFX_WINDOWS_ONLY = frozenset({"gfx1010", "gfx1011", "gfx1012", "gfx1153"})
# install_python_stack._LINUX_UNCOVERED_AMD_GFX: the arches the Linux installers leave on CPU torch.
-_LINUX_UNCOVERED_AMD_GFX = _ROCM_SUPPORTED_GFX_WINDOWS_ONLY | {"gfx803"}
+_LINUX_UNCOVERED_AMD_GFX = _ROCM_SUPPORTED_GFX_WINDOWS_ONLY | {"gfx803", "gfx90c"}
# Krackan Point 2 (gfx1153) names overlap the table's gfx1152 row; the Linux installers read them
# first and leave CPU torch on purpose (install_python_stack._LINUX_KRACKAN2_NAME_RE).
diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py
index 8d8c9ffea32..6bf3639dcc1 100644
--- a/studio/install_llama_prebuilt.py
+++ b/studio/install_llama_prebuilt.py
@@ -132,7 +132,7 @@ VULKAN_PREFERRED_GFX_TARGETS = frozenset({"gfx1150", "gfx1151"})
# No ROCm torch wheel and no linux-rocm bundle covers these, so a HIP source build has no
# rocBLAS kernels for them. Mirrors install_python_stack._LINUX_UNCOVERED_AMD_GFX.
-LINUX_NO_ROCM_GFX_TARGETS = frozenset({"gfx1010", "gfx1011", "gfx1012", "gfx803"})
+LINUX_NO_ROCM_GFX_TARGETS = frozenset({"gfx1010", "gfx1011", "gfx1012", "gfx803", "gfx90c"})
# APUs that lead HIP enumeration and shadow a discrete card (#7776). Mirrors
# install_python_stack.py / setup.ps1 (TestShadowingIntegratedGfxParity keeps them in step);
@@ -11106,8 +11106,8 @@ def _should_prefer_vulkan_for_amd_igpu(host: HostInfo) -> bool:
def _should_auto_vulkan_for_amd_linux(host: HostInfo) -> bool:
"""Linux counterpart of _should_auto_vulkan_for_amd_windows: ROCm userspace is installed
- but no AMD GPU here has ROCm kernels (RDNA 1, Polaris), so HIP would source-build into a
- binary that cannot run. Same guards as the integrated-GPU preference, plus an explicit
+ but no AMD GPU here has ROCm kernels (RDNA 1, Polaris, gfx90c), so HIP would source-build
+ into a binary that cannot run. Same guards as the integrated-GPU preference, plus an explicit
HSA_OVERRIDE_GFX_VERSION, which means the user runs this card on ROCm on purpose."""
active = _active_rocm_gfx_target(host)
if not active:
diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py
index 134d504a2a1..e24f822682f 100644
--- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -3353,12 +3353,13 @@ def _gfx_has_a_wheel_route(gfx: "str | None") -> bool:
return bool(gfx) and (gfx in _GENERIC_ROCM_WHEEL_GFX or gfx in _GFX_TO_AMD_INDEX_ARCH)
-# RDNA 1, Polaris and gfx1153 (Krackan Point 2): no Linux index this installer picks carries
-# their kernels (#8529, #11815); the generic wheel loads and faults on first use. gfx1153 is
-# torch-only here: llama.cpp's LINUX_NO_ROCM_GFX_TARGETS keeps its HIP route.
-# install.sh's get_torch_index_url holds the same list.
+# RDNA 1, Polaris, gfx1153 (Krackan Point 2) and gfx90c (Renoir-Barcelo iGPU): no Linux index
+# this installer picks carries their kernels (#8529, #11815); the generic wheel loads and faults
+# on first use. gfx1153 is torch-only here: llama.cpp's LINUX_NO_ROCM_GFX_TARGETS keeps its HIP
+# route. install.sh's get_torch_index_url holds the same list; it and setup.sh mirror the hint.
+_GFX90C_OVERRIDE_HINT = "gfx90c can run ROCm PyTorch's gfx900 kernels: export HSA_OVERRIDE_GFX_VERSION=9.0.0 (also when you start Unsloth Studio) and re-run this installer. Unsloth does not test this."
_LINUX_UNCOVERED_AMD_GFX: "frozenset[str]" = frozenset(
- {"gfx1010", "gfx1011", "gfx1012", "gfx1153", "gfx803"}
+ {"gfx1010", "gfx1011", "gfx1012", "gfx1153", "gfx803", "gfx90c"}
)
@@ -6771,6 +6772,8 @@ def _ensure_rocm_torch() -> "bool | None":
f" AMD {_uncovered}: no ROCm PyTorch wheel Unsloth installs carries kernels for "
f"this GPU -- not installing ROCm torch for it.\n"
)
+ if _uncovered == "gfx90c":
+ _safe_print(f" {_GFX90C_OVERRIDE_HINT}\n")
return
_strix_gfx = _AMD_ARCH_INDEX_FLOOR_GFX
_detected_strix = (
diff --git a/studio/setup.sh b/studio/setup.sh
index a863bf98cc3..bfab9877578 100755
--- a/studio/setup.sh
+++ b/studio/setup.sh
@@ -4663,7 +4663,7 @@ EOF
{ [ -n "$_setup_unsup_hsa" ] || [ -n "${UNSLOTH_ROCM_GFX_ARCH:-}" ] || [ -z "${ROCR_VISIBLE_DEVICES:-}" ]; }; then
_setup_unsup_gfx=$(printf '%s\n' "$_setup_unsup_cur" "$_setup_unsup_inv" | sed 's/:.*$//' \
| tr '[:upper:]' '[:lower:]' \
- | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
+ | awk 'NF { if ($1 !~ /^gfx(1010|1011|1012|1153|803|90c)$/) bad = 1; else if (!seen[$1]++) l = l (l ? ", " : "") $1 }
END { if (!bad && l != "") print l }')
fi
if [ -z "$_setup_unsup_gfx" ] && [ -n "$_setup_gfx" ] && [ -n "$_setup_mkt" ]; then
@@ -4686,6 +4686,9 @@ EOF
else
substep "torch stays CPU-only: Unsloth training and GPU inference are unavailable."
substep "No HIP SDK install and no UNSLOTH_ROCM_GFX_ARCH value gives this GPU one."
+ if [ "$_setup_unsup_gfx" = gfx90c ]; then
+ substep "gfx90c can run ROCm PyTorch's gfx900 kernels: export HSA_OVERRIDE_GFX_VERSION=9.0.0 (also when you start Unsloth Studio) and re-run this installer. Unsloth does not test this."
+ fi
fi
if [ "$_setup_unsup_gfx" = gfx1153 ]; then
substep "GGUF chat keeps the llama.cpp HIP build on this GPU (gfx1153 has one); no Vulkan switch is needed."
diff --git a/tests/studio/install/test_linux_gfx90c_cpu_torch.py b/tests/studio/install/test_linux_gfx90c_cpu_torch.py
new file mode 100644
index 00000000000..0ad3961c60e
--- /dev/null
+++ b/tests/studio/install/test_linux_gfx90c_cpu_torch.py
@@ -0,0 +1,199 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""A lone Linux gfx90c (Renoir-Barcelo iGPU) gets CPU torch; beside a dGPU (#7776) it keeps ROCm."""
+
+from __future__ import annotations
+
+import os
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+
+import pytest
+
+_HERE = Path(__file__).resolve().parent
+PACKAGE_ROOT = _HERE.parents[2]
+sys.path.insert(0, str(_HERE))
+sys.path.insert(0, str(PACKAGE_ROOT / "tests" / "_shared"))
+
+import test_missing_kernel_arch_routing_9396 as routing # noqa: E402
+import test_uncovered_amd_read_arch_linux_8529 as read_arch # noqa: E402
+import test_unsupported_arch_routing_guards_8529 as guards # noqa: E402
+
+stack_mod = routing.stack_mod
+_INSTALL_SH = PACKAGE_ROOT / "install.sh"
+_POSIX = pytest.mark.skipif(
+ os.name == "nt" or shutil.which("bash") is None, reason = "POSIX shell only"
+)
+
+# Trimmed from a real Ryzen 7 5700G rocminfo: the GPU agent names gfx90c twice.
+_ROCMINFO_GFX90C = """\
+*******
+Agent 2
+*******
+ Name: gfx90c
+ Marketing Name: AMD Radeon Graphics
+ Device Type: GPU
+ Name: amdgcn-amd-amdhsa--gfx90c:xnack-
+"""
+_ROCMINFO_GFX1100 = """\
+*******
+Agent 3
+*******
+ Name: gfx1100
+ Marketing Name: AMD Radeon RX 7900 XTX
+ Device Type: GPU
+ Name: amdgcn-amd-amdhsa--gfx1100
+"""
+
+
[email protected](autouse = True)
+def _reset_probe(monkeypatch):
+ for name in (
+ "HSA_OVERRIDE_GFX_VERSION",
+ "ROCR_VISIBLE_DEVICES",
+ "HIP_VISIBLE_DEVICES",
+ "UNSLOTH_ROCM_GFX_ARCH",
+ ):
+ monkeypatch.delenv(name, raising = False)
+ stack_mod._invalidate_torch_runtime_probe()
+ yield
+ stack_mod._invalidate_torch_runtime_probe()
+
+
+def _rocminfo_harness(monkeypatch, tmp_path, rocminfo: str):
+ """The real _probe_amd_gfx_arch over a fake rocminfo on PATH, instead of the arch stub."""
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ (bin_dir / "rocminfo.txt").write_text(rocminfo, encoding = "utf-8")
+ fake = bin_dir / "rocminfo"
+ fake.write_text(f"#!/bin/sh\ncat '{bin_dir / 'rocminfo.txt'}'\n", encoding = "utf-8")
+ fake.chmod(0o755)
+ monkeypatch.setenv("PATH", f"{bin_dir}{os.pathsep}{os.environ['PATH']}")
+ src = _INSTALL_SH.read_text(encoding = "utf-8")
+ real = guards._INDEX_URL_STUBS
+ stub = (
+ "_probe_amd_gfx_arch() { printf '%s\\n' \"${UNSLOTH_ROCM_GFX_ARCH:-}\" "
+ "| tr '[:upper:]' '[:lower:]'; }"
+ )
+ assert stub in real, "probe stub not found"
+ monkeypatch.setattr(
+ guards,
+ "_INDEX_URL_STUBS",
+ real.replace(
+ stub,
+ "_ensure_rocm_probe_env() { :; }\n_kfd_gfx_targets() { return 1; }\n"
+ + guards._sh_function_body(src, "_probe_amd_gfx_arch"),
+ ),
+ )
+
+
+@_POSIX
[email protected]("tag", ["rocm7.2", "rocm6.4"])
+def test_install_sh_lone_gfx90c_takes_cpu_with_the_vulkan_hint(monkeypatch, tmp_path, tag):
+ _rocminfo_harness(monkeypatch, tmp_path, _ROCMINFO_GFX90C)
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = tag)
+ assert url.endswith("/cpu"), (url, err)
+ assert "AMD GPU detected (gfx90c) -- Unsloth has no ROCm PyTorch wheels" in err, err
+ assert "export UNSLOTH_LLAMA_CPP_BACKEND=vulkan and re-run this installer" in err, err
+ assert "TheRock" not in err, err
+ assert "export HSA_OVERRIDE_GFX_VERSION=9.0.0" in err, err
+
+
+@_POSIX
+def test_install_sh_gfx90c_beside_a_dgpu_keeps_the_generic_tag(monkeypatch, tmp_path):
+ _rocminfo_harness(monkeypatch, tmp_path, _ROCMINFO_GFX90C + _ROCMINFO_GFX1100)
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/rocm7.2"), (url, err)
+ assert "no ROCm PyTorch wheels" not in err, err
+
+
+@_POSIX
+def test_install_sh_gfx90c_under_a_gfx900_spoof_keeps_rocm(monkeypatch, tmp_path):
+ _rocminfo_harness(monkeypatch, tmp_path, _ROCMINFO_GFX90C)
+ monkeypatch.setenv("HSA_OVERRIDE_GFX_VERSION", "9.0.0")
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/rocm7.2"), (url, err)
+
+
[email protected]("ver", [(6, 4), (7, 2)])
+def test_python_lone_gfx90c_gets_no_kernel_less_rocm_torch(ver):
+ calls = routing._run_install(gfx_devices = ("gfx90c",), rocm_version = ver)
+ assert "download.pytorch.org" not in calls and "repo.amd.com" not in calls, calls
+ assert "AMD gfx90c: no ROCm PyTorch wheel" in routing._run_install.printed
+
+
+def test_python_gfx90c_beside_a_dgpu_keeps_the_dgpu_route():
+ calls = routing._run_install(gfx_devices = ("gfx90c", "gfx1100"), rocm_version = (7, 2))
+ assert "download.pytorch.org/whl/rocm7.2" in calls, calls
+
+
+def test_python_gfx90c_spoofed_to_gfx900_keeps_rocm():
+ calls = routing._run_install(
+ gfx_devices = ("gfx90c",),
+ rocm_version = (7, 2),
+ env = {"HSA_OVERRIDE_GFX_VERSION": "9.0.0"},
+ )
+ assert "download.pytorch.org/whl/rocm7.2" in calls, calls
+
+
+@_POSIX
+def test_install_sh_rerun_keeps_an_existing_rocm_build_on_gfx90c(monkeypatch, tmp_path):
+ _rocminfo_harness(monkeypatch, tmp_path, _ROCMINFO_GFX90C)
+ monkeypatch.setenv("_PREV_TORCH_VER", "2.11.0+rocm7.2")
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/rocm7.2"), (url, err)
+ assert "Keeping ROCm PyTorch on gfx90c" in err, err
+ assert "installing CPU PyTorch" not in err, err
+
+
+@_POSIX
[email protected]("prev", ["2.11.0+cpu", "2.11.0", ""])
+def test_install_sh_a_non_rocm_previous_torch_still_takes_cpu_on_gfx90c(
+ monkeypatch, tmp_path, prev
+):
+ _rocminfo_harness(monkeypatch, tmp_path, _ROCMINFO_GFX90C)
+ monkeypatch.setenv("_PREV_TORCH_VER", prev)
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/cpu"), (url, err)
+
+
+@_POSIX
+def test_install_sh_an_existing_rocm_build_does_not_keep_rocm_for_other_uncovered_arches(
+ monkeypatch, tmp_path
+):
+ rocminfo = _ROCMINFO_GFX90C.replace("gfx90c", "gfx1010")
+ _rocminfo_harness(monkeypatch, tmp_path, rocminfo)
+ monkeypatch.setenv("_PREV_TORCH_VER", "2.11.0+rocm7.2")
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/cpu"), (url, err)
+
+
+_OVERRIDE_HINT = "export HSA_OVERRIDE_GFX_VERSION=9.0.0"
+
+
+@_POSIX
+def test_install_sh_other_uncovered_arches_get_no_gfx900_hint(monkeypatch, tmp_path):
+ rocminfo = _ROCMINFO_GFX90C.replace("gfx90c", "gfx1010").replace(
+ "AMD Radeon Graphics", "AMD Radeon RX 5700 XT"
+ )
+ _rocminfo_harness(monkeypatch, tmp_path, rocminfo)
+ url, err = guards._run_sh_get_torch_index_url("", rocm_tag = "rocm7.2")
+ assert url.endswith("/cpu"), (url, err)
+ assert _OVERRIDE_HINT not in err, err
+
+
+@_POSIX
[email protected]("gfx,hint", [("gfx90c", True), ("gfx1010", False), ("gfx803", False)])
+def test_setup_sh_names_the_gfx900_override_for_gfx90c_only(gfx, hint):
+ out = read_arch._setup_report(gfx, gfx, "")
+ assert f"AMD GPU detected ({gfx}) -- no ROCm PyTorch wheels" in out, out
+ assert (_OVERRIDE_HINT in out) is hint, out
+
+
[email protected]("gfx,hint", [("gfx90c", True), ("gfx1010", False)])
+def test_python_names_the_gfx900_override_for_gfx90c_only(gfx, hint):
+ routing._run_install(gfx_devices = (gfx,), rocm_version = (7, 2))
+ assert (_OVERRIDE_HINT in routing._run_install.printed) is hint, routing._run_install.printed
diff --git a/tests/studio/install/test_uncovered_amd_read_arch_linux_8529.py b/tests/studio/install/test_uncovered_amd_read_arch_linux_8529.py
index e4091dbb247..c25d58b5ec0 100644
--- a/tests/studio/install/test_uncovered_amd_read_arch_linux_8529.py
+++ b/tests/studio/install/test_uncovered_amd_read_arch_linux_8529.py
@@ -34,7 +34,7 @@ stack_mod = routing.stack_mod
_INSTALL_SH = PACKAGE_ROOT / "install.sh"
_SETUP_SH = PACKAGE_ROOT / "studio" / "setup.sh"
-_UNCOVERED = ("gfx1010", "gfx1011", "gfx1012", "gfx1153", "gfx803")
+_UNCOVERED = ("gfx1010", "gfx1011", "gfx1012", "gfx1153", "gfx803", "gfx90c")
_POSIX = pytest.mark.skipif(
os.name == "nt" or shutil.which("bash") is None, reason = "POSIX shell only"
)
@@ -64,7 +64,7 @@ def test_no_uncovered_arch_has_a_wheel_route():
def test_the_shell_copies_name_the_same_arches():
want = "gfx(" + "|".join(sorted(g[3:] for g in _UNCOVERED)) + ")"
for path in (_INSTALL_SH, _SETUP_SH):
- found = re.findall(r"\$1 !~ /\^(gfx\([0-9|]+\))\$/", path.read_text(encoding = "utf-8"))
+ found = re.findall(r"\$1 !~ /\^(gfx\([0-9a-f|]+\))\$/", path.read_text(encoding = "utf-8"))
assert found, f"{path.name}: uncovered-arch filter not found"
for f in found:
got = "gfx(" + "|".join(sorted(f[4:-1].split("|"))) + ")"