# GPU PyTorch install rules for desktop launchers (NVIDIA, Windows/Linux) Use when reviewing or briefing launcher/installer code that installs PyTorch for an NVIDIA card, or when triaging "generation always fails on my RTX laptop". ## Decision table (verify against download.pytorch.org/whl//torch/ before relying on it) | Card | Driver | Tag | |---|---|---| | Blackwell / RTX 50xx (compute capability >= 12.0, sm_120) | >= 580 | cu130 | | Blackwell / RTX 50xx | 570-579 | cu128 | | Blackwell / RTX 50xx | < 570 | none -> "update driver" | | Turing+ (cc >= 7.5) | >= 580 | cu130 | | older or driver 525-579 (non-Blackwell) | >= 525 | cu126 | | any | < 525 | none -> "update driver" | cu126 wheels contain no Blackwell kernels (PyTorch maintainers: "use 12.8 or 13.0 builds"). When `nvidia-smi` cannot report `compute_cap`, fall back to the card name ("RTX 50") to detect Blackwell. ## Review checklist 1. **One source of truth.** The tag decision lives in one Python module (stdlib-only, never imports torch in-process because Windows locks torch DLLs during reinstall); `.bat`/`.sh` launchers call its CLI (e.g. `--onerilen-etiket`, `--cuda-dogrula`) instead of hard-coding an index URL. Grep every launcher path (first install, update/sync, startup repair): `git grep -n "cu12[0-9]\|cu13[0-9]\|is_available" ` must show no hard-coded tag and no `is_available`-only decision. 2. **Kernel test, not availability.** `torch.cuda.is_available()` only checks driver/context and returns True on a build without kernels for the card. Run a real op in a subprocess (`torch.ones(8, device="cuda")*2`, small matmul, `torch.cuda.synchronize()`) before declaring GPU OK, and use the same test wherever the launcher "protects" an existing CUDA build during package sync — otherwise a broken build gets pinned. 3. **Pin with the local tag.** Install as `torch==X+cuNNN`; `pip install -r requirements.txt` with `torch>=…` (no `--upgrade`) leaves an installed CUDA torch alone, but a `>=` spec in a repair command will not replace a CPU/wrong-tag build. 4. **Version the one-shot marker files.** A "GPU repair attempted" marker written by an old release blocks a fixed repair from ever running on existing installs; rename/version the marker (or store the attempted tag in it) and write it next to the active env marker (python-embed vs `.venv`), not a hard-coded folder that may not exist. 5. **Runtime fallback.** On CUDA errors at generation (no kernel image, CUDA OOM, cuBLAS/cuDNN), reload the model on CPU once (pass `device="cpu"` to the model loader; `CUDA_VISIBLE_DEVICES` is too late once torch initialized CUDA), show one clear notice, retry once, and never retry GPU in the same session. 6. **VRAM.** Large TTS models need ~8 GB VRAM in bf16; laptop cards with 4-6 GB will OOM even with the right tag — treat as a separate hypothesis and ask for `nvidia-smi` memory. ## Evidence to request from the user's machine `nvidia-smi --query-gpu=name,driver_version,compute_cap,memory.total --format=csv,noheader`, the app log before relaunch, and the launcher line that printed the chosen tag.