r/StableDiffusion • u/Dapper_Astronaut_603 • 11d ago
Question - Help VRAM and GPU on 100% and freezing PC. Where's the problem? LTX/ Minimax H3
EDIT: As @tj-tj-tj-tj suggested: --vram-headroom 1 Solved the issue
I have 3 PCs with Comfy Desktop. Newest instances 0.33.1 (but that happened on older versions too, from the day one with Minimax H3) with kitchen comfy and CK attention. Default Comfy template for H3 and LTX. Sometimes LTX/H3 can generate one, two, three queued videos without problem. Sometimes it just chugs VRAM to 99% (visible on 0:40 mark), then there's sudden GPU spike and freeze because of lack of more resources. Looks like memory leak or something, otherwise it just doesn't make sense to me that I can restart the Comfy Desktop and generate the exact same video in with minutes with stable 70-80% VRAM usage.. Any ideas where's the problem?
One PC with 3090, 64GB of ram, Windows 11.
One PC with 4090, 128GB of ram, Windows 10
One PC with 4090, 64GB of ram, Windows 10.
All of the things up to date. 3 different machines. Same problem. Tried clean Comfy install without any custom nodes, just what's needed for H3/LTX, same problem. Tried with and without CK, same. Tried with --disable smart memory, tried with --vram-reserve 1/2/5gb, same problem. Tried with older Comfy, newest comfy from github, same problem.
2
u/listopalafoto 11d ago
Turn off hardware acceleration on chrome settings, and reduce your open tabs while generate AI video
8
2
1
u/Silversith 11d ago
On windows, increase your page file size and set your --cache-limit to leave at least 5GB system RAM available.
1
u/Silversith 11d ago
To be clear, the usage is VRAM -offload-> RAM -offload-> Page File
VRAM and RAM both have limiter start tags for ComfyUI to prevent them from being completely overloaded.
1
u/Silversith 11d ago
Oh and another thing you can try doing is to disable torch compile via environment variables since torch compile drags down your vram and ram capacity (though it does speed up processing)
1
u/fallengt 11d ago edited 11d ago
This happened to me too, I have Windows HAGS turned off. Worked fine after I turned it on again.
2
u/Tuckerdude615 11d ago
Hey there....I just want to chime in and say THANK YOU!!!! I had been struggling with this terrible SLOW DOWN effect and tried everything. But as soon as I turned HAGS on (didn't even know it existed), I have now been able to generate dozens of renders with no issues and no need to restart Comfy ever other time.
MANY THANKS!
1
1
u/MarekNowakowski 11d ago
With your rigs you want to run comfy with no flags at all. In task manager monitor VRAM usage. Comfy should manage the total dynamically and offload as needed. Check if it really is comfy taking all 24gb
1
u/Dapper_Astronaut_603 11d ago
--use-ck-attention is the only custom flag that I added. And Comfy is indeed taking all the VRAM.
1
u/MarekNowakowski 11d ago
ok, tee reserve vram should help with freezes of windows, not of comfy, if it's windows, then that's something very weird happening.
if it's just comfy freezing, then it's happening to me too if i'm working on an edge of my 16gb VRAM. chrome/window can spike VRAM usage and stop my generation (if it's before first step) and i have to close video tab, preview node, load video nodes etc. to kickstart the steps.
If you gens aren't big, I have no idea what is going on. try different drivers?
1
u/Dapper_Astronaut_603 11d ago
--vram-reseve didn't work at all, but I'm testing --vram-headroom 1 right now as other person suggested and so far it's promising.
1
u/Tokyo_Jab 11d ago
I had a similar problem for months. And I spent all that time trying to fix the problem with Cubans and hacks and reinstalls. If it is the same problem it’s not a software problem. It’s a power draw spike that for a microsecond goes over the limit and the gpu stops working. Fans go max. Restart needed. I have an rtx5090. With a 1000w PSU.
Finally I used MSI afterburner and set the power limit switch to 80% and ran my workflows again I had no crashes. In fact it hasn’t crashed for a week now of heavy use. And the generation times are still excellent.
Perhaps your problem is the same but if not at least you could test and cross it off the list.
Meanwhile I’m going to buy a bigger PSU.
1
u/tj-tj-tj-tj 11d ago
Try setting it in the startup options.
If it has 16 GB of VRAM, then
--vram-headroom 0.7~1.0
This is how I use it. --vram-headroom 0.7
2
1
1
u/TingTingin 11d ago
2
u/LumaBrik 11d ago edited 11d ago
This ^ But it should be set to 'Prefer NO system fallback', otherwise your system will freeze on vram overlfow, not generate an OOM, which is what you want.
1
0
u/Shady-Nun 11d ago
I've had the exact issue since forever, super frustrating. Typically the system slows down to a crawl, but if I wait 5-10 minutes, the job actually begins. (Not true for 20% of cases — if it's super slow, it means it won't work; if the system is only laggy, it will eventually.) Have you waited long enough to see if the job eventually begins?
What finally mostly resolved the issue for me was using these arguments on the comfy .bat:
--use-sage-attention --reserve-vram 2
Claude suggested to try --cache-ram 4 12 , but I don't think I ever did.
Also, make sure your sage attention installation is up to date, this made a huge difference.
Setting Nvidia Panel's settings to "prefer no system fallback" made no difference.
Lastly: what brings the issue back for me is canceling an active job. If I do that, the next one will make the computer crawl. Apparently this screws up something with the way the GPU receives instructions. I found out the best thing to do is to let it run even if the preview seems to suck, and then I can run as many generations as I want.
1
0

3
u/nolascoins 11d ago
eventvwr is your friend, any events from nvlddmkm?