The error means the PyTorch you imported was built without CUDA, so the GPU is invisible to it however healthy nvidia-smi looks.
AssertionError: Torch not compiled with CUDA enabled
PyTorch raises it from the CUDA module of its source when its torch._C module has no CUDA bindings. In the same file, torch.cuda.is_available() returns False for that reason too (source checked 1 October 2026).
Check which build you imported
python -c "import sys, torch; print(sys.executable); print(torch.__file__); print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
If torch.version.cuda prints None, the build has no CUDA. A +cpu at the end of the version marks PyTorch's CPU wheels. If it prints a CUDA version and is_available() is still False, you have a different problem. The source says is_available() never throws and returns False when the driver is missing or cannot start, so look at the NVML mismatch page, the toolkit guide for containers, or CUDA_VISIBLE_DEVICES.
A CPU-only wheel is installed
Rule this out first. PyTorch's selector builds its commands in the browser, so I read its data file in the pytorch.github.io repository. For PyTorch 2.14.1, the latest release on 1 October 2026, one CUDA row uses the plain pip3 install torch torchvision, and only the CPU row carries --index-url https://download.pytorch.org/whl/cpu. One way a CPU wheel gets onto a GPU VM is that CPU index, copied from the selector with CPU chosen or inherited from a requirements file or Dockerfile written for a laptop. Remove it and install the CUDA build:
python -m pip uninstall -y torch torchvision torchaudio
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
The cu126 index above is one example. The same data file lists these Linux pip commands for 2.14.1:
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126
pip3 install torch torchvision
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu132
Those are the CUDA 12.6, 13.0 and 13.2 rows. Pick the row at or below the CUDA version in the nvidia-smi header, the same rule as for container images. NVIDIA's compatibility guide puts the floor at driver 580 for CUDA 13.x, so a VM whose header shows 12.8 needs an older build. The cu128 index holds PyTorch up to 2.11.0 and cu129 up to 2.13.0, per their index pages on that date. PyTorch added Blackwell support with CUDA 12.8 builds in its 2.7 release, so a B200 or RTX PRO 6000 needs 12.8 or newer. If a build lacks your card, PyTorch warns that its CUDA capability is not compatible with the current installation, and the fix is a newer row. The install guide covers the whole choice. Then verify:
python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
It should print a CUDA version and True.
You are in a different Python environment than the one you fixed
pip and python can belong to different interpreters, and a notebook kernel can use a third. Use python -m pip so the installer matches the interpreter that runs your code, and activate your virtual environment before both. The first command above prints sys.executable and the path of the torch it imported, which settles which environment you are in. In JupyterLab or a notebook, install from a cell with %pip install and restart the kernel, because IPython's magics documentation says %pip runs pip within the current kernel.
Another package replaced your torch
An install that ran after your fix can swap in a CPU wheel, for example a requirements file that carries the CPU index or pins a +cpu version. Check with python -m pip list | grep -i -E "^torch", and reinstall the CUDA build as above. To stop it recurring, record the working versions and give them to pip as constraints, which pip's user guide says control which version is installed without triggering an install:
python -m pip freeze | grep -E '^(torch|torchvision|torchaudio)==' > constraints.txt
python -m pip install -c constraints.txt -r requirements.txt
A ComfyUI custom node's requirements can do the same, and the ComfyUI guide shows how to read the PyTorch version the image carries.
Skip the install on the Jupyter template
The PyTorch + Jupyter template runs quay.io/jupyter/pytorch-notebook:cuda12-latest, with PyTorch built for CUDA 12 already in place. Run the check from the first section in a cell before you trust it, especially on a Blackwell card. The first five minutes guide has the other checks for a new VM.
When to contact support
Email support@deploygpu.ai if torch.version.cuda prints a CUDA version, nvidia-smi works on the VM, and torch.cuda.is_available() is still False after the steps above. Send the output of the first command, the nvidia-smi header and the provider. The contact page is the other way in.
Frequently asked questions
Why does nvidia-smi work but PyTorch says it was not compiled with CUDA?
nvidia-smi talks to the driver, while PyTorch only sees the GPU if the installed wheel was built with CUDA. A CPU-only wheel ignores a healthy driver.
How do I tell a CPU wheel from a CUDA wheel?
Print torch.version.cuda. None means no CUDA. The version string of a CPU wheel also ends in plus cpu, since PyTorch publishes those wheels on its CPU index.
Which PyTorch wheel should I install on a Blackwell GPU?
One built with CUDA 12.8 or newer, which is where PyTorch 2.7 added Blackwell support. Pick the row from the selector that your driver supports, and check the nvidia-smi header first.
Why did the error return after I installed another package?
The package or its requirements file pulled in a CPU build of torch. Reinstall the CUDA wheel and use a constraints file so later installs keep your versions.