Skip to content

[Bug] MiniMaxH3: DynamicVRAM causes infinite hang at "Model Initializing..." on RTX 4070 12GB; custom nodes surface underlying CUDA illegal memory access #15628

Description

@Milor123

Custom Node Testing

Expected Behavior

MiniMaxH3 should begin sampling and generate video when loaded with DynamicVRAM enabled on a 12GB NVIDIA GPU.

Actual Behavior

The process hangs indefinitely at 0%| 0/20 [00:00<?, ?it/s, Model Initializing ... ] and never progresses. No CPU or GPU activity is observed after this point.

When custom nodes (e.g., ComfyUI-MultiGPU) are loaded, the same hang manifests instead as an immediate CUDA error: an illegal memory access was encountered during stream synchronization (prefetch_queue_popensure_offload_streamwait_stream/record_event), suggesting the custom nodes' CUDA synchronization calls surface an already-corrupt context.

Steps to Reproduce

  1. Start ComfyUI with default flags (--lowvram or no memory flags).
  2. Load any MiniMaxH3 workflow (tested with int8_convrot and NVFP4 formats).
  3. Queue the prompt.
  4. Observe: model stages successfully (~11944MB staged), sampling starts, then hangs forever at step 0/20.

Environment

Component Version
OS Windows 11
ComfyUI 0.33.0
comfy-aimdo 0.4.13
comfy-kitchen 0.2.31
PyTorch 2.10.0+cu130
Python 3.13.5
GPU NVIDIA GeForce RTX 4070 (12 GB VRAM)
Driver 610.88
System RAM 48 GB (48445 MB)
CPU Intel Core i5-14500
Installation Manual (git clone + uv venv)

Debug Logs

Without custom nodes (--disable-all-custom-nodes):

[INFO] Model MiniMaxH3 prepared for dynamic VRAM loading. 11956MB Staged. 0 patches attached. Force pre-loaded 210 weights: 1175 KB.
  0%| 0/20 [00:00<?, ?it/s,   Model Initializing ...  ]

Process hangs indefinitely here. Tested for 5+ minutes with zero progress.

With custom nodes (NVFP4 format):
Crash occurs at comfy/model_prefetch.py:117 during prefetch_queue_pop:

File "comfy\model_prefetch.py", line 117, in prefetch_queue_pop
    offload_stream, fully_faulted = comfy.ops.cast_modules_with_vbar(...)
File "comfy\ops.py", line 138, in ensure_offload_stream
    offload_stream = comfy.model_management.get_offload_stream(device)
File "comfy\model_management.py", line 1470, in get_offload_stream
    ss[stream_counter].wait_stream(current_stream(device))
torch.AcceleratorError: CUDA error: an illegal memory access was encountered

With custom nodes (int8_convrot format):
Crash occurs inside comfy_kitchen quantized kernel:

File "comfy_kitchen\tensor\w4a8_int8.py", line 119, in w4a8_int8_linear
    return impl(**kwargs)
File "comfy_kitchen\backends\cuda\__init__.py", line 2157, in w4a8_int8_linear
    out = torch.empty(m, n, dtype=out_dtype, device=x.device)
torch.AcceleratorError: CUDA error: an illegal memory access was encountered

Is the issue caused by a custom node?

  • I have confirmed that the issue is NOT caused by a custom node. I tested with --disable-all-custom-nodes and the hang persists (it simply becomes silent instead of crashing).

Workarounds Attempted

Workaround Result
--disable-all-custom-nodes Hangs silently at step 0/20 (no crash, no progress)
--disable-async-offload Hangs identically
CUDA_LAUNCH_BLOCKING=1 Hangs identically
--disable-pinned-memory Hangs/crashes identically
--vram-headroom 1 Hangs/crashes identically
--disable-dynamic-vram OOM (12GB insufficient for this model)
Different model format (int8_convrot → NVFP4) Same failure mode

Additional Context

The workflow is the (1 mp), 15 duration:

Image

Metadata

Metadata

Assignees

Labels

Potential BugUser is reporting a bug. This should be tested.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions