logging.warning('Found {} CUDA devices matching name "{}". Choosing first one with index {}.'.format(len(devmatches),cudaDeviceName,devnum))
os.environ['CUDA_DEVICE']=str(devnum)
matchbit='(matched to user request "{}")'.format(cudaDeviceName)
elif'CUDA_DEVICE'inos.environ:
devnum=int(os.environ['CUDA_DEVICE'])
else:
devnum=0
devn=devices[devnum]
logging.info('Choosing CUDA device {}, of {} devices present: {} (matched to user request "{}")...'.format(devnum,num_gpus,devn.name(),cudaDeviceName))
logging.info('Choosing CUDA device {}, of {} devices present: {}{}...'.format(devnum,num_gpus,devn.name(),matchbit))