AssertionError: Torch not compiled with CUDA enabled after running update_comfyui_and_python_dependencies.bat
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
### Custom Node Testing
- [ ] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
After successfully running update\update_comfyui_and_python_dependencies.bat and letting it fully complete, I expect to be able to launch ComfyUI using run_nvidia_gpu.bat without any errors, just like before the update.
### Actual Behavior
After running update\update_comfyui_and_python_dependencies.bat as administrator and allowing it to complete successfully, ComfyUI can no longer start with GPU acceleration.
When I launch using run_nvidia_gpu.bat, it immediately crashes with the following error:
AssertionError: Torch not compiled with CUDA enabled
### Steps to Reproduce
1. Run update\update_comfyui_and_python_dependencies.bat
2. Launch ComfyUI by double-clicking run_nvidia_gpu.bat.
3. ComfyUI immediately crashes with the error: text Assertion Error: Torch not compiled with CUDA enabled
4. The program fails to start and displays the following error in the console: AssertionError: Torch not compiled with CUDA enabled
5. To try fixing it, open a command prompt in the ComfyUI_windows_portable directory and manually reinstall PyTorch with different CUDA versions
### Debug Logs
```powershell
Traceback (most recent call last):
File "C:\Users\User\Documents\ComfyUI_windows_portable\ComfyUI\main.py", line 177, in
import execution
File "C:\Users\User\Documents\ComfyUI_windows_portable\ComfyUI\execution.py", line 15, in
import comfy.model_management
File "C:\Users\User\Documents\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 239, in
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
~~~~~~~~~~~~~~~~^^
File "C:\Users\User\Documents\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 189, in get_torch_device
return torch.device(torch.cuda.current_device())
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\User\Documents\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda\__init__.py", line 1069, in current_device
_lazy_init()
~~~~~~~~~~^^
File "C:\Users\User\Documents\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda\__init__.py", line 403, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
```
### Other
_No response_
Contributor guide
Research direction
Start by inspecting update\update_comfyui_and_python_dependencies.bat and comparing the installed PyTorch package with the run_nvidia_gpu.bat launch path. Trace the failure from ComfyUI\comfy\model_management.py line 189 and verify that a completed update leaves CUDA support available and allows the launcher to start without the assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- ai, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100