-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not allocate tensor with 377487360 bytes. There is not enough GPU video memory available! #38
Comments
me 2 |
try add here is my example(5500XT): |
First - the arguments. |
The above arguments got it working for me when doing single pictures. Batches still fail but it at least works (even on a 5800X, running this on CPU was painful...) Tried with --lowvram with same results. Running an RX 580 8GB |
|
Thank you, RX 570 (8) ok |
in my case, my computer: R2700 + RX6800 + 16GB ram, windown 10. i can generated image as 512 x 512 normaly but size image bigger, i can't generate. error: ....There is not enough GPU video memory available. hmm, rx6800 has 16G Vram. |
Some cards have their own quirks, search the mentions of your card in the discussions. The latest collection of arguments the community have come with is |
It is unfortunately because of the memory inefficiency of DirectML (what made this repo possible in the first place). Not able to use xformers also hurts performance and VRAM usage too. What's weird is that when I run with 6900XT I noticed the "shared GPU memory" was being used (only for about 2GB, but still). This is not the case when I run regular A1111 webui with a 3060. May be you can generate 512x512 and try to upscale in img2img using SD upscale (In the Script section at the bottom of img2img tab). |
thanks. me to. i use rx6800 - 16GB . i think that shared ram is avaiable because i see on tab manganer. shared ram is dont used. max size image is about 420.000 with width x height. Do u think so? |
my 6800 ,win 11 pro, 22H2 1, git pull to ensure latest update <- it was at this point I knew I effed up during initial setup because I saw several missing items getting installed. result 1024*1024 euler a ---- MAX 26/26 [01:16<00:00, 2.96s/it] with my trained model .cpkl model deliberate_v2 .safetensors I usually generate 440 * 640, 4 pictures each and then the necessary upscale from Topaz Photo AI Good luck p.s. 1280*1280 RuntimeError: Could not allocate tensor with 377487360 bytes. There is not enough GPU video memory available! -))) |
same exactly for me |
Guys, have you tried the extension for tiled VAE? It should dramatically reduce VRAM usage |
Also having this problem Running Radeon 7900 XTX Nitro+ (24GB VRAM) If I set very high resolution (e.g. above 1280) I will likely crash |
Recently I've revealed another combination of the arguments that (seemingly) allowed me to run the basic f-16 canny controlnet model without lowvram flag when I couldn't do it before. So, here it is: I'm not entirely sure if Also, if you want to generate really big images, use this (works for me) or that (doesn't work for me, but seems like objectively a better option) extension. In general most modern models are trained at 768x768 and don't handle well anything higher than 1024 pixels. |
hi. I just tried to generate some images and when the IA its close to end generating, this error jumps and i can't see any images that i could have generated, just the same error as this issue title. any idea? |
That error is same as OOM (Out of Memory). |
512x512 is too large for generating? i didnt know that |
It depends on available size of vram your gpu has. |
added both and nothing 🤷, my gpu is a rx 6600 |
My RX 5700 XT can generate 512x768 with hires fix x1.5 when I turned off everything without webui and necessary processes. |
Try these That at least helped me to generate bigger res or have it stay without error for much longer (but it might still crash) --opt-sub-quad-attention |
Thank you so much for sharing this. I used to be only able to do 512 x 512 images at 20 steps max before I would get out of VRAM. Now I'm doing 1024 x 768 at 50 steps... 1024 x 1024 still puts me out of VRAM though, but hey, it's a major improvement! :D |
i tried every argument in this issue, none of them work with any resolution image or any sampler, tried to change |
The only workaround to reach higher resolutions for now is using img2img Ultimate upscaler script. |
install a second system ubuntu ubunta 2004 + 6800 when generating 768 * 768, memory is spent 6.7 GB from 16 ,together with the system and two browsers that consume 3gb in idle time one thing but ,you have to put it manually, auto-installation from the topic does not work this is my compilation from different sources, tested on my 6800 :-) install ubuntu 20.04
you can put 5.4.3 but everything suits me
name: gfx1030 --ok
add alias python=python3 save x - y - enter
if pytorch 2.0.0+5.4.2---ok
if the cards are not the 6000th line try or
add in webui-user.sh export HSA_OVERRIDE_GFX_VERSION=10.3.0 save launch - double click webui.sh - run in terminal increase in generation rate in 0.33 it/s -win vs 6.8-7 it/s ubuntu 512*512 Good luck! |
the sd webui in win10 will work after I shutdown wsl, even if sd didn't free the memory. wsl and directml in win may not work together. |
Maybe read the discussion again...? We know the issue is from DirectML not releasing memory, so by cutting down memory usage in the first place, DirectML also hog less memory. Think step 1 taking 1GB of VRAM instead of 1.5GB, etc... you will be able to go 12 steps instead of 8. Also optimizing memory is the only actionable the mass can do. Or are you suggesting everyone to go fixing DirectML instead? |
try to delete the venv folder and then run the bat again or maybe also the repositories folder, but not sure if that's needed |
i delete the venv, run the bat again venv "C:\Users\lin\stable-diffusion-webui-directml\venv\Scripts\Python.exe" the massage shows [notice] A new release of pip available: 22.2.2 -> 23.1.2 |
and try to delete repository folder? |
it happen only one time. venv "C:\Users\lin\stable-diffusion-webui-directml\venv\Scripts\Python.exe" No module 'xformers'. Proceeding without it. Initializing Dreambooth Does your project take forever to startup? [!] xformers NOT installed. Launching Web UI with arguments: --lowvram --precision full --no-half --no-half-vae --opt-sub-quad-attention --enable-insecure-extension-access --deepdanbooru --disable-nan-check --backend directml To create a public link, set my PC |
Thanks for this info. I was at 3284ccc, and now after update, I also got the super slow generation of ~7 seconds per iteration. After copying your optimization settings I am able to return to similar generation speeds as before of ~2 iterations per sec. However I find like you that all ControlNet attempts now fail with GPU OOM errors (I can't upscale, not even with tiled upscaling etc). |
True, Controlnet is unusable in the current commit, no matter the model or resolution. Also the size of the possible image sizes has decreased in general (Can't render anything in 1024p anymore). But at least |
man stable diffusions a bitch |
I urge you all to try |
But supports AMD GPUs? |
I repeat, it's multiplatform and can be run in Rocm and DirectMl modes. That implies that AMD cards are supported. Using it right now myself. |
I am getting this error when doing image generation. It seems like memory isn't being released after image creation. |
Inside the webui_user.bat:
Works for me with a 6800XT card (16GB). Any of the other commandline args I see other people use make the program completely hang and refuse to generate anything, so if you have the same card as I do, just use what I put in the codeblock ;) |
After the token merging update you pretty much have to set token merging to about 0.5 and negative segma to about 3 (Optimizations tab in Options). Gives a great boost in performance and memory efficency without sacrificing much. But you can't use the subquadratic optimization with token merging. |
This seems to break my install; lots of black images.
…On Tue, Jul 18, 2023 at 7:01 PM Miraihi ***@***.***> wrote:
After the token merging update you pretty much have to set token merging
to about 0.5 and negative segma to about 3 (Optimizations tab in Options).
Gives a great boost in performance and memory efficency without sacrificing
much.
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7COGLQOJOYKGVY7KGYTYTXQ4IUTANCNFSM6AAAAAAVW7YLEU>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
This doesn't seem to be helping much. I have less crashes, but more empty
black images. I have a 6700XT (12GB) if that helps explain it.
…On Tue, Jul 18, 2023 at 6:58 PM Eleiyas ***@***.***> wrote:
Inside the webui_user.bat:
set COMMANDLINE_ARGS=--medvram --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check
set SAFETENSORS_FAST_GPU=1
Works for me with a 6800XT card (16GB).
I can now actually generate stuff over 512*512 without it immediately
crashing. Still get some issues, but I can generate 10s of images before it
even thinks of being weird.
Any of the other commandline args I see other people use make the program
completely hang and refuse to generate anything.
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7COGJJVWXKNZCH5YNJHWLXQ4IINANCNFSM6AAAAAAVW7YLEU>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
@Grathew I mentioned that you can't use sub-quad-attention with token merging. Choose Doggetx or V1. If you're not aware, only one of |
I reinstalled the new version of AMD DRIVER, and the pictures can appear normally with a resolution of 960X540 and my graphics card RX5500XT 4GB. |
I just fix mine using this arg(set COMMANDLINE_ARGS= --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check) I'm been trying to generate for a couple days with out any progress, after adding the arg , i now can generate 512x512 hire fix 1024x1024(upscale by 2)8 count, up to 50 step, using 3 control net no problem, im using the latest amd driver 23.9.3,lates chipset, spec( windows 11,cpu amd 5800x-gpu asus dual 6700xt oc- 32g ram) controlnet 1.1.410! a1111 fork from lshqqytiger , check point 1.5, 2.0, 2.1(sdxl no luck, still testing) hope it help |
I am having a similar issue. I have an RX 580 that has 8gb of vram, and 2x16gb ram. About 5 days ago, I was still able to generate images well above 768x512, and can even upscale it to around... 4x I believe, no issues at all. But all of a sudden, yesterday, it just stopped working, claiming that I don't have enough GPU video memory available. I tried uninstalling everything, (python 3.10.6, git, and stable diffusion), and then reinstalled everything. It still didn't work. I'm really hoping that this isn't a graphics card problem, which I think it really isn't because, I can run triple A games pretty smoothly without crashes or anything, so maybe it has something to do with Stable Diffusion's latest updates and all that. |
i have rx580/8gb and 2x8 ram, tried arguments mentioned before and it works kinda well for me (at least i can generate 600x800 now, in the past i was getting an error every 2-3 512x512 images and on 600x800 it was straight error). Also im using official SD.NEXT if its important |
same error with memory allocation. No way to chunk this data? |
I can't find the webui-user.bat file |
Thank you!! Got me up & running on my AMD RX 6600 (finally) |
So I went ahead and tried this solution, and it was after I did "pip install -r requirements.txt" step when things went wrong for me. Now whenever I run webui-user.bat it spits out this:
|
i followed this tutorial : and then added For the webui-user.bat file, I added the following line set when i add --medvram --precision full --no-half --no-half-vae --opt-split-attention-v1 --opt-sub-quad-attention --disable-nan-check prompt its only working in 1.5 models but not in XL models.Adding the prompt speeds up the generation significantly.but losing the xl models. rx 6800 gpu |
U fixed this? |
For me it was it the simple combo of adding --medvram to the bat file and checking the LVRAM box in Controlnet. I installed Controlnet last night. Come morning I was getting the OP's error. This worked. Ryzen 3600, RX580,16G. |
Does a low-memory graphics card can running only on the CPU? |
Is there an existing issue for this?
What happened?
Stable diffusion crash, after generating some pixel and appear error : Could not allocate tensor with 377487360 bytes. There is not enough GPU video memory available!
Steps to reproduce the problem
What should have happened?
Stable diffusion running normally, and generating some image
Commit where the problem happens
RuntimeError: Could not allocate tensor with 377487360 bytes. There is not enough GPU video memory available!
What platforms do you use to access the UI ?
Windows
What browsers do you use to access the UI ?
Microsoft Edge
Command Line Arguments
List of extensions
No
Console logs
Additional information
RX 570 4GB
Ryzen 5 3500
RAM 8GB single channel
Driver AMD Software PRO Edition
DirectX 12
The text was updated successfully, but these errors were encountered: