mirror of
https://github.com/Comfy-Org/comfy-aimdo.git
synced 2026-11-04 23:37:21 +00:00
[GH-ISSUE #61] hostbuf_file_reader_read failed with all mixed precision quantized video models on RTX 5090 Laptop #17
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-aimdo#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bit-ba on GitHub (Jun 8, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-aimdo/issues/61
System Information
Problem
All mixed precision quantized video models fail with the same error:
RuntimeError: hostbuf_file_reader_read failed
Affected Models
Error Location
File: comfy_aimdo/host_buffer.py, line 71, in read_file_to_device
Notes
@rattus128 commented on GitHub (Jun 11, 2026):
send stack trace
@Hz198111 commented on GitHub (Aug 7, 2026):
Same error here, with a MiniMax H3 quantized video model on Windows 10. I dug into it and have some findings that may help you reproduce.
Environment
Model / workflow
minimax_h3_fl2va_int8_convrot.safetensors(34 GB, mixed-precision quantized: nativeint8_convrot/int8_tensorwise, emulatedmxfp8/nvfp4/fp8)prefetch_queue_pop:cast_modules_with_vbar(..., None, device, None, True)→cast_to_gathered→read_tensor_file_slice_into(destination=None, direct file→GPU path) →hostbuf_file_reader_readreturns false →RuntimeError: hostbuf_file_reader_read failedWhat I ruled out / verified
Where the failure actually is (from reading the 0.4.13 source)
Every
return falsepath inhostbuf_file_reader_readlogs atAIMDO_LOG_ERRORexcept the ones insidehostbuf_file_reader_retire_active()/hostbuf_file_reader_next()— those useCHECK_CU, which logs atVVERBOSE/DEBUGonly. The Python callback (_native_logincontrol.py) maps native levels 5/6/7 tologging.DEBUG, which ComfyUI's default INFO-level logging swallows. So the failing call is one of:cuEventCreate/cuEventRecordinretire_active()cuEventSynchronize/cuEventDestroy/cuMemAllocHostinnext()i.e. the CUDA event/slot machinery of the multi-stream file reader — the file read itself and the
cuMemcpyHtoDAsyncare fine (both would log at ERROR and neither fired).Workarounds confirmed working on this machine
--disable-async-offload(NUM_STREAMS=0 → prefetch never runs → no crash; video generates successfully, just slower)--disable-dynamic-vram(aimdo not initialized at all → no crash; but the model then loads fully into RAM, so you need a big pagefile — hit os error 1455 with a 3.3 GB pagefile, fixed by adding a 32 GB one)Suspicion: since the failing calls are CUDA event operations on the offload streams and this is Windows 10 (unsupported per the README), a Win10/WDDM-specific issue with events on those streams seems plausible.
Happy to re-run with
--verboseand paste the DEBUG-levelCUDA API FAILED (...)lines if that would help pinpoint it.@linesss commented on GitHub (Aug 13, 2026):
comfy-aimdo: HostBuffer.read_file_slice failed on MiniMax H3 (RTX 5090, Windows)
Replying to: https://github.com/Comfy-Org/comfy-aimdo/issues/61
Environment
b323a345b(latest, incl. WSL DynamicVRAM fix6b30dc206)G:\ComfyUI-aki-v2\python, Python 3.12.10)Model / workflow
minimax_h3_fl2va_pruned_int8_convrot.safetensors(21 GB, mixed-precision quantized: native int8_convrot)qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors(15.6 GB text encoder)MiniMaxH3ImageToVideonodeError
Intermittent failure at the very start of a run (during text-encoder load or first sampling prefetch):
Key observations from the logs:
GetOverlappedResultinxfer_file_read_at.cast_maybe_lowvram_patch/prefetch_queue_pop→read_tensor_file_slice_into→hostbuf.read_file_slice.CHECK_CUlines fire, swallowed by INFO logging).Workarounds tested (all fail on this machine)
--disable-async-offloadread_file_slice(hostbuf path) is not covered by this flag--disable-dynamic-vram(±--lowvram)Windows fatal exception: access violationinload_unet(torchstorage.py __getitem__); 40 GB pagefile present, but still crashes--disable-mmapread_file_sliceerrorOnly reliable workaround found
Restart ComfyUI before each single generation. After a restart the weights are first loaded via the normal file-read path (no aimdo CUDA-event multi-stream machinery), so the first task succeeds. Once DynamicVRAM re-stages weights, the second task hits
read_file_sliceand crashes. So: one generation per process lifetime.Additional data
minimax_h3_fl2va_pruned_int8_convrot(native int8) ANDminimax_h3_fl2va_pruned_w4a8_mixed.Happy to run with
--verbose/ DEBUG logging and paste theCUDA API FAILED (...)lines to help pinpoint whether it'scuEventCreate/cuEventRecord/cuEventSynchronizeas in issue #61.@linesss commented on GitHub (Aug 16, 2026):
@rattus128 Here is the full stack trace you asked for. The failure is on the text-encoder load path (not the sampling path), reproducing on RTX 5090 32GB, Windows 11, ComfyUI master b323a345b, comfy-aimdo 0.4.13.
The read fails at → (ERROR_NO_SYSTEM_RESOURCES), reading 2MB chunks at a fixed ~11.6–11.7 GB offset inside the 15.6 GB text encoder ().
Traceback (text-encoder load path):
Also a second, rarer failure mode at → during .
Key observations:
This matches @Hz198111's finding that the CUDA event/slot machinery is the likely culprit. Happy to run with / DEBUG logging and paste lines if that helps pinpoint.
@caninereason commented on GitHub (Sep 24, 2026):
Tried everything to solve this, until I updated gfx and torch- problem solved, better gen times and stability now, just update torch and gfx drivers.
@whartons commented on GitHub (Oct 16, 2026):
Still happening on the latest release here: comfy-aimdo 0.5.6 with ComfyUI 0.40.0 (Windows 11, RTX 5090 32 GB, PyTorch 2.10.0+cu130, ComfyUI Desktop).
It's the same text-encoder load path @linesss described above. Loading FLUX.2 dev's bf16 text encoder (
mistral_3_small_flux2_bf16.safetensors, 35.6 GB) partway through a session, while other models are still staged, fails with Windows error 1450 (ERROR_NO_SYSTEM_RESOURCES) andRuntimeError: HostBuffer.read_file_slice failed.A workaround that has been reliable for us: send
POST /freewith{"unload_models": true, "free_memory": true}before queueing the FLUX.2 job. The same job then loads and runs, so it seems to depend on what is already staged rather than on the file itself.@wu-yang-8888 commented on GitHub (Oct 22, 2026):
Confirming the same failure with MiniMax H3 on a 12GB card — and reporting one extra data point:
0.6.0 changes the failure mode but does not fix it.
Environment
cp39-abi3-win_amd64 / cp312-abi3-win_amd64)
python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
Model
What succeeds
Where it dies
RuntimeError: hostbuf_file_reader_read failed
comfy/memory_management.py:21 read_tensor_file_slice_into
-> raised inside KSampler (node 9)
Comparison with 0.5.6
On 0.5.6 (with a hand-typed
main.pyinvocation, i.e. without --windows-standalone-build)the same graph died earlier and harder:
Windows fatal exception: access violationattorch/storage.py getitem -> comfy/utils.py load_torch_file -> comfy/sd.py load_clip,
process killed (exit 139). With the correct launcher flags plus the 0.6.0 / 0.2.40 upgrade
the encoder now loads and sampling starts, so something did improve — but the hostbuf read
still fails at the first sampling step.
On the suggested workaround
--disable-dynamic-vramis not testable here with comfy-kitchen 0.2.40: the server exitsduring start_comfyui and nothing ever listens on the port, so the workflow cannot be submitted.
Happy to run any debug build or extra logging you want on this box.