From 84a9c55e1b86c06a8fd8430fda0763c3202eeb5f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 5 Apr 2026 03:28:16 +0000 Subject: [PATCH] Fix critical: initialize _amd_gpu_radeon before case block _amd_gpu_radeon was only set inside the */rocm*) case arm, so on NVIDIA/CPU/macOS paths where TORCH_INDEX_URL does not contain "rocm", the variable was unbound. With set -u (nounset) enabled, this crashes the installer for every non-AMD user. Move initialization to before the case block so it is always defined. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 624eb108ac..7a123f5246 100755 --- a/install.sh +++ b/install.sh @@ -1159,9 +1159,9 @@ TORCH_INDEX_URL=$(get_torch_index_url) # Auto-detect GPU for AMD ROCm based # get_torch_index_url must have chosen */rocm* # (gfx in rocminfo or amd-smi list). Then require rocminfo "Marketing Name:.*Radeon". +_amd_gpu_radeon=false case "$TORCH_INDEX_URL" in */rocm*) - _amd_gpu_radeon=false if _has_amd_rocm_gpu && command -v rocminfo >/dev/null 2>&1 && \ rocminfo 2>/dev/null | grep -q 'Marketing Name:.*Radeon'; then _amd_gpu_radeon=true