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

[Bug]: There is not enough GPU video memory available!

Open Arion107 opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

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

What happened?

Hello, I am in Windows 10 running the version of Install and Run on AMD GPUs, my GPU is an RX6600 and I have followed the steps that they put there, everything is installed but when it gives me the local link, a little higher up in the cmd I get: Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled Do not module 'xformers'. Proceeding without it.

And when I paste the local link and try to create something, it stays at 0% and messages from File and file locations start to appear in the cmd and at the end of everything it tells me

There is not enough GPU video memory available!

What could I do to solve this error?

And to take advantage of this message I have been trying to do this that says To create a public link, set share=True in launch(). But I do not know how to do it. And that's all, I hope you can help me and thank you.

Steps to reproduce the problem

  1. Double click on webui user.bat 2.Paste local link in google 3.Attempting to create an image by typing a prompt 4.Gives the error mentioned in the pastebin

What should have happened?

Having created the requested prompt without problem

Commit where the problem happens

ff558348682fea569785dcfae1f1282cfbefda6b

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No

List of extensions

I put a ckpt file where it belongs and it runs fine so I don't think that's the problem

Console logs

https://pastebin.com/Rr6wA3nB

Additional information

No response

Arion107 avatar Mar 08 '23 23:03 Arion107

Create a new text file and introduce the following

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS= --medvram --no-half --precision full --no-half-vae --opt-sub-quad-attention --opt-split-attention-v1 --autolaunch 

call webui.bat

If you have 6GB of RAM or less, then change ¨medvram¨ with ¨lowvram¨ Save as a .bat file in the installation folder and open it.

Apokkayps avatar Mar 09 '23 02:03 Apokkayps

Thanks for the help, it already generates images without giving me that error, but the problem now is that a simple image of 30 steps takes almost 10 minutes and my GPU is an RX 6600 8GB, it tells me in the cmd that I have 14.68s/it but it is very very slow, any solution to be able to use it well?

Arion107 avatar Mar 09 '23 08:03 Arion107

I have a GeForce GTX 1060 3GB under Win10 and I'm able to reliably run SD with only the Low VRAM (medram) option.

image

However I am limited to a resolution of 512x512 res (batch size 8), or a 512x768 res (batch size 2).

I'm also limited to using only a few Sampling methods: Euler and DPM++ 2S a Karras (that I've tried).

I also limit the steps to under 80 for Euler and under 20 for DPM++ 2S a Karras - but I find that's plenty for photo realism.

Up-scaling is a challenge though.

Maybe this helps you or others with similar limitations. If this helped at all, please buy me a better GPU! ;p

andyg2 avatar Mar 09 '23 12:03 andyg2

Thanks for the help, it already generates images without giving me that error, but the problem now is that a simple image of 30 steps takes almost 10 minutes and my GPU is an RX 6600 8GB, it tells me in the cmd that I have 14.68s/it but it is very very slow, any solution to be able to use it well?

I can't help you without more information, however, if the generation runs slow on a RX 6600, make sure that the device works properly by checking the load of it in the task manager during generation. Also be sure to close any background processes. Then be sure to run small resolution images, try with 512x512 and increase slowly

Apokkayps avatar Mar 09 '23 17:03 Apokkayps

I am trying with 512x512 right now with 20 steps and only the word car and it goes to 1.30it/s and the GPU tells me that it is at 99%, it doesn't make any sense I think, I would have to go at least 4 or 5 it/s minimum, and when the image loads 20/20 it gives an error and in the end it does not give the image even though you can see how it was loading, here is a copy of the cmd with all the error and information, I would greatly appreciate the help, thanks.

https://pastebin.com/ixRCpt2x

Arion107 avatar Mar 09 '23 19:03 Arion107

Have the same problem here with a 16GB 6950XT, it is very quick to error out "There is not enough GPU video memory available".

FaceFoiled avatar Mar 09 '23 22:03 FaceFoiled

I am trying with 512x512 right now with 20 steps and only the word car and it goes to 1.30it/s and the GPU tells me that it is at 99%, it doesn't make any sense I think, I would have to go at least 4 or 5 it/s minimum, and when the image loads 20/20 it gives an error and in the end it does not give the image even though you can see how it was loading, here is a copy of the cmd with all the error and information, I would greatly appreciate the help, thanks.

https://pastebin.com/ixRCpt2x

It works perfectly fine. 1.30it/s is a very decent rate (you will need 16+GB of vram to generate 1080x1080 images at a fast pace😅). The error you get is due to the outdated python and pytorch version. Update those, reinstall xformers library and it should work just fine. You can also just avoid loading xformers, by suppressing the argument from the command line, if you want to avoid the updates. Also make sure you use a model that works with its own VAE. If the model you have dowloaded requires a specific VAE, then the image will break just before ending the generation. And with that, I hope you can close this issue, so that others like @FaceFoiled read through it 😮

Apokkayps avatar Mar 09 '23 23:03 Apokkayps

Did not know some models require specific VAE's, certainly something to look into. That's a golden tip :D. Will figure out how to update things here as well. Was hesitant to try as I was not sure it would break the AMD build (guide from wiki/Install-and-Run-on-AMD-GPUs )

FaceFoiled avatar Mar 09 '23 23:03 FaceFoiled

https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8409

2blackbar avatar Mar 10 '23 11:03 2blackbar

I tried the text saved to .bat and so far that has fixed the crashing issue. I've generated about 5 sets of 2 images in a row and no crashing. Vram memory usage maxes out at 11.3/12.

sheldoncoops avatar Mar 28 '23 02:03 sheldoncoops

I have a GeForce GTX 1060 3GB under Win10 and I'm able to reliably run SD with only the Low VRAM (medram) option.

image

However I am limited to a resolution of 512x512 res (batch size 8), or a 512x768 res (batch size 2).

I'm also limited to using only a few Sampling methods: Euler and DPM++ 2S a Karras (that I've tried).

I also limit the steps to under 80 for Euler and under 20 for DPM++ 2S a Karras - but I find that's plenty for photo realism.

Up-scaling is a challenge though.

Maybe this helps you or others with similar limitations. If this helped at all, please buy me a better GPU! ;p

Sorry but how do I access this graphical launcher? I'm just adding my options directly to the .bat file.

M4CC avatar Apr 01 '23 16:04 M4CC

I have a GeForce GTX 1060 3GB under Win10 and I'm able to reliably run SD with only the Low VRAM (medram) option. image However I am limited to a resolution of 512x512 res (batch size 8), or a 512x768 res (batch size 2). I'm also limited to using only a few Sampling methods: Euler and DPM++ 2S a Karras (that I've tried). I also limit the steps to under 80 for Euler and under 20 for DPM++ 2S a Karras - but I find that's plenty for photo realism. Up-scaling is a challenge though. Maybe this helps you or others with similar limitations. If this helped at all, please buy me a better GPU! ;p

Sorry but how do I access this graphical launcher? I'm just adding my options directly to the .bat file.

I have a shortcut to the launcher, my installation dir is c:\A1

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\A1\Launcher\LauncherUI.ps1"

andyg2 avatar Apr 01 '23 19:04 andyg2

@Apokkayps Thank you so much! I was looking for solutions for hours!

Comm0ner avatar May 14 '23 20:05 Comm0ner

I have a rx 6600 as well and had some struggles to create some pictures as well. have the directml fork from lshqqytiger. and have found that these arugments work the best for my setup.

set COMMANDLINE_ARGS= --medvram --backend directml --no-half --no-half-vae --precision full --opt-sub-quad-attention --opt-split-attention-v1 --disable-nan-check --no-gradio-queue --sub-quad-q-chunk-size 256 --sub-quad-kv-chunk-size 256 --sub-quad-chunk-threshold 70 --theme dark --autolaunch

codetwentyfive avatar Aug 08 '23 23:08 codetwentyfive

Hi, I have the same problem. I have a 12Gb RTX 4070 OC but I can't create because it tells me I have no memory. Not being an expert in programming, could you explain to me very easily how to remedy this problem? Photos are also welcome

OtakuOW avatar Nov 22 '23 21:11 OtakuOW

I have a rx 6600 as well and had some struggles to create some pictures as well. have the directml fork from lshqqytiger. and have found that these arugments work the best for my setup.

set COMMANDLINE_ARGS= --medvram --backend directml --no-half --no-half-vae --precision full --opt-sub-quad-attention --opt-split-attention-v1 --disable-nan-check --no-gradio-queue --sub-quad-q-chunk-size 256 --sub-quad-kv-chunk-size 256 --sub-quad-chunk-threshold 70 --theme dark --autolaunch

Im trying to run Fooocus on my RX 6500XT 4GB and facing not enough gpu video memory issue. where should i add these ARGS?

my run.bat is

.\python_embeded\python.exe -m pip uninstall torch torchvision torchaudio torchtext functorch xformers -y .\python_embeded\python.exe -m pip install torch-directml .\python_embeded\python.exe -s Fooocus\entry_with_update.py --directml pause

R00baN avatar Jan 05 '24 09:01 R00baN

I have the same problem, but on a 7900 XTX, it appears according to task manager the GPU is not flushing the VRAM after finishing, can anyone confirm the same? It also appears to be using a ridiculoso amount of resources for even simple tasks, tasks that I could previously complete on a 1070 non TI, is the way SD currently uses AMD cards just that ineficiente with out xformers? I have images I have completed in decent time with upwards of 50 sampling steps and around 700x500 resolution, but not only can't I generate them at all with the XTX sometimes but they seem to be generating rather slow (1.75s/it).

RafaelSousa1 avatar Jan 14 '24 17:01 RafaelSousa1

Same issue on 8GB RX580. Using --lowvram helps, but surely 8GB should be enough for at least --medvram. Memory leak somewhere?

GrapheneCt avatar Jan 16 '24 00:01 GrapheneCt

Hey, I have a problem and don't know how to solve it. I hope someone can help me. I have an RX 6950 XT 16GB. My parameters are:

set PYTHON= set GIT= set VENV_DIR= set COMMANDLINE_ARGS= --use-directml --opt-sub-quad-attention --autolaunch --medvram --no-half git pull

I can generate images with low resolution, but it stops at 800. It loads up to 90% and then an error occurs:

RuntimeError: Could not allocate tensor with 2066743296 bytes. There is not enough GPU video memory available!

RominaMinka avatar Jan 16 '24 20:01 RominaMinka

hi, try these settings:

@echo off

set PYTHON= set GIT= set VENV_DIR= set COMMANDLINE_ARGS= --autolaunch --xformers --no-half-vae set OPTIMIZED_TURBO=true

call webui.bat

It doesn't hurt to try :)

OtakuOW avatar Jan 16 '24 20:01 OtakuOW

Thanks for your answer, I tried it but unfortunately it doesn't work because xFormers is not compatible with my graphics card.

RominaMinka avatar Jan 16 '24 21:01 RominaMinka

Thanks for your answer, I tried it but unfortunately it doesn't work because xFormers is not compatible with my graphics card.

Yea xFormers is only for Nvidia GPUs. It might be worth a try to add --reinstall-torch after --use-directml, I did that for mine and got some improvements.

It's still far from perfect, my XTX is only comparable to my old 1070 speed wise, and the VRAM usage is still atrocious, but I can actually do most of the images I was doing before keeping the sample steps and res with out it failing. Upscaling is still a bit hit or miss, most of the time it finishes but it takes much longer than intended because somehow it's eating all 24GB of VRAM to do it.

Hope that helps somehow.

RafaelSousa1 avatar Jan 16 '24 21:01 RafaelSousa1

Let's hope you find someone who has solved the problem, and who can tell you the solution :)

OtakuOW avatar Jan 16 '24 23:01 OtakuOW