Fix CUDA build: use PyTorch CUDA index URL explicitly
Some checks failed
Release / Bump version and tag (push) Successful in 15s
Release / Build (macOS) (push) Successful in 5m11s
Release / Build (Windows) (push) Failing after 14m6s
Release / Build (Linux) (push) Has been cancelled

Default torch on PyPI is CPU-only on Windows. Must use PyTorch's own
package index (cu126) to get CUDA-enabled wheels. This also pins the
CUDA version on Linux for deterministic builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-22 06:14:23 -07:00
parent 5311b19fdc
commit 5f9f1426e6

View File

@@ -119,8 +119,11 @@ def create_venv_and_install(cpu_only: bool) -> Path:
"--index-url", "https://download.pytorch.org/whl/cpu", "--index-url", "https://download.pytorch.org/whl/cpu",
) )
else: else:
print("[build] Installing PyTorch (default, may include CUDA)") print("[build] Installing PyTorch (CUDA 12.6)")
pip_install("torch", "torchaudio") pip_install(
"torch", "torchaudio",
"--index-url", "https://download.pytorch.org/whl/cu126",
)
# Install project and dev deps (includes pyinstaller) # Install project and dev deps (includes pyinstaller)
print("[build] Installing project dependencies") print("[build] Installing project dependencies")