Comfy-Org / Comfy-Org/ComfyUI

[Bug] CUDA illegal memory access / HostBuffer.truncate failed with comfy-kitchen 0.2.31 during dynamic VRAM load (MiniMaxH3)

Open
#15,591 0 comments 0 reactions 0 assignees 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

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

Generating a heavy workflow (like a 73-frame MiniMaxH3 video) should complete successfully by dynamically offloading VRAM without memory allocation errors, exactly as it did in the previous version of the comfy-kitchen dependency.

### Actual Behavior

The dynamic VRAM offloading crashes shortly after the KSampler begins processing. It throws a `CUDA error: an illegal memory access was encountered` and a `RuntimeError: HostBuffer.truncate failed`, specifically failing during the `partially_unload_ram` / `hostbuf.truncate` step.

Note: Manually downgrading the python library via `pip install comfy-kitchen==0.2.30` completely resolves the issue and allows the exact same workflow to finish successfully.

### Steps to Reproduce

1. Ensure your embedded python environment has `comfy-kitchen==0.2.31` installed.
2. Load a heavy model workflow requiring aggressive dynamic VRAM offloading on a lower VRAM GPU (e.g., MiniMaxH3 Image-to-Video generating 73 frames on a 12GB GPU). I've attached my workflow JSON below.
3. Start the generation. The system stages the model successfully (e.g., `Model MiniMaxH3 prepared for dynamic VRAM loading. 19995MB Staged`).
4. Shortly a

[Minimax H3 - Text to video.json](https://github.com/user-attachments/files/31044052/Minimax.H3.-.Text.to.video.json)

5. Downgrade to `comfy-kitchen==0.2.30`, restart ComfyUI, and observe the same workflow completing without any VRAM/RAM errors.

### Debug Logs

```powershell
Checking for Easy-Install update...

Checking for ComfyUI update...

Easy-Install is up to date (v3.13.1, latest is v3.13.1)

python_embeded\python.exe -X utf8=1 -I -W ignore::FutureWarning D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\main.py --windows-standalone-build --use-sage-attention --disable-auto-launch

[INFO] setup plugin alembic.autogenerate.schemas

[INFO] setup plugin alembic.autogenerate.tables

[INFO] setup plugin alembic.autogenerate.types

[INFO] setup plugin alembic.autogenerate.constraints

[INFO] setup plugin alembic.autogenerate.defaults

[INFO] setup plugin alembic.autogenerate.comments

[INFO] setup plugin alembic.autogenerate.checkconstraint_byname

[INFO] Adding extra search path annotators D:\Jogos\StableDifusion\ComfyUI\models\annotators

[INFO] Adding extra search path checkpoints D:\Jogos\StableDifusion\ComfyUI\models\checkpoints

[INFO] Adding extra search path clip D:\Jogos\StableDifusion\ComfyUI\models\clip

[INFO] Adding extra search path clip_vision D:\Jogos\StableDifusion\ComfyUI\models\clip_vision

[INFO] Adding extra search path configs D:\Jogos\StableDifusion\ComfyUI\models\configs

[INFO] Adding extra search path controlnet D:\Jogos\StableDifusion\ComfyUI\models\controlnet

[INFO] Adding extra search path diffusers D:\Jogos\StableDifusion\ComfyUI\models\diffusers

[INFO] Adding extra search path diffusion_models D:\Jogos\StableDifusion\ComfyUI\models\diffusion_models

[INFO] Adding extra search path download D:\Jogos\StableDifusion\ComfyUI\models\download

[INFO] Adding extra search path embeddings D:\Jogos\StableDifusion\ComfyUI\models\embeddings

[INFO] Adding extra search path gligen D:\Jogos\StableDifusion\ComfyUI\models\gligen

[INFO] Adding extra search path hypernetworks D:\Jogos\StableDifusion\ComfyUI\models\hypernetworks

[INFO] Adding extra search path krea D:\Jogos\StableDifusion\ComfyUI\models\krea

[INFO] Adding extra search path llavacheckpoints D:\Jogos\StableDifusion\ComfyUI\models\LLavacheckpoints

[INFO] Adding extra search path llm D:\Jogos\StableDifusion\ComfyUI\models\llm

[INFO] Adding extra search path llm_gguf D:\Jogos\StableDifusion\ComfyUI\models\llm_gguf

[INFO] Adding extra search path loras D:\Jogos\StableDifusion\ComfyUI\models\loras

[INFO] Adding extra search path neondrip.safetensors D:\Jogos\StableDifusion\ComfyUI\models\neondrip.safetensors

[INFO] Adding extra search path onnx D:\Jogos\StableDifusion\ComfyUI\models\onnx

[INFO] Adding extra search path photomaker D:\Jogos\StableDifusion\ComfyUI\models\photomaker

[INFO] Adding extra search path sams D:\Jogos\StableDifusion\ComfyUI\models\sams

[INFO] Adding extra search path style_models D:\Jogos\StableDifusion\ComfyUI\models\style_models

[INFO] Adding extra search path text_encoders D:\Jogos\StableDifusion\ComfyUI\models\text_encoders

[INFO] Adding extra search path ultralytics D:\Jogos\StableDifusion\ComfyUI\models\ultralytics

[INFO] Adding extra search path unet D:\Jogos\StableDifusion\ComfyUI\models\unet

[INFO] Adding extra search path upscale_models D:\Jogos\StableDifusion\ComfyUI\models\upscale_models

[INFO] Adding extra search path vae D:\Jogos\StableDifusion\ComfyUI\models\vae

[INFO] Adding extra search path vae_approx D:\Jogos\StableDifusion\ComfyUI\models\vae_approx

[INFO] Adding extra search path xlabs D:\Jogos\StableDifusion\ComfyUI\models\xlabs

[START] Security scan

[DONE] Security scan

## ComfyUI-Manager: installing dependencies done.

** ComfyUI startup time: 2026-08-13 16:22:21.720

** Platform: Windows

** Python version: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]

** Python executable: D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\python.exe

** ComfyUI Path: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI

** ComfyUI Base Folder Path: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI

** User directory: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\user

** ComfyUI-Manager config path: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\user\__manager\config.ini

** Log path: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\user\comfyui.log

[INFO]

Prestartup times for custom nodes:

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\rgthree-comfy

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-Easy-Use

[INFO] 5.4 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-manager

[INFO]

[INFO] Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'int8_linear', 'na3d', 'quantize_and_rotate_rowwise', 'quantize_int8_rowwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'w4a8_int8_linear']}

[INFO] Found comfy_kitchen backend hip: {'available': False, 'disabled': False, 'unavailable_reason': 'PyTorch ROCm/HIP runtime not available', 'capabilities': []}

[INFO] Found comfy_kitchen backend cuda: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'dequantize_w4a8_int8_weight', 'gemv_awq_w4a16', 'int8_linear', 'na3d', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'quantize_w4a8_int8_weight', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'rotate_int8_convrot_weight', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8', 'w4a8_int8_linear']}

[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_embedding', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'dequantize_w4a8_int8_weight', 'gemv_awq_w4a16', 'int8_linear', 'na3d', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'quantize_w4a8_int8_weight', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'rotate_int8_convrot_weight', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'stochastic_rounding_fp8', 'w4a8_int8_linear']}

[INFO] Checkpoint files will always be loaded safely.

[INFO] Total VRAM 12288 MB, total RAM 31821 MB

[INFO] pytorch version: 2.11.0+cu130

[INFO] Set vram state to: NORMAL_VRAM

[INFO] Device: cuda:0 NVIDIA GeForce RTX 3080 Ti : cudaMallocAsync

[INFO] Using async weight offloading with 2 streams

[INFO] Enabled pinned memory 12728.0

[INFO] Using sage attention

[INFO] aimdo: src-win/cuda-detour.c:38:INFO:aimdo_setup_hooks: installing 6 hooks

[INFO] aimdo: src/control.c:262:INFO:comfy-aimdo NVML pressure enabled

[INFO] aimdo: src-win/shmem-detect.c:80:INFO:comfy-aimdo WDDM adapter match: NVIDIA GeForce RTX 3080 Ti runtime_luid=00000000:0001296e dxgi_luid=00000000:0001296e

[INFO] aimdo: src/control.c:277:INFO:comfy-aimdo inited for GPU: NVIDIA GeForce RTX 3080 Ti (VRAM: 12287 MB)

[INFO] DynamicVRAM support detected and enabled

[INFO] Python version: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]

[INFO] ComfyUI version: 0.33.0

[INFO] comfy-aimdo version: 0.4.13

[INFO] comfy-kitchen version: 0.2.31

[INFO] comfyui-frontend-package version: 1.48.7

[INFO] comfyui-workflow-templates version: 0.11.41

[INFO] comfyui-embedded-docs version: 0.5.9

[INFO] comfy-kitchen version: 0.2.31

[INFO] comfy-aimdo version: 0.4.13

[INFO] [Prompt Server] web root: D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\comfyui_frontend_package\static

[INFO] Asset seeder disabled

[INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'

[ComfyUI-Easy-Use] server: v1.3.7 Loaded

[ComfyUI-Easy-Use] web root: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-Easy-Use\web_version/v2 Loaded

[FishAudioS2] Models folder registered: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\models\fishaudioS2

[FishAudioS2] Registered 4 nodes (v0.5.3): Fish S2 TTS, Fish S2 Voice Clone TTS, Fish S2 Multi-Speaker TTS, Fish S2 Multi-Speaker Split TTS

[INFO] ComfyUI-GGUF: Allowing full torch compile

[krea2edit] nodes v1.2.5 loaded

[INFO] ### Loading: ComfyUI-Manager (V3.41)

[INFO] [ComfyUI-Manager] network_mode: public

[INFO] [ComfyUI-Manager] ComfyUI per-queue preview override detected (PR #11261). Manager's preview method feature is disabled. Use ComfyUI's --preview-method CLI option or 'Settings > Execution > Live preview method'.

[INFO] ### ComfyUI Revision: 5766 [2f35f4a0] *DETACHED | Released on '2026-08-13'

[INFO] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json

[INFO] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json

[INFO] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json

[INFO] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Pixaroma v1.4.106 | 73 nodes Loaded

ComfyUI Tutorials: https://www.youtube.com/@pixaroma

This is a notice, not an error. All Pixaroma nodes work in both Classic and Nodes 2.0 mode.

If something looks off right after switching the Node UI mode, hard-refresh the page (Ctrl+Shift+R).

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[INFO] [ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json

[llama-cpp-python] loaded bundled OpenMP runtime: D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\llama_cpp\lib\libomp140.x86_64.dll

[llama-cpp-python].find_library: loaded library from D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\llama_cpp\lib\ggml-base.dll

[llama-cpp-python].find_library: loaded library from D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\llama_cpp\lib\ggml.dll

[llama-cpp-python].find_library: loaded library from D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\llama_cpp\lib\llama.dll

[ComfyUI-RMBG] v3.1.0 | 43 nodes Loaded

[D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts

[D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using symlinks: False

[D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']

DWPose: Onnxruntime with acceleration providers detected

# 😺dzNodes: LayerStyle -> Cannot import name 'guidedFilter' from 'cv2.ximgproc'

A few nodes cannot works properly, while most nodes are not affected. Please REINSTALL package 'opencv-contrib-python'.

For detail refer to https://github.com/chflame163/ComfyUI_LayerStyle/issues/5

Initializing ControlAltAI Nodes

✅ ComfyUI-Qwen-TTS v1.0.7 loaded

[rgthree-comfy] Loaded 48 epic nodes. 🎉

[rgthree-comfy] ComfyUI's new Node 2.0 rendering may be incompatible with some rgthree-comfy nodes and features, breaking some rendering as well as losing the ability to access a node's properties (a vital part of many nodes). It also appears to run MUCH more slowly spiking CPU usage and causing jankiness and unresponsiveness, especially with large workflows. Personally I am not planning to use the new Nodes 2.0 and, unfortunately, am not able to invest the time to investigate and overhaul rgthree-comfy where needed. If you have issues when Nodes 2.0 is enabled, I'd urge you to switch it off as well and join me in hoping ComfyUI is not planning to deprecate the existing, stable canvas rendering all together.

⚡ SeedVR2 optimizations check: SageAttention ✅ | Flash Attention ✅ | Triton ✅

🔧 Conv3d workaround active: PyTorch 2.11.0, cuDNN 91900 (fixing VAE 3x memory bug)

📊 Initial CUDA memory: 10.78GB free / 12.00GB total

[INFO]

Import times for custom nodes:

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\websocket_image_save.py

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-krea2edit

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-Krea2T-Enhancer

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-SCAIL-Pose

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-inpaint-cropandstitch

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-GGUF

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-WanAnimatePreprocess

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-MelBandRoFormer

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\controlaltai-nodes

[INFO] 0.0 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\rgthree-comfy

[INFO] 0.1 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-kjnodes

[INFO] 0.1 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_controlnet_aux

[INFO] 0.2 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui_layerstyle

[INFO] 0.2 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-Pixaroma

[INFO] 0.3 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\seedvr2_videoupscaler

[INFO] 0.4 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-easy-sam3

[INFO] 0.5 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-itools

[INFO] 0.5 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\qwen3-tts-comfyui

[INFO] 0.5 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-videohelpersuite

[INFO] 0.6 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-WanVideoWrapper

[INFO] 0.6 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-QwenVL

[INFO] 0.9 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-manager

[INFO] 1.1 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-fish-audio-s2

[INFO] 1.2 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\comfyui-rmbg

[INFO] 6.9 seconds: D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\custom_nodes\ComfyUI-Easy-Use

[INFO]

[INFO] Context impl SQLiteImpl.

[INFO] Will assume non-transactional DDL.

[INFO] Using RAM pressure cache.

[INFO] Starting server

[INFO] To see the GUI go to: http://127.0.0.1:8188

[INFO] got prompt

[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.float32

[INFO] VAE load device: cuda:0, offload device: cpu, dtype: torch.float16

[INFO] Found quantization metadata version 1

[INFO] Using MixedPrecisionOps for text encoder

[INFO] CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16

[INFO] Requested to load MiniMaxH3TEModel_

[INFO] Model MiniMaxH3TEModel_ prepared for dynamic VRAM loading. 14956MB Staged. 0 patches attached. Force pre-loaded 410 weights: 4572 KB.

[INFO] Found quantization metadata version 1

[INFO] Detected mixed precision quantization

[INFO] Using mixed precision operations

[INFO] Native ops: asym_w4a8_int8, convrot_w4a4, int8_tensorwise , emulated ops: mxfp8, nvfp4, float8_e5m2, float8_e4m3fn

[INFO] model weight dtype torch.bfloat16, manual cast: torch.bfloat16

[INFO] model_type FLOW_AV

[INFO] Requested to load MiniMaxH3

[INFO] 0 models unloaded.

[INFO] Model MiniMaxH3 prepared for dynamic VRAM loading. 19995MB Staged. 0 patches attached. Force pre-loaded 210 weights: 1175 KB.

0%| | 0/20 [00:11= shortfall

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\comfy\model_management.py", line 698, in free_pins

freed += free_model_pins(size - freed, subsets, current_prompt, active)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\comfy\model_management.py", line 665, in free_model_pins

freed = model.partially_unload_ram(size, subsets=subsets)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\comfy\model_patcher.py", line 2113, in partially_unload_ram

hostbuf.truncate(offset, do_unregister=registered)

File "D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\comfy_aimdo\host_buffer.py", line 122, in truncate

raise RuntimeError("HostBuffer.truncate failed")

RuntimeError: HostBuffer.truncate failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\execution.py", line 550, in execute

comfy.model_management.reset_cast_buffers()

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\comfy\model_management.py", line 1426, in reset_cast_buffers

offload_stream.synchronize()

File "D:\ComfyUI\ComfyUI-Easy-Install\python_embeded\Lib\site-packages\torch\cuda\streams.py", line 108, in synchronize

super().synchronize()

torch.AcceleratorError: CUDA error: an illegal memory access was encountered

Search for `cudaErrorIllegalAddress' 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] Prompt executed in 52.09 seconds

Fatal Python error: Aborted

Stack (most recent call first):

File "D:\ComfyUI\ComfyUI-Easy-Install\ComfyUI\main.py", line 416 in prompt_worker

File "threading.py", line 1012 in run

File "threading.py", line 1075 in _bootstrap_inner

File "threading.py", line 1032 in _bootstrap

Extension modules: sqlalchemy.cyextension.collections, sqlalchemy.cyextension.immutabledict, sqlalchemy.cyextension.processors, sqlalchemy.cyextension.resultproxy, sqlalchemy.cyextension.util, greenlet._greenlet, markupsafe._speedups, yaml._yaml, PIL._imaging, multidict._multidict, yarl._quoting_c, propcache._helpers_c, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket.mask, aiohttp._websocket.reader_c, frozenlist._frozenlist, charset_normalizer.md, charset_normalizer.cd, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, torch._C, torch._C._dynamo.autograd_compiler, torch._C._dynamo.eval_frame, torch._C._dynamo.guards, torch._C._dynamo.utils, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special, psutil._psutil_windows, PIL._imagingft, _cyutility, scipy._cyutility, scipy._lib._ccallback_c, scipy.ndimage._nd_image, scipy.ndimage._rank_filter_1d, scipy.special._ufuncs_cxx, scipy.special._ellip_harm_2, scipy.special._special_ufuncs, scipy.special._gufuncs, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, _ni_label, scipy.ndimage._ni_label, regex._regex, scipy.integrate._odepack, scipy.integrate._quadpack, scipy.integrate._vode, scipy.integrate._dop, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._batched_linalg, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_schur_sqrtm, scipy.linalg._matfuncs_expm, scipy.linalg._linalg_pythran, scipy.linalg.cython_blas, scipy.linalg._decomp_update, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpacklib, scipy.sparse.linalg._propack, scipy.optimize._group_columns, scipy._lib.messagestream, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._slsqplib, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy._lib._uarray._uarray, scipy.linalg._decomp_interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.spatial._ckdtree, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._hausdorff, scipy.spatial._distance_wrap, scipy.spatial.transform._rotation_cy, scipy.spatial.transform._rigid_transform_cy, scipy.optimize._direct, scipy.interpolate._fitpack, scipy.interpolate._dfitpack, scipy.interpolate._dierckx, scipy.interpolate._ppoly, scipy.interpolate._interpnd, scipy.interpolate._rbfinterp_pythran, scipy.interpolate._rgi_cython, scipy.special.cython_special, scipy.stats._stats, scipy.stats._biasedurn, scipy.stats._stats_pythran, scipy.stats._levy_stable.levyst, scipy.stats._ansari_swilk_statistics, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.stats._sobol, scipy.stats._qmc_cy, scipy.stats._rcont.rcont, scipy.stats._qmvnt_cy, av._core, av.logging, av.bytesource, av.buffer, av.audio.format, av.error, av.dictionary, av.container.pyio, av.option, av.descriptor, av.format, av.utils, av.stream, av.container.streams, av.sidedata.motionvectors, av.sidedata.sidedata, av.opaque, av.packet, av.container.input, av.container.output, av.container.core, av.codec.context, av.video.format, av.video.reformatter, av.plane, av.video.plane, av.video.frame, av.video.stream, av.codec.hwaccel, av.codec.codec, av.frame, av.audio.layout, av.audio.plane, av.audio.frame, av.audio.stream, av.filter.link, av.filter.context, av.filter.graph, av.filter.filter, av.filter.loudnorm, av.audio.resampler, av.audio.codeccontext, av.audio.fifo, av.bitstream, av.video.codeccontext, av.subtitles.stream, scipy.signal._sigtools, scipy.signal._max_len_seq_inner, scipy.signal._upfirdn_apply, scipy.signal._spline, scipy.signal._sosfilt, scipy.signal._peak_finding_utils, pycocotools._mask, _cffi_backend, sklearn.__check_build._check_build, sklearn._cyutility, sklearn.utils._isfinite, sklearn.utils.sparsefuncs_fast, sklearn.utils.murmurhash, sklearn.utils._openmp_helpers, sklearn.metrics.cluster._expected_mutual_info_fast, sklearn.metrics._dist_metrics, sklearn.metrics._pairwise_distances_reduction._datasets_pair, sklearn.utils._cython_blas, sklearn.metrics._pairwise_distances_reduction._base, sklearn.metrics._pairwise_distances_reduction._middle_term_computer, sklearn.utils._heap, sklearn.utils._sorting, sklearn.metrics._pairwise_distances_reduction._argkmin, sklearn.metrics._pairwise_distances_reduction._argkmin_classmode, sklearn.utils._vector_sentinel, sklearn.metrics._pairwise_distances_reduction._radius_neighbors, sklearn.metrics._pairwise_distances_reduction._radius_neighbors_classmode, sklearn.metrics._pairwise_fast, sklearn.preprocessing._csr_polynomial_expansion, sklearn.preprocessing._target_encoder_fast, zstandard.backend_c, ormsgpack.ormsgpack, numba.core.typeconv._typeconv, numba._helperlib, numba._dynfunc, numba._dispatcher, numba.core.runtime._nrt_python, numba.np.ufunc._internal, numba.experimental.jitclass._box, google._upb._message, kiwisolver._cext, skimage.measure._ccomp, PIL._imagingcms, msgpack._cmsgpack, xxhash._xxhash, scipy.io.matlab._mio_utils, scipy.io.matlab._streams, scipy.io.matlab._mio5_utils, cuda_utils, __triton_launcher (total: 224)
```

### Other

**Environment Details:**
* EZi: v3.13.1
* ComfyUI: v0.33.0
* Frontend: 1.48.7
* Python: 3.12.10 (Embedded)
* PyTorch: 2.11.0+cu130
* CUDA Core: 13.0
* NVIDIA drv: 610.88
* GPU Model: NVIDIA GeForce RTX 3080 Ti
* Video VRAM: 12 GB
* System RAM: 31 GB
* Page File: Auto (current: 14877 MB)
* OS: Windows
* Arguments: `--windows-standalone-build --use-sage-attention --disable-auto-launch`

Contributor guide

Open the contributing guide

Research direction

Reproduce the attached MiniMax H3 workflow on the stated Windows, CUDA, and 12 GB GPU setup with comfy-kitchen 0.2.31, then compare the same run with 0.2.30. Trace the dynamic VRAM offloading path around partially_unload_ram and HostBuffer.truncate in the comfy-kitchen dependency; done means the workflow completes without the illegal memory access or HostBuffer.truncate failure on 0.2.31.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.