Select specific GPU to use.

Discussions about research, Faceswapping and things that don't fit in the other categories here.

Post Reply
User avatar
Posts: 3
Joined: Thu Dec 16, 2021 12:40 pm

Select specific GPU to use.

Post by janipa »


My computer have two GPU , I would like to use only my second GPU for extracting and converting.

Is there any command or setting I can change to select only my second GPU,
Or where can I change the code to specify the GPU to use?

Like example:
with tf.device('/gpu:1')

User avatar
Posts: 6
Joined: Sat Nov 06, 2021 3:04 pm
Answers: 1
Has thanked: 2 times

Re: Select specific GPU to use.

Post by acaint »

The argument is -X for excluding GPUs.
For example, putting argument

Code: Select all

-X 0 1

will exclude GPU:0 and GPU:1

I use it for forcing to make operations with specific GPU or even CPU-only, while the other GPU is already training some other stuff in other console (if you want to do parallel work like this, you also need -LF option to specify individual logfile location per each parallel work).

So in your case,

Code: Select all

-X 0

would exclude your GPU:0 , leaving GPU:1 available for processing.

Post Reply