deforum-stable-diffusion icon indicating copy to clipboard operation
deforum-stable-diffusion copied to clipboard

RuntimeError: CUDA out of memory

Open Warwarss opened this issue 2 years ago • 1 comments

I have an RTX 3050 4GB VRAM GPU. I tried to run the script with different width and height parameters (64x64, 128x128, 512x512) It did not help I have also did set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6,max_split_size_mb:128 The error i get is this RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 3.42 GiB already allocated; 0 bytes free; 3.48 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

What else can i do ? How can i solve this ?

Warwarss avatar Jan 17 '23 14:01 Warwarss

you simply do not have enough vram for this, try to use med vram or low vram setting

ReaLifecyborg avatar Mar 07 '23 22:03 ReaLifecyborg