Skip to content

Dynamic VRAM streaming crashes all generations with HostBuffer.read_file_slice failed → CUDA OOM (regression after Aug 3 2026 update) #15255

Description

@roumani76-arch

Mod Note:

This is a Cuda error and has been reported to NVIDIA

To workaround, please start comfy with --cuda-device 0 (or a higher number) to restrict comfy to a single GPU or use --disable-pinned-memory for multi GPU functionality

Please start from #15255 (comment) for the latest.

original report

Custom Node Testing

Expected Behavior

Dynamic VRAM streaming should work as it did prior to today's update, or fail gracefully without crashing the whole queue.

Actual Behavior

Environment:

ComfyUI version: 0.30.1
comfy-aimdo version: 0.4.11
comfy-kitchen version: 0.2.26
PyTorch: 2.10.0+cu130
OS: Windows (ComfyUI Desktop)
GPUs: RTX 5060 Ti (16GB, primary) + RTX 3060 (12GB, secondary)
Driver: NVIDIA 610.88, CUDA UMD 13.3

Summary:
After updating ComfyUI Desktop today (Aug 3, 2026), every generation — regardless of model (tested with Krea 2) — fails immediately during sampling with a host buffer read failure that cascades into a CUDA OOM error. This worked correctly before today's update.

Steps to reproduce:

Launch ComfyUI Desktop (dynamic VRAM enabled by default — log shows DynamicVRAM support detected and enabled)
Run any generation (tested: Krea 2 text-to-image)
Sampler starts, model loads and stages into VRAM normally
Crashes ~immediately with:
[ERROR] !!! Exception during processing !!! CUDA error: out of memory
...
File "...\comfy\ops.py", line 228, in cast_modules_with_vbar
handle_pin(s, pin, xfer_source, xfer_dest, subset=subset, size=dest_size)
...
File "...\comfy_aimdo\host_buffer.py", line 109, in read_file_slice
raise RuntimeError("HostBuffer.read_file_slice failed")
RuntimeError: HostBuffer.read_file_slice failed

During handling of the above exception, another exception occurred:
...
File "...\comfy\model_management.py", line 2005, in synchronize
torch.cuda.synchronize()
torch.AcceleratorError: CUDA error: out of memory

Notes:

nvidia-smi confirms this is not a real memory shortage — GPU 0 shows only ~2GB used out of 16.3GB before launch, 14+ GB free.
The crash is not model-size dependent — small and large models both fail identically.
Workaround confirmed: launching with --disable-dynamic-vram fixes it completely; all generations succeed normally with this flag.
This strongly points to a regression in comfy-aimdo's host-buffer/dynamic-VRAM-streaming layer introduced in today's update, since disabling that specific subsystem resolves the issue entirely.

Steps to Reproduce

Image generation in official Comfyui Krea2 turbo / z-image turbo workflows

Debug Logs

File "D:\ComfyUI\standalone-env\Lib\threading.py", line 995, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI\ComfyUI\main.py", line 372, in prompt_worker
    e.execute(item[2], prompt_id, extra_data, item[4])
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI\ComfyUI\execution.py", line 728, in execute
    asyncio.run(self.execute_async(prompt, prompt_id, extra_data, execute_outputs))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI\standalone-env\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "D:\ComfyUI\standalone-env\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\ComfyUI\standalone-env\Lib\asyncio\base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "D:\ComfyUI\ComfyUI\execution.py", line 789, in execute_async
    result, error, ex = await execute(self.server, dynamic_prompt, self.caches, node_id, extra_data, executed, prompt_id, execution_list, pending_subgraph_results, pending_async_nodes, ui_node_outputs)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI\ComfyUI\execution.py", line 645, in execute
    comfy.model_management.unload_all_models()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\ComfyUI\ComfyUI\comfy\model_management.py", line 2027, in unload_all_models
    free_memory(1e30, device)
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "D:\ComfyUI\ComfyUI\comfy\model_management.py", line 875, in free_memory
    memory_to_free = 0 if device is None else memory_required - get_free_memory(device)
                                                                ~~~~~~~~~~~~~~~^^^^^^^^
  File "D:\ComfyUI\ComfyUI\comfy\model_management.py", line 1747, in get_free_memory
    mem_free_cuda, _ = torch.cuda.mem_get_info(dev)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "D:\ComfyUI\ComfyUI\.venv\Lib\site-packages\torch\cuda\memory.py", line 897, in mem_get_info
    return torch.cuda.cudart().cudaMemGetInfo(device)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
torch.AcceleratorError: CUDA error: out of memory
Search for `cudaErrorMemoryAllocation' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information.
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.

[INFO] FETCH ComfyRegistry Data [DONE]
[INFO] [ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
FETCH DATA from: D:\ComfyUI\ComfyUI\user\__manager\cache\1514988643_custom-node-list.json [DONE]
[INFO] [ComfyUI-Manager] All startup tasks have been completed.

Other

No response

Pinned by rattus128

Metadata

Metadata

Assignees

Labels

BugSomething is confirmed to not be working properly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions