Repository: comfyanonymous/ComfyUI

Issue #1845: RuntimeError: CUDA error: operation not supported
Created: 2023-10-26T03:26:00Z
I am unable to get ComfyUI running on my GPU - it has 16GB VRAM and I am getting the following error:
C:\ComfyUI>python main.py
Traceback (most recent call last):
File "C:\ComfyUI\main.py", line 74, in 
import execution
File "C:\ComfyUI\execution.py", line 12, in 
import nodes
File "C:\ComfyUI\nodes.py", line 20, in 
import comfy.diffusers_load
File "C:\ComfyUI\comfy\diffusers_load.py", line 4, in 
import comfy.sd
File "C:\ComfyUI\comfy\sd.py", line 5, in 
from comfy import model_management
File "C:\ComfyUI\comfy\model_management.py", line 114, in 
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI\comfy\model_management.py", line 105, in get_total_memory
_, mem_total_cuda = torch.cuda.mem_get_info(dev)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\uat\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\torch\cuda\memory.py", line 663, in mem_get_info
return torch.cuda.cudart().cudaMemGetInfo(device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: operation not supported
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
Any assistance? I tried changing the torch and cuda versions, reverted the changes and still not able to get it running...

Duplicate issue #6847: Weird Behaviour With Cuda on fresh install
Created: 2025-02-17T19:07:59Z
Expected Behavior
I am helping someone install ComfyUI on their machine. Coumfy starts normally, but when he tried to run the workflow (I will link it along with the error) a weird Cuda error popped up that I hadn't seen before. He has two GPUs (two P40) although he just wants it to run on one.
I would expect the workflow to run (it runs on my machine and all the nodes are installed on his)
Actual Behavior
The workflow Crashes
Steps to Reproduce
Backround Video Remover.json
Runs  the workflow and fails with the below error
Debug Logs
Prompt executed in 3.90 seconds
Error handling request
Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\server.py", line 50, in cache_control
    response: web.Response = await handler(request)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\server.py", line 59, in compress_body
    response: web.Response = await handler(request)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\server.py", line 144, in origin_only_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\server.py", line 521, in system_stats
    vram_total, torch_vram_total = comfy.model_management.get_total_memory(device, torch_total_too=True)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 157, in get_total_memory
    _, mem_total_cuda = torch.cuda.mem_get_info(dev)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\cuda\memory.py", line 738, in mem_get_info
    return torch.cuda.cudart().cudaMemGetInfo(device)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: unknown error
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
Other
No response

Closing comment (2025-02-18T12:14:30Z): duplicate: #1845 (comment)