[FEATURE REQUEST] - switch GPU to render headless #217
Replies: 6 comments 10 replies
-
it uses if the gpu id you want to use is 1 then you could add explanation of how to set cli arguments close if this solves your issue, thank you |
Beta Was this translation helpful? Give feedback.
-
Apologies! That msg was to go to another Git, however after reading more about your build, I have switched over to your webui. Great stuff thus far! When submitting a prompt, I'm adding --gpu (x) at the end, however I'm not seeing SD engage different GPUs. Example prompt: Am I missing something? Is there a way to have the webGUI query the number of GPUs in the system, and add a check mark next to which GPU to render on? |
Beta Was this translation helpful? Give feedback.
-
GPU 1 being my main display, 0 and 2 are used for rendering CG |
Beta Was this translation helpful? Give feedback.
-
It doesn't go in the prompt, it's a command line option |
Beta Was this translation helpful? Give feedback.
-
Gotchu. to os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 and after restarting the server, the webUI still rendered on device 1 |
Beta Was this translation helpful? Give feedback.
-
You mean the models, correct? This option is to set which gpu the models load on, and is working for other people as far as I know, also, you should really have just set the cli option because opt.gpu is used in more than one place Can you show me the output from |
Beta Was this translation helpful? Give feedback.
-
I have a multi-GPU system and would love to offload rendering to GPU2:
On Facebook, I started a thread in hopes that someone there could help, however since this looks like the head of the snake, I'll submit here,
This lad is running a version of SD that uses dream.py. Inside that file, he tweaks a command to render on another GPU:
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
I can not find dream.py for this generic CompVis build, so is there another file that I can tweak to designate which GPU to render to? I'm on Windows 10.
Is this what we're looking for??
editing txt2img.py and switch this line from:
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu") model = model.to(device)
TO
device = torch.device("cuda:1,3" if torch.cuda.is_available() else "cpu") ## specify the GPU id's, GPU id's start from 0.
model = CreateModel()
model= nn.DataParallel(model,device_ids = [1, 3])
model.to(device)
Would love your thoughts on the subject.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions