Skip to content
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 using GPU #1839

Closed
MasterRed0 opened this issue Jan 9, 2024 Discussed in #940 · 11 comments
Closed

Not using GPU #1839

MasterRed0 opened this issue Jan 9, 2024 Discussed in #940 · 11 comments
Labels
wontfix / cantfix This will not be worked on

Comments

@MasterRed0
Copy link

MasterRed0 commented Jan 9, 2024

Hi,
I work with GTX 1660 super 6gb RAM, 16gb regular (non GPU) RAM, and everything used to be fine until today. Whenever I want to launch Fooocus, the regular RAM works itself up like crazy, practically freezing my computer, even without generating anything
Untitled
(this is with Fooocus just being open)
All the while GPU usage is almost 0%
When launching the app, I noticed this log:
Untitled1
I thought it might have something to do with this issue, so I tried to edit the config log in such a way:
image
I know this is probably wrong, and if so, please tell me how I can enter --always-low-vram properly into the config text file.
(Yes I have read the manual but there is no mention of how to enter such a modification in there)
This issue started only after I've generated 2 inpaint results today, never happened before.
I have also read the system swap fix tutorial, and can safely report that there are no problems in that department.
Would you know of a fix to this issue? Is the "always offload vram" even the issue here? PLEASE help,
Thanks

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

"Always offload VRAM" is not an issue here, and this is the default behaviour, see
here:

Fooocus/args_manager.py

Lines 31 to 32 in 6261f17

# (Disable by default because of issues like https://github.com/lllyasviel/Fooocus/issues/724)
args_parser.args.always_offload_from_vram = not args_parser.args.disable_offload_from_vram

Please remove --always-low-vram. BTW you can set the arguments in your run.bat after entry_with_update.py, not in the config (possible options for config see config tutorial file).

Inpainting uses more VRAM (in your case RAM or disk for offloading) as normal image inference, which is why this behaviour is normal and you couldn't use Fooocus at all without offloading. If you would have more VRAM, your GPU could keep the models loaded all the time and your image generation would be (much) faster.

EDIT: You might try to set --attention-split --disable-offload-from-vram (see #1710) to test if this uses the resources of your GPU better.

TL;DR: nothing to worry about. Maybe your hardware is more on the weak side, but still can handle the job with offloading!

@mashb1t mashb1t added the wontfix / cantfix This will not be worked on label Jan 9, 2024
@NaschBear
Copy link

Hi
im apologize for my bad English

How can i Speed up Fooocus?

Fooocus is a fun Program and i like it to make things in it but i have this feeling Fooocus is on my Computer quit slow.
If i see how fast other can make it and that makes me a little bit Jealous and i ask "oh do you use the web version?"
all say to me "no" so what make i wrong?

I use Low renders, more Anime/Comic Base Models and im still slow. for 4 pictures i need most 45 minutes

what must i do?

How can i boost my GPU?

thanks for the answer ^^

my computer info:

Processor: AMD Athlon(tm) X4 870K Quad Core Processor 3.90 GHz

RAM: 16 GB

NVIDIA GeForce GTX 1050 Ti

@MasterRed0
Copy link
Author

Hi, just 1 more question:
How do I offload Fooocus?
Thanks again (Im new)

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

@NaschBear Your PC is on the brink of being able to run Fooocus, and as you're using a GTX 1050 (1XXX series "only marginally faster than CPU") and your CPU is also quite old (8+ years), there's not really much you can do.

You have 2 options:

  • upgrade your PC (Graphics card, but might be held back by DDR3 RAM, so i personally suggest getting a completely new PC)
  • use a cloud provider such as Colab (free), see https://github.com/lllyasviel/Fooocus?tab=readme-ov-file#colab. Basically a 2 click solution, just click the link, hit play and wait for it to be up & running in 2-3 minutes

@MasterRed0 Offloading is enabled by default if you haven't manually disabled it

@mashb1t mashb1t closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
@NaschBear
Copy link

oh thank you for the fast answer ^^

ok in the time i buy a new computer i make more stuff in Fooocus with Blender hihiihiii ^^

@MasterRed0
Copy link
Author

Hey,
sorry to drag you like this,
After multiple PC restarts and trying everything you've said before, the issue still persists
As soon as I launch Fooocus, my system RAM usage skyrockets to 99% in the first few seconds, making my system barely responsive. The commands appearing at that time:
image
Even when I tried to bear through it and generate a simple "kitten" prompt regardless, It gets stuck on this:
image
Not generating anything for 15 minutes, constantly lagging my PC,
This was not the case before and I don't know what went wrong,
Big Thanks in advance

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

This was not the case before and I don't know what went wrong

@MasterRed0 Do you know which version worked "before" and when before was?
Please make sure you're only running one Fooocus instance at a time and keep in mind to close other programs using GPU.

@MasterRed0
Copy link
Author

MasterRed0 commented Jan 9, 2024

EDIT: Regardless of the 20 chrome processes, there is only 1 cmd process running when Fooocus is launched, which should work regardless of the 0,5GB RAM usage of google chrome.
Please read the following sections when you find the time, You're the only one I can ask for help.

Yes, Today, around 8 hours ago, I left the PC alone to generate 10 inprinted results of the same 1 picture prompt, where I tried to fix hand details. I came back after ~40 minutes to see that it had stopped on the 2nd result, unresponsive. I reset my PC to see if it works like usual, and then It started acting like this.
The version was 2.1.862, the same. I launch through run.bat,
I tried running run_realistic.bat as well but the same thing happens,
Thanks

Okay, think I might have found the culprit
image
I dont know how this happened though, and I cant shut down those processes. Shutting them down 1 by 1 doesn't work, because they all get resurrected after I launch chrome back up. This is the case for not only chrome, I have also got 6 discord processes and others like:
image
or
image
This might launch multiple Fooocus processes when I try to launch it as well I suppose.

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

Inpainting uses more VRAM (in your case RAM or disk for offloading) as normal image inference, which is why this behaviour is normal and you couldn't use Fooocus at all without offloading. If you would have more VRAM, your GPU could keep the models loaded all the time and your image generation would be (much) faster.

As mentioned, inpainting uses more resources than normal image generation. There sadly is not really much you can do, you especially should not wait 40 minutes for one image 😐.
Please check out Colab, where a T4 GPU instance can be used for free and is averaging 2-3 iterations per second, maybe less for inpainting, but still under a minute for quality performance.

@MasterRed0
Copy link
Author

It's very weird because like I said, everything worked just fine previously, both normal generating and inpaiting taking only a couple minutes. It probably generated those 2 images in a short amount of time but just stopped for some reason. Now I can't generate even a single image.
I will have to try Colab, but I would at least like to have the option to generate on my PC.
Nevertheless, a huge thank you for your time.

@rythmn1111
Copy link

Hey guys so i have installed fooocus and its working but i dont think it is using my 4gb 1650 nvidia card but it is only using CPU.. does anyone has solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix / cantfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants