Comfy-Org / Comfy-Org/ComfyUI

MemoryError: VBAR allocation failed in 17.2

Open
#13,015 4 comments 0 reactions 1 assignee Claimed by @rattus128 View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] 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

When I use the VAE encode node, it runs normally.

### Actual Behavior

When I use the VAE encode node, this error occurs. My environment is shown below:
========================================
环境与设备检测报告
========================================
Python 版本 : 3.12.9
执行路径 : C:\ComfyUi Launcher\Python\Python312\python.exe
操作系统 : Windows 10 (Build 20348)
----------------------------------------
PyTorch 版本: 2.8.0+cu128
CUDA 可用 : True
GPU 型号 : NVIDIA RTX5880-Ada-48Q
显存大小 : 48.0 GB
CUDA 版本 : 12.8
========================================

### Steps to Reproduce

The workflow used is the sample workflow from FireRedTeam: https://huggingface.co/FireRed-Image-Edit-1.1-ComfyUI

### Debug Logs

```powershell
MemoryError: VBAR allocation failed

File "C:\ComfyUi Launcher\ComfyUI\execution.py", line 524, in execute
output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\execution.py", line 333, in get_output_data
return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\execution.py", line 307, in _async_map_node_over_list
await process_inputs(input_dict, i)

File "C:\ComfyUi Launcher\ComfyUI\execution.py", line 295, in process_inputs
result = f(**inputs)
^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\nodes.py", line 364, in encode
t = vae.encode(pixels)
^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\comfy\sd.py", line 1034, in encode
model_management.raise_non_oom(e)

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_management.py", line 288, in raise_non_oom
raise e

File "C:\ComfyUi Launcher\ComfyUI\comfy\sd.py", line 1021, in encode
model_management.load_models_gpu([self.patcher], memory_required=memory_used, force_full_load=self.disable_offload)

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_management.py", line 772, in load_models_gpu
loaded_model.model_load(lowvram_model_memory, force_patch_weights=force_patch_weights)

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_management.py", line 555, in model_load
self.model_use_more_vram(use_more_vram, force_patch_weights=force_patch_weights)

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_management.py", line 585, in model_use_more_vram
return self.model.partially_load(self.device, extra_memory, force_patch_weights=force_patch_weights)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_patcher.py", line 1693, in partially_load
raise e

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_patcher.py", line 1690, in partially_load
self.load(device_to, dirty=dirty)

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_patcher.py", line 1534, in load
vbar = self._vbar_get(create=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\ComfyUI\comfy\model_patcher.py", line 1488, in _vbar_get
vbar = comfy_aimdo.model_vbar.ModelVBAR(self.model_size() * 10, self.load_device.index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\ComfyUi Launcher\Python\Python312\Lib\site-packages\comfy_aimdo\model_vbar.py", line 51, in __init__
raise MemoryError("VBAR allocation failed")
```

### Other

I'm using a cloud computer and can't update the drivers. It might be due to the cloud computer.I also tried using the `--disable-cuda-malloc` command and switching to version 16.4, but encountered other issues during the K sampler stage.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.