deep-learning-models icon indicating copy to clipboard operation
deep-learning-models copied to clipboard

How to specify the specific GPU to use when there are multiple GPU on the machine?

Open ivyteng opened this issue 7 years ago • 2 comments

ivyteng avatar Dec 26 '17 01:12 ivyteng

by using Tensor Flow graphs you can specify a single GPU when there are more than one GPU.

shivambhardwaj120 avatar Feb 01 '18 11:02 shivambhardwaj120

Easiest way is to specify it command line when starting the process via

CUDA_VISIBLE_DEVICES=2,7 python predict.py

GPU ids are 0 based.

Otherwise define the model under a block

with tf.device('/device:GPU:2'):
         model = VGG16()```

23pointsNorth avatar Feb 15 '18 23:02 23pointsNorth