mirror of
https://github.com/Comfy-Org/comfy-aimdo.git
synced 2026-11-04 23:37:21 +00:00
[GH-ISSUE #131] [ROCm/Linux][gfx1150 APU] DynamicVRAM hangs in lib.vbar_fault(); with --disable-dynamic-vram, mmap-backed safetensors upload at ~6 MB/s #51
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#51
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 @fengyangsi on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-aimdo/issues/131
Summary
Two distinct problems on an AMD Radeon 890M (gfx1150, Strix Point APU) under ROCm 7.14:
CLIPTextEncodehangs forever insidelib.vbar_fault().--disable-dynamic-vramthere is no hang, but a 6.5 GB SDXL checkpoint takes ~6 minutes to load, because HIP routes H2D copies of mmap-backed safetensors pages through host pinning.Both were diagnosed by attaching gdb to the live backend.
Environment
Reproduced with a minimal core-only workflow (
CheckpointLoaderSimple -> CLIPTextEncode -> KSampler -> VAEDecode -> SaveImage), no custom nodes involved.Problem 1 - DynamicVRAM hangs inside vbar_fault()
600 s, never completes. Last log line:
Execution thread, Python stack:
Same thread, native stack:
Symptoms match #124 exactly: one core pinned at 100%, VRAM stuck near 2.1 GB, GPU 3-5% busy, zero disk I/O, no further log lines, process alive indefinitely.
Also observed: rocclr's
AsyncEventsLoopthread busy-spins in user space from process start and never stops (869 s of CPU time on a 14-minute-old process), while its sibling thread blocks correctly inhsaKmtWaitOnMultipleEvents. Possibly related to what #122 described for gfx1151, but this is already 0.5.6.Problem 2 - ~6 min model load with --disable-dynamic-vram
The workflow completes, but 1024x1024 / 32 steps takes 476 s total, of which only 75 s is sampling. The remaining ~400 s is weight upload.
Native stack during the slow phase:
Isolated benchmark - 60 real safetensors weight tensors (~167 MB), straight
.to('cuda'):GPU_PINNED_MIN_XFER_SIZE=65536GPU_PINNED_MIN_XFER_SIZE=1048576.clone()first, no env varControls: pure
torch.randnmemory, 500 x 2.6 MB tensors -> 0.09 s (6.8 GB/s). Single 256 MB pageable H2D -> 9.6 GB/s. So the hardware and torch are fine; only mmap-backed source pages are pathological.This looks like the rocclr bug addressed by ROCm/rocm-systems#10962:
getBufferinrocclr/device/rocm/rocblit.cppprefers host pinning over the staging copy, and pinning a userptr on an iGPU goes throughfmm_map_mem_svm_api->AMDKFD_IOC_SVM ACCESS_IN_PLACE, ~15x slower per chunk on XNACK=0. That PR was merged 2026-09-23 and tested on gfx1151 / ROCm 7.11, but it does not appear to take effect here on gfx1150 / ROCm 7.14.Workaround
Result: 1024x1024 / 32 steps in 75 s (was 476 s), 512x512 / 8 steps in 17.9 s.
--disable-mmapalso avoids problem 2 (80 s) but requires an extra full copy of the model in RAM; the env var is cheaper.Questions
AsyncEventsLoopuser-space spin on gfx1150 be tracked separately, or is it meant to be covered by the 0.5.6 fix mentioned in #122?