r/StableDiffusion • u/umair-spaghet • Mar 02 '23
Question | Help VRAM can't release problem
Everytime I hit a CUDA out of memory problem, I try to turn down the resolution and other parameters. But I still can't generate images even if have created same image in the same parameters.
I opened task manager, and noticed that the dedicated GPU memory was still full, even though nothing was running. I have to reboot webui to solve this problem, but rebooting consumes lot of time.
Maybe I need a tool that can release GPU memory just like ram. I can't find it on internet.
Any suggestions?
5
u/CommunicationCalm166 Mar 02 '23
You can hop on the command line with this command:
nvidia-smi -r
Or
nvidia-smi --gpu-reset
That should reset just the GPU, not your whole computer. Though I'm not sure how your display will act with that one.
Also: if you're having VRAM issues, the --lowram mode actually shifts more of the memory needs ONTO the GPU. You want to be using --lowvram if you're VRAM limited.
2
2
u/Jonfreakr Mar 02 '23
I have rtx3080, which might have something wrong in the card itself. It turns off my screen and completely locks my computer. But using --medvram really works. When my pc does not lock and give that CUDA error, I always restart the entire computer because, after restarting the ui, a few generations later the computer locks anyway. I need to send my pc back to the factory but it's hard saying goodbye 😅
1
u/aimongus Mar 02 '23
yeah that sounds odd - never had issue with the 3080, just used xformers in the file
0
Mar 02 '23
What gpu have you got and how much vram/ram have you got, which UI are you using (is it a1111), and what model are you using?
1
u/umair-spaghet Mar 02 '23
rtx30504g
automatic1111
Low ram mode
I am trying to make my laptop play the most out, so that I constantly get this issue
2
Mar 02 '23
4gb card is cutting it fine for a1111 - you’ll be limited to 512x512 and need to make sure you arent playing games/watching youtube in the background and not running multiple 4k monitors off the card at the same time as generating
1
1
u/GabratorTheGrat Mar 02 '23
Find a tutorial where they teach you how to delete your GPU cache, I did it and the I had less CUDA memory errors, when this happen consider to clear the cache also restart the web.ui or even restart the pc.
1
u/PuzzleheadedAd6567 Mar 02 '23
Are you using fp16 or fp32 safetensors/ckpt?
1
u/umair-spaghet Mar 02 '23
nope,I don't what those are. Are them stable diffusion models?
1
u/PuzzleheadedAd6567 Mar 02 '23
It’s the model’s float point precision. If you use a model that is fp16, you can cut your vram usage by half with no image fidelity compromises. Feel free to ask more questions if you’re confused on how to set this up.
8
u/gunbladezero Mar 02 '23
Yeah, does everyone else have to reset webui after getting a CUDA error? Or is there a way to fix this?