-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Not enough gpu memory even though there is? #1278
Comments
Same issue |
same here, got 5700TX 8gb |
AMD cards are running into a memory loop issue. I think the devs are aware, if they're going to do anything about it? Not sure. |
Try this version of the app -> https://github.com/lllyasviel/Fooocus/tree/9660daff94b4d0f282567b96b3d387817818a4b3 |
It's been broken for 2 months? That's disappointing. Something somewhere almost seems hard coded to that memory amount, I get the same error. You can't even tell it to use CPU mode. And if you try --lowvram, it thinks you want nVidia again. |
RX5700TX 8gb RuntimeError: Could not allocate tensor with 26214400 bytes. There is not enough GPU video memory available! |
There have been some posts related to this issue. Some versions have this corrected some don't. Rolling back to the commit I mentioned solved it for me. Also something that's different bettween your error and mine is that my image generates almost fully. I only get the error after the image generation completes. It doesn't save it cause it tries to move the model and then crashes. You can't even get past the generation process right? It just straight up crashes. |
Sorry for the stupid question but how do i roll back fooocus? |
Same issue here |
You may use these lines : git checkout 9660daff94b4d0f282567b96b3d387817818a4b3
python entry_with_update.py |
when I try this branch on a clean install, I get File "D:\Fooocus_win64\python_embeded\lib\site-packages\torch\cuda_init_.py", line 239, in _lazy_init |
the latest version is tested with 2060 |
thank you for the response. I think most of the people in this list have Radeon GPUs. if it helps to have the full message, this is what I am seeing: Traceback (most recent call last): |
"Torch not compiled with CUDA enabled" |
I do have a NVIDIA GeForce RTX 2060, with 6Gb do you think I can run the model ? I miss 20 mb... is there a way to quantize unet weigths ? |
the latest version is tested with 2060 |
reverted all of my local changes, re-ran the setup. I am back to my original error message, if this helps: Traceback (most recent call last): |
(fooocus) [pierre@archlinux Fooocus]$ python entry_with_update.py --gpu-only --bf16-unet --bf16-vae --use-pytorch-cross-attention Thanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB To create a public link, set |
if any AMD card says "Could not allocate tensor with X bytes. There is not enough GPU video memory available" current amd is still experimental and does not works as good as nvidia. however we promise best support across all software, that is, if you are able to use same AMD device in automatic1111 or comfyui or invoke or sdnext or etc, to run sdxl successfully, please let us know and we will support it. however, if all software fail to run sdxl on your device, then we have no method to make it work. also, the linux version of fooocus uses rocm, and may have better support for amd. |
thank you for the answer. I will try to create a Linux VM later today or tomorrow. Do you recommend any specific flavors of linux? Great work. I'm looking forward to being able to use it successfully. |
This log indicates that you are mislead by some bad turorials, and you have already broken your envs with wrong command flags. |
Sorry, but can someone tell me how to uninstall fooocus from windows? It is enough to just delete the files i downloaded? |
I sure hope this gets fixed for AMD. With nVidia leaving the consumer graphics card space, we are left with AMD and Intel. |
same. In the mean time, I've used the --cpu switch, which takes roughly 50s/it with an AMD 7950. This ends up being ~25 minutes to find out how the code interprets my prompt. |
I went down the rabbit hole on this. SDXL claims they do not support AMD cards on Windows. And the Linux version is reportedly very broken, requiring you to use specific versions based on your graphics card. |
I would like to know that too. A nice clean uninstall :) |
hi deleting the folder is a clean uninstall if users follow the official installation guide |
I think i've missed a step in the setup where the Windows AMD says see previous in a recursive reference.... at any rate, from the Linux AMD section it says to run this command: when I enter the first, it shows I have the CU builds, which is clearly part of the problem. When I run the second, it says there is no version matching "none": what do I need to add to this second command to get these dependencies? Thank you |
Hi, for Windows AMD, please follow the section "Windows(AMD GPUs)" for Linux AMD, please follow the section "Linux (AMD GPUs)" if you see "Could not find a version that satisfies the requirement torch", then you are using linux guide for windows, and that will not work. |
thank you for the fast answer. when I run the command listed: it still tells me it is looking for Cuda. In my reading of the Windows AMD install, it says download and then run the commands copied above. If I do not need to download these extra WHL files, can you tell me what step I've missed in order for the code to not look for Cuda dependencies? the "--always-no-vram" switch appears to be new but always triggers the Cuda message Thank you |
no. you do not need to run any commands. The instruction of “Windows (AMD GPUs)” is edit the “run.bat” and double click the “run.bat”. Please follow the guide exactly, and if it does not work, paste the full log. |
when run with a "--cpu" switch (which was working last night to bypass the fact AMD GPUs do not work), I now gets this message D:\Fooocus_win64>.\python_embeded\python.exe -s Fooocus\entry_with_update.py --directml --preset anime --cpu |
when run without the switch, I see a memory exception on a 8GB Radeon 6650XT Traceback (most recent call last): |
hi if any AMD card says "Could not allocate tensor with X bytes. There is not enough GPU video memory available" current amd is still experimental and does not works as good as nvidia. however we promise best support across all software, that is, if you are able to use same AMD device in automatic1111 or comfyui or invoke or sdnext or etc, to run sdxl successfully, please let us know and we will support it. however, if all software fail to run sdxl on your device, then we have no method to make it work. also, the linux version of fooocus uses rocm, and may have better support for amd. |
I am a complete newbie on this. After you mentioned testing other SDXL projects, currently this one runs on my machine: it appears to be a project that split from automatic1111, and it is able to use my GPU without crashing. Is that a helpful data point? |
sure. what configuation you are using with it? which SDXL checkpoint? |
the default setting were working. It used something called v1-5-pruned-emaonly. Where should I check to find the checkpoint? (I had assumed it would be latest) When I turned on additional things (none of which I understand), it got 80% into rendering but did give an out of memory. |
v1-5-pruned-emaonly is not SDXL. it is a SD1.5 model. SDXL is 3x larger and requires 3x more resources to get better results. however if SD1.5 works on your device, you may just stick to that UI and use it. |
@lllyasviel I have Windows11 and 12GB AMD GPU producing the same error with not being able to allocate enough memory However I was able to run AUTOMATIC1111 SD webui SDXL (6+GBs) models with these settings inside the bat file:
Its important to note that the SDXL models I successfully used in sd-webui, were the same models Fooocus uses, copied and pasted! My machine can run the same Fooocus models, but in a different project. Meaning <16GB vram AMD GPUs CAN handle SDXL. It seems to be a matter of some tricky memory settings. I am a programmer and could try to provide some help, although this is not at all my area of expertise. I'd love to be able to run Fooocus as I've heard very good things about it, producing great results and is much simpler to use. Love your project ❤️ |
ROCm on Windows (either via DirectML or via ROCm Windows SDK) generally performs worst than ROCm on Linux. I understand this may not be an option for everyone, but if you can, when using AMD hardware you will almost always have a much better experience running Fooocus (or almost any AI that needs GPU acceleration) on Linux compared to on Windows. |
link is broken. Does not exist anymore (link is OK then the windows download link is broken :-( |
It works on my 6700xt now, this issue was resolved for me with the latest version. |
Yes, seems like this has been fixed in the newest version. Can use Fooocus on Windows with AMD GPU now! |
what AMD GPU are you using? |
AMD Radeon RX 6700 XT |
@CasualVult is this issue still present for you using the latest version of Fooocus or can it be closed? |
I have an 6700XT, it has more than enough vram even though I'm getting this error and I did that fix where I allocated 8gb instead of 1
[Fooocus Model Management] Moving model(s) has taken 59.70 seconds
0%| | 0/30 [00:07<?, ?it/s]
Traceback (most recent call last):
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\async_worker.py", line 803, in worker
handler(task)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\async_worker.py", line 735, in handler
imgs = pipeline.process_diffusion(
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\default_pipeline.py", line 361, in process_diffusion
sampled_latent = core.ksampler(
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\core.py", line 315, in ksampler
samples = fcbh.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\sample.py", line 100, in sample
samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 711, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\sample_hijack.py", line 151, in sample_hacked
samples = sampler.sample(model_wrap, sigmas, extra_args, callback_wrap, noise, latent_image, denoise_mask, disable_pbar)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 556, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\k_diffusion\sampling.py", line 701, in sample_dpmpp_2m_sde_gpu
return sample_dpmpp_2m_sde(model, x, sigmas, extra_args=extra_args, callback=callback, disable=disable, eta=eta, s_noise=s_noise, noise_sampler=noise_sampler, solver_type=solver_type)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\k_diffusion\sampling.py", line 613, in sample_dpmpp_2m_sde
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\patch.py", line 329, in patched_KSamplerX0Inpaint_forward
out = self.inner_model(x, sigma,
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 267, in forward
return self.apply_model(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 264, in apply_model
out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 252, in sampling_function
cond, uncond = calc_cond_uncond_batch(model, cond, uncond, x, timestep, model_options)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\samplers.py", line 230, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep, **c).chunk(batch_chunks)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\model_base.py", line 68, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\modules\patch.py", line 459, in patched_unet_forward
h = forward_timestep_embed(module, h, emb, context, transformer_options, output_shape)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\openaimodel.py", line 37, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\attention.py", line 560, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\attention.py", line 390, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\diffusionmodules\util.py", line 123, in checkpoint
return func(*inputs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\attention.py", line 455, in _forward
n = self.attn1(n, context=context_attn1, value=value_attn1)
File "E:\AI\Fooocus_win64_2-1-791\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\attention.py", line 366, in forward
out = optimized_attention(q, k, v, self.heads)
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\attention.py", line 177, in attention_sub_quad
hidden_states = efficient_dot_product_attention(
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\sub_quadratic_attention.py", line 244, in efficient_dot_product_attention
res = torch.cat([
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\sub_quadratic_attention.py", line 245, in
compute_query_chunk_attn(
File "E:\AI\Fooocus_win64_2-1-791\Fooocus\backend\headless\fcbh\ldm\modules\sub_quadratic_attention.py", line 160, in _get_attention_scores_no_kv_chunking
attn_probs = attn_scores.softmax(dim=-1)
RuntimeError: Could not allocate tensor with 165150720 bytes. There is not enough GPU video memory available!
Total time: 77.58 seconds
The text was updated successfully, but these errors were encountered: