About memory usage #2250
Replies: 3 comments 16 replies
-
Interesting I just made a comment about this on the discord last night. i dont know what setting i have out of whack but im making a single image, 512x816 x2 upscale...and the gen info reports this Time: 15.96s | GPU active 18566 MB reserved 18566 | used 20342 MB free 4223 MB total 24564 MB....did it really just use 20gigs of my 24 to upscale a single 512x816 x2?. which is any img past the first...the first one has its own issue....Time: 42.18s | GPU active 10210 MB reserved 3244 | used 4916 MB free 19648 MB total 24564 MB ...takes 42 secs...but that could be loading the model on first run...but notice atleast the vram usage isnt off the wall crazy like subsequent gens batch size 6....Time: 3m 53.29s | GPU active 49398 MB reserved 3424 | used 5124 MB free 19440 MB total 24564 MB | retries 0 oom 0...clearly it dumped it to ram and used 49 gigs to make 6 imgs... For comparison: auto1111 -- batch size 8 ..every setting identical.. My guess is that it appears to be reserving VRAM then not using what it reserved...I could be completely wrong. Figured I would add this here for info.... My specs are i13 , rtx 4090, 128g ddr6...windows 11.. |
Beta Was this translation helpful? Give feedback.
-
@zethfox first run:
second run:
i think its safe to say i cannot reproduce. |
Beta Was this translation helpful? Give feedback.
-
@ChiaYen-Kan regarding your first issue, not sure if i can help, the simple fact is that torch-directml is bad with memory (it forces everything in fp32 as it does not have proper fp16 implementation for all operations and autocast is non-functional). i've been waiting for update to torch-directml for a while, but there is nothing for months. |
Beta Was this translation helpful? Give feedback.
-
i have problem is about memory usage
i use second pass and hires fix to upscale image in txt2img
but even all prompt and the setting of second pass is same, sometime is success, sometime is "out of memory"
even after success generate image can't run again with same setting, second time is always "out of memory",
i need restart program to reset everything for run again txt2img
anyone have any good way to avoid "out of memory"?
Platform:
cpu: AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD (amd ryzen 5 5600g without other gpu)
system: Windows
release: Windows-10-10.0.19045-SP0
python: 3.10.11
system memory is 48g, assign 16g for internal GPU, use directml
Backend: Original
Model: SD 1.5
the log is direct run second time without reset program
first time is succeeded, second time is "out of memory"
Beta Was this translation helpful? Give feedback.
All reactions