stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

How to use the specified graphics card for running

Open liuzhiyi0531 opened this issue 3 years ago • 5 comments
trafficstars

I install 2 gpus in my computer A gtx950 and a p102-100-8g I want to specify "p102" to run , what configuration should I change? p102 have 1920 cudas and 8g gddr5x Vram,I think it can run program well

liuzhiyi0531 avatar Oct 19 '22 14:10 liuzhiyi0531

you can try:

add this line to webui-user.bat: set CUDA_VISIBLE_DEVICES=0

if that doesn't work, try: set CUDA_VISIBLE_DEVICES=1

ghost avatar Oct 19 '22 15:10 ghost

you can try:

add this line to webui-user.bat: set CUDA_VISIBLE_DEVICES=0

if that doesn't work, try: set CUDA_VISIBLE_DEVICES=1

can we use both?

YudhaDev avatar Oct 20 '22 04:10 YudhaDev

you can try: add this line to webui-user.bat: set CUDA_VISIBLE_DEVICES=0 if that doesn't work, try: set CUDA_VISIBLE_DEVICES=1

can we use both?

As far as I know, =0 selects first gpu, =1 selects second, =2 third etc. Using =0,1 would select both first and second gpu

ghost avatar Oct 20 '22 04:10 ghost

That's what I've done since pretty much the beginning as this actual option was from the original branch if I remember correctly. It has worked well for me so far as I set it on my second GPU with set CUDA_VISIBLE_DEVICES=1 .

But I never thought I could actually use both ! I'll try that immediately. That would be a huge surprise !

EDIT: so I tried it and sadly it doesn't work. You can set it to use one GPU or the other, but not both at the same time with 0,1. It will still launch, but it will only use the first one if you list more than that.

Too bad ! I have two identical cards with a NVlink bridge, so I had hopes that this might actually work.

AugmentedRealityCat avatar Oct 20 '22 07:10 AugmentedRealityCat

sorry about that, SD probably doesn't support multiple gpus. However maybe you can run two instances of SD doing different jobs at the same time. (I can't test any of this, I'm running on cpu myself)

ghost avatar Oct 20 '22 09:10 ghost