PyTorch is the machine-learning library behind a huge number of local AI projects, from image generators to speech and research scripts. If you install it without choosing a GPU build, or with one that doesn't support your card, it will either run slowly on the CPU or fail to use the GPU at all. This guide follows PyTorch's own Windows install instructions, with notes from NVIDIA and the Python documentation. Forge PC hasn't tested every combination of card, driver and PyTorch build, so always use the command PyTorch's selector gives you on the day.
Before you start
An NVIDIA graphics card. PyTorch says an NVIDIA GPU is recommended but not required on Windows if you want to use its CUDA support. AMD and Intel cards use different builds; see the note at the end.
A current NVIDIA driver. Update it first with our graphics driver guide. NVIDIA's nvidia-smi tool, which is installed with the driver, is a quick way to confirm the driver can see your card: open Terminal and type nvidia-smi.
Free drive space. PyTorch, its GPU libraries and the AI models you'll run with it all need room on your SSD. Our disk space guide can help.
Step 1: Install Python
PyTorch's Windows notes say it supports Python 3.10 to 3.14 and that Python 2 isn't supported, and the selector on the same page notes that the latest stable PyTorch requires Python 3.11 or later. So install Python 3.11 or newer, from the Python website or another method PyTorch lists, and pip comes with it.
Step 2: Create a virtual environment
A virtual environment keeps PyTorch and its dependencies separate from other Python projects, which the Python documentation describes as isolating a project's libraries from those installed for the system. In Terminal, go to your project folder and run:
python -m venv .venv
.venv\Scripts\Activate.ps1
If you use the older Command Prompt instead of PowerShell, the activation script is .venv\Scripts\activate.bat. If PowerShell refuses to run the script, the Python docs say you may need to allow it with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.
Step 3: Get the right command from PyTorch's selector
Go to PyTorch's Start Locally page and choose:
PyTorch Build: Stable.
Your OS: Windows.
Package: Pip.
Language: Python.
Compute Platform: a CUDA version. PyTorch's guidance is to pick the CUDA version suited to your machine, and that the latest is often better.
The page then shows a command of the form pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/.... Copy and run that exact command inside your activated environment.
RTX 50 series owners: PyTorch added support for NVIDIA's Blackwell architecture in PyTorch 2.7 (initially flagged as a prototype feature), with pre-built wheels for CUDA 12.8. NVIDIA lists RTX 50 cards with CUDA compute capability 12.0, so choose a CUDA 12.8 or newer build rather than an older CUDA option.
PyTorch's instructions for a pip install don't include installing NVIDIA's separate CUDA Toolkit; the toolkit is listed as a prerequisite for building PyTorch from source. NVIDIA's own CUDA install guide is aimed at developers compiling CUDA applications.
Step 4: Check that PyTorch can see your GPU
PyTorch's verification step is to start Python and run:
import torch
x = torch.rand(5, 3)
print(x)
print(torch.cuda.is_available())
The first print should show a small table of random numbers. The last line should print True. If it prints False, PyTorch can't use your NVIDIA GPU. Common causes include installing the CPU-only build (the plain pip install torch without the CUDA index URL), an outdated driver, or running Python from outside the virtual environment. Reinstall with the selector's CUDA command and try again.
To see how much graphics memory your models are using once they're running, use our VRAM usage guide.
AMD and Intel graphics
PyTorch's Windows instructions cover CUDA and CPU builds, while its ROCm builds for AMD GPUs are listed for Linux. If you have a Radeon card, see our guide to local AI on AMD Radeon GPUs or consider running Linux tools under WSL2. Intel Arc owners should see our Intel Arc local AI guide.
Some AI apps, such as the ComfyUI desktop app, manage their own Python environment, so you may not need a separate install; see our ComfyUI install guide if that's all you need.
Our verdict
Update your NVIDIA driver, install Python 3.11 or newer, create a virtual environment, and install PyTorch with the exact CUDA command from PyTorch's Start Locally selector. RTX 50 owners need a CUDA 12.8 or newer build. Then check torch.cuda.is_available() returns True. Forge PC hasn't tested every card and build; PyTorch's selector is the authority on current versions.