You've got an NVIDIA graphics card, you've installed PyTorch, and then torch.cuda.is_available() prints False. Your AI app, training script or image generator quietly falls back to the CPU and runs painfully slowly. It's one of the most common problems when setting up local AI on a PC, and it almost always comes down to one of a handful of causes: the wrong PyTorch build, an out-of-date driver, the wrong Python environment, or a WSL setup mistake. This guide walks through them in order, from quickest check to least likely. It's based on PyTorch's and NVIDIA's documentation.
If you haven't installed PyTorch yet, start with how to install PyTorch with CUDA on Windows instead, and come back here if it doesn't work.
What the check actually tells you
PyTorch's documentation describes torch.cuda.is_available() simply: it returns a bool indicating whether CUDA is currently available. If it's False, PyTorch can't see a usable NVIDIA GPU, so everything runs on the CPU. PyTorch's own install guide uses this same line to verify a GPU install, so it's the right test to repeat after each fix below.
Open a terminal in the same environment your app uses and run:
python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
That prints three things: the PyTorch version, the CUDA version PyTorch was built with, and whether a GPU is available.
Step 1: Check you haven't installed the CPU-only build
This is the most common cause. PyTorch is published in separate builds for each compute platform, and the install selector on pytorch.org offers CUDA versions, ROCm and a CPU option. Choosing the CPU option, or installing from a package source that only offers CPU builds, leaves you with a build that has no CUDA support at all.
A CPU-only build gives itself away: the check prints a version ending in +cpu (for example 2.15.0+cpu), torch.version.cuda shows None, and is_available() returns False. If you see that, no driver fix will help: you need to reinstall the CUDA build.
Uninstall the current packages: pip uninstall torch torchvision torchaudio
Go to the Get Started page on pytorch.org, choose your OS, Pip, Python and a CUDA compute platform.
Run the exact command the selector gives you. CUDA builds are installed from PyTorch's own package index (download.pytorch.org/whl/ followed by the CUDA version), which is why that index URL appears in the command.
Then run the check again.
Step 2: Make sure you're using the right Python environment
If you've installed the CUDA build but still get +cpu or an import error, you're probably checking a different Python install. This is easy to do on Windows, where you might have Python from python.org, the Microsoft Store, Anaconda and an app's bundled copy all at once.
Run python -c "import sys; print(sys.executable)" to see which interpreter you're actually using.
If your app uses a virtual environment, activate it first, then run the check.
Many local AI apps ship their own Python. In that case, install or update PyTorch inside that app's environment, following its instructions.
Also check your Python version is supported. PyTorch's Windows instructions currently say PyTorch on Windows supports Python 3.10 to 3.14, and the page notes that the latest stable PyTorch requires Python 3.11 or later. With an unsupported Python version, pip may not find a matching CUDA build.
Step 3: Update your NVIDIA driver
PyTorch's pip instructions only ask you to choose the CUDA version suited to your machine in the selector; installing the CUDA toolkit is listed as a prerequisite only when you build PyTorch from source. What you do need for any CUDA build is a new enough NVIDIA driver. NVIDIA's CUDA release notes explain that each CUDA version needs a minimum driver: under minor version compatibility, CUDA 12.x needs driver 525 or later and CUDA 13.x needs driver 580 or later. Newer drivers stay backwards compatible with applications built for older CUDA versions.
So if torch.version.cuda shows a CUDA version but is_available() is still False, check your driver:
Run nvidia-smi in a terminal. If it isn't found, or reports that it can't communicate with the driver, the driver isn't installed or loaded properly.
Compare the driver version against the CUDA version your PyTorch build uses. Our guide on how to check your CUDA version on Windows shows where to find both.
Install the latest driver for your card; see how to update graphics drivers. If a normal update doesn't help, a clean reinstall using DDU often does.
Restart the PC after a driver change, then run the check again.
Step 4: Check your GPU is supported by your PyTorch build
Very old NVIDIA cards may not be supported by the CUDA version current PyTorch builds use. If your card is several generations old, check its CUDA compute capability against the requirements of the build you're installing; our explainer on what CUDA compute capability is explains how. If your card falls outside what current builds support, you may need an older PyTorch release, which PyTorch lists on its previous versions page.
If you have an AMD Radeon card, CUDA builds won't work at all, because CUDA is NVIDIA-only. PyTorch offers separate ROCm builds; see how to install PyTorch with ROCm on Windows or, on Linux, how to install ROCm on Ubuntu. PyTorch's install guide notes that the same torch.cuda calls are used to check ROCm, so the check above still applies.
Step 5: If you're using WSL 2, don't install a Linux driver
WSL 2 is a popular way to run Linux AI tools on Windows, and it has its own common trap. NVIDIA's CUDA on WSL guide says you should install the normal NVIDIA GeForce or RTX driver on Windows only, and that this is the only driver you need. Inside WSL, the Windows driver is made available as libcuda.so, and NVIDIA warns that installing a Linux NVIDIA driver inside WSL (such as the cuda-drivers or nvidia-open packages) overwrites the driver mapped in from Windows.
If is_available() is False inside WSL:
Run nvidia-smi inside WSL. If it doesn't work there, the problem is the WSL setup, not PyTorch.
Remove any NVIDIA Linux driver packages you installed inside WSL.
Update WSL with wsl.exe --update from Windows, as NVIDIA's guide recommends. Microsoft's guide adds that you need a WSL kernel version of 5.10.43.3 or later.
Install the Linux CUDA build of PyTorch inside WSL and run the check again.
Our full guide to setting up WSL 2 with GPU support for local AI covers this in more detail.
Step 6: Check for laptop and multi-GPU issues
On a laptop with both integrated graphics and an NVIDIA GPU, make sure the NVIDIA GPU is enabled in Device Manager and hasn't been disabled by a power-saving mode in the manufacturer's control software. On any PC, look in Device Manager under Display adapters for a warning icon on the NVIDIA card, which points to a driver or hardware problem rather than PyTorch.
When CUDA works but something else fails
Once is_available() returns True, a different set of problems can appear. If you get errors about running out of memory, see how to fix CUDA out of memory errors. If you're running language models with Ollama rather than PyTorch, use how to check Ollama is using your GPU instead, as Ollama doesn't depend on your PyTorch install.
Our verdict
When torch.cuda.is_available() returns False, check the build first: if the version ends in +cpu, reinstall using the CUDA command from pytorch.org's selector. If you have a CUDA build, make sure you're testing the right Python environment, then update the NVIDIA driver so it meets the minimum for your build's CUDA version. In WSL 2, use only the Windows driver and never install a Linux NVIDIA driver inside WSL. Those steps fix the vast majority of cases.