From 8c797daa98495b62b69b6ebc7d618f5a2a2053bf Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 2 Jun 2026 23:50:01 -0700 Subject: [PATCH] install.ps1: fix WSL-fallback probe false-positive (match torch spec) The native-CUDA-torch viability probe used a bare 'uv pip install --dry-run torch', but the real native install pins 'torch>=2.4,<2.11.0'. The cu130 index can carry an out-of-range torch (e.g. <2.4 or a >2.11 nightly) with a win_arm64 wheel, so the bare probe PASSED while the pinned install FAILED -> the WSL fallback was skipped and the install died at 'Failed to install PyTorch' on Windows-on-ARM. Use the same pinned spec in the probe so its result exactly predicts the native install. Co-Authored-By: Claude Opus 4.8 --- install.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 0f7cd7de8a..7f93ac6b2b 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1470,9 +1470,13 @@ shell.Run cmd, 0, False $_nativeCudaTorchOk = $false if ($_winArm64 -and $HasNvidiaSmi -and (-not $SkipTorch)) { # Future-proof check: can a CUDA-capable torch wheel be resolved natively for this platform/index? + # MUST use the SAME spec as the real native install below ("torch>=2.4,<2.11.0"). A bare `torch` + # probe is too loose -- the cu130 index can carry an out-of-range version (e.g. torch<2.4 or a + # nightly >2.11) whose win_arm64 wheel makes the dry-run pass, giving a FALSE POSITIVE that skips + # the WSL fallback and then fails the real install at the pinned range. $prevEapProbe = $ErrorActionPreference; $ErrorActionPreference = "Continue" try { - & uv pip install --python $VenvPython --dry-run torch --index-url $TorchIndexUrl *> $null + & uv pip install --python $VenvPython --dry-run "torch>=2.4,<2.11.0" --index-url $TorchIndexUrl *> $null $_nativeCudaTorchOk = ($LASTEXITCODE -eq 0) } catch { $_nativeCudaTorchOk = $false } finally { $ErrorActionPreference = $prevEapProbe } if ($_nativeCudaTorchOk) { step "gpu" "native CUDA PyTorch now available for win_arm64 -- keeping native install" "Green" }