Free | No tracking | Every fact with a source|German and English

Error / Installation

Torch not compiled with CUDA enabled

A PyTorch version without graphics card support is installed in your Python environment, only for the processor.

The message

AssertionError: Torch not compiled with CUDA enabled

Affects: ComfyUI

Why is this happening?

PyTorch comes in separate variants for CPU, NVIDIA (CUDA), AMD (ROCm), and Intel (XPU). If you manually install with pip install torch or pip install -r requirements.txt without the PyTorch index, Windows often gets the pure CPU version. On Intel graphics cards, the error also appears when a program expects CUDA even though Intel XPU is being used.

How to fix it

  1. Check the installed version. Portable: .\python_embeded\python.exe -c "import torch; print(torch.__version__, torch.cuda.is_available())". Manual (venv activated): python -c "import torch; print(torch.__version__, torch.cuda.is_available())". If it says +cpu or False, the wrong variant is installed.
  2. Manual installation with an NVIDIA card: Activate your venv (comfyui_env\Scripts\activate), then pip uninstall torch torchvision torchaudio and after that pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130.
  3. Portable version: Open a terminal in the ComfyUI_windows_portable folder (right-click in the empty folder area → “Open in Terminal”). Then run .\python_embeded\python.exe -m pip uninstall -y torch torchvision torchaudio and .\python_embeded\python.exe -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130. If you use the package for GTX-10 cards and older (cu126), install the last matching version instead: .\python_embeded\python.exe -m pip install "torch==2.14.*" "torchvision==0.29.*" "torchaudio==2.14.*" --index-url https://download.pytorch.org/whl/cu126 (PyTorch 2.14 is the last version with cu126 packages).
  4. Desktop app: Open Manage → Update and, under “PyTorch,” use “Change PyTorch” to switch back to the official NVIDIA stack.
  5. Intel graphics card: Do not install CUDA. In the activated venv, use pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu (Portable: .\python_embeded\python.exe -m pip …) or use the Intel Portable package from ComfyUI directly.
  6. Then check again with the command from step 1 whether True appears.

Better not: Do not install NVIDIA’s large CUDA Toolkit to fix this error. PyTorch brings the required CUDA libraries with it; only the correct PyTorch variant is missing.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.