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

CUDA OOM with somehow 17GB VRAM free

Open mnielsendev opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Whenever I try to generate at certain resolutions or batch sizes, I get a CUDA out of memory error that shows I have more than enough memory free. I'm not even trying to do anything crazy here. I have 24GB VRAM (3090Ti) and I can't even generate 960x960 with a batch size of 1.

OOM

Considering my specs (see below), this makes no sense. The OOM error even contradicts itself saying I am out of memory when I clearly have 16.99GiB free. I'm not running anything else and it occurs even right after a fresh reboot.

I've tried using --medvram, --lowram, --opt-split-attention all without any difference. I thought it might have to do with my cuda cache but even after rebooting or even manually clearing the cache, the problem persists. From talking with others, it seems I'm not the only one with this issue, and like the others, none of the command-line arguments nor common solutions have fixed it. Short of further upgrading my system, I tried everything suggested in #1259, #598, and any other remotely related issues with no luck.

Please help.

Steps to reproduce the problem

  1. Acquire Nvidia 3090Ti and 16GB RAM
  2. Running Windows 10, install Python 3.10.6, acquire SD model, clone WebUI repo ac085628540d0ec6a988fad93f5b8f2154209571 (latest head/master at time of writing)
  3. Reboot computer
  4. Launch WebUI webui-user.bat
  5. Set batch size to 1, resolution to 960x960
  6. Hit generate and look at the terminal log

What should have happened?

Images at greater than around 960x960 batch size 1 should have generated without throwing CUDA OOM error. If thrown, error should not show that I do indeed have free VRAM memory available for use since I would otherwise expect it to be used for image generation.

Commit where the problem happens

ac085628540d0ec6a988fad93f5b8f2154209571

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox, Brave

Command Line Arguments

--medvram --lowram --opt-split-attention
tried both individually and together

Additional information, context and logs

Windows 10, Nvidia 3090Ti (24GB VRAM), 16GB RAM, Python 3.10.6, official SD 1.4 model from huggingface, commit ac085628540d0ec6a988fad93f5b8f2154209571 (latest at time of writing) WebUI build.

mnielsendev avatar Nov 10 '22 01:11 mnielsendev

Ive 12vram 3060 and get same error trying 512x640. 😅 So annoying,

AbyszOne avatar Nov 10 '22 02:11 AbyszOne

I think GPU memory isn’t freed ,same issue

Thakshara9728 avatar Nov 11 '22 07:11 Thakshara9728

#1259 looks like a very old issue, nevertheless, duplicate.

mezotaken avatar Jan 12 '23 23:01 mezotaken