-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Implementation of CUDA device id selection (--device-id 0/1/2) #3377
Implementation of CUDA device id selection (--device-id 0/1/2) #3377
Conversation
Does this have some advantage over the CUDA_VISIBLE_DEVICES environment variable? |
@dfaker If you mean that modifying that variable allows to select the GPU, then it is only available for single instances use (or perhaps by redeclaring it before starting a second session but this would prevent switching models or could be the source of conflicts if for any reason the instance queries the device again). Therefore making possible to select a second GPU allows to run two instances at once ON TOP of being simply able to select the device in a cleaner fashion. |
This is news to me! But easily running multiple instances on separate devices makes sense, a little more convenient than chaining an export. |
@dfaker Exactly! |
@Extraltodeus This has been really awesome. I'm currently running a server with 11 3090s thanks to this! I did find some small issues though. Some portions of the code, namely Face Restoration (all samplers) and Highres Fix (DDIM and possibly PLMS) seem to ignore --device-id and just use CUDA:0, which throws an error. I added the bug report here #3713. Is this something that you might be able to look at? |
I am unfortunately not having access to a capable enough multi-GPU environment (my only acces has 2 GPU but not enough RAM to run two instances).
Looks like either a check should be avoided or a device id precised in the function that gets to that. Right now I could only test blindly however. |
@Extraltodeus sorry I just saw this. I would welcome you into our Discord and would happily test any adjustments to the code in real-time in my environment until we get it figured out. I'm not sure if it's cool to post discord links here but it's in my profile. There's also plenty of other people there (around 400) that can help test. Thanks again for the awesome addition to the UI. EDIT: If you do join the Discord, please DM me @Lukium # 0001 and I'll set you up with a @Developer role so you can access all the instances as well. |
Hi @Lukium I guess you're distributing requests across the multiple web-ui instances using a web proxy. |
Perhaps the idea of tiled diffsion can be used for multi-GPU support? |
Hello,
I added the possibility to select which GPU to use with CUDA by a commandline argument "--device-id".
Screenshot after starting on the GPU 1:
Screenshot while loading on GPU 0 (then my session crashed because of a lack of RAM) :
On top of allowing to select which GPU to use, it can allow two sessions in parallel if the system has enough RAM (not my case tho 😅)