-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
How to allocate memory from 2nd GPU? #156
Comments
Using memory from between two GPUs is not simple. I only have one so I can't research/develop this. |
Oh hi. |
Would be interested in this as well. I don't think something like SLI is the answer though. |
Found this guy talking about it here: Not sure if it's helpful or not but he shows some code |
from #311 |
For more than just 2 GPUs, NickLucche has code:
|
Hi! I could probably port this multi-gpu feature, but I would appreciate some pointers as to where in the code I should look for the actual model (I am using the vanilla one from huggingface). |
Is this something still in the works? I understand it could take a while to make everything support multiple GPU, but if I could use both of my GPU to generate images, that would be good enough. Like, if I select a batch of 2, each GPU would do one. If I did 8, each would do 4. Is that complicated? |
@swcrazyfan you can already load two instances at the same time. Just use --device-id 0 in one and --device-id 1 in the other. Of course it is not an optimal solution and you might need more RAM to run both instances. --lowram might help too. |
Is this being worked upon? It sounds like an awesome feature. Even if it's restricted to txt2img, it'd be a start. I guess this would require major changes to the way images are handled right now, there'd probably would need to be a queue of sorts to make this work. |
I'd be happy to help test this if it's something that's being worked on. I'm currently running an 11x RTX3090 server for a Discord Community using @Extraltodeus 's --device-id feature #3377, and I think that having some parallelism would further benefit the community greatly. I'm not sure if it's ok to mention community links here, but info is in my profile, and you're welcome to DM me on Discord if it's something you would like help testing. |
Just popping in to check on this. I also have an 8x 3090 machine and a 2x3090 machine (both have 256GB RAM) that would be great for testing parallelization. |
This would be a really great feature. Just being able to distribute a batch would be great, Having a round-robin for "next GPU" would also be useful to distribute web requests across a pool of GPUs. |
p.s. I think this issue has changed a bit from a memory question to a multi-GPU support question in general. It may be good to alter the title to something like: "Multi GPU support for parallel queries". I think that is somewhat distinct from the first query regarding memory pooling (which is a much more difficult ask!) |
well let's get it funded then |
I'm not sure this is really a parallel query question though, is it? I found it while looking for using multiple GPUs for a single query, and most of the discussion was based on that. |
…ify AUTOMATIC1111#99 now returns the cheap_approx rather than grey image
Here the error I have run into:
"RuntimeError: CUDA out of memory. Tried to allocate 18.00 GiB (GPU 0; 24.00 GiB total capacity; 20.51 GiB already allocated; 618.87 MiB free; 20.59 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF"
I have a 2nd GPU which could be used to allocate that extra 18GB, however I need help in figuring out how to show SD there is a 2nd GPU present.
Any thoughts?
The text was updated successfully, but these errors were encountered: