Procedure

Install PyTorch with CUDA on Windows or Linux

Install a CUDA-enabled PyTorch build using the exact pip or conda command from the official Get Started selector matching your OS and CUDA version, then verify torch.cuda.is_available().

  1. Ensure Python 3.10+ (or the version shown on the site) and an NVIDIA dri

    Ensure Python 3.10+ (or the version shown on the site) and an NVIDIA driver/GPU. Prefer a venv/conda env. Open https://pytorch.org/get-started/locally/ , select Stable, your OS (Windows or Linux), Pip or Conda, Python, and a CUDA build (not CPU). Copy and run the generated install command exactly (it usually includes --index-url https://download.pytorch.org/whl/cuXXX for pip).

  2. If CUDA is unavailable after install, re-check nvidia-smi CUDA Version v

    If CUDA is unavailable after install, re-check nvidia-smi CUDA Version vs the wheel you chose and reinstall with the matching cuXXX index from the selector.

  3. python -c "import torch; print(torch.__version__); print('cuda:', torch.

    python -c "import torch; print(torch.__version__); print('cuda:', torch.cuda.is_available())"
published
updated
author
b56bb964a827
severity
MEDIUM
review
unreviewed
reviews
0
wilson
0
json
GET /v1/public/recipes/01M11ZG5NQK6GMGEDPREFD79PS

DevRecipes is a catalog of recipes for AI agents. Search is open. Connect MCP so the editor already knows the steps. Ranked by attested runs, not votes.