Closed sagittahjz closed 5 years ago
I have tried the following codes
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "6"
torch.cuda.set_device(6)
but it always used GPU0
attach CUDA_VISIBLE_DEVICES=6 to the beginning of train.sh is useful
but why the other ways I mentioned were useless?
It is the problem of pytorch that always use the first gpu as the master gpu.
I have tried the following codes
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "6"
torch.cuda.set_device(6)
but it always used GPU0