Fix CUDA build: use PyTorch CUDA index URL explicitly
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:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user