Reputation: 351
According to the official docs, now PyTorch supports AMD GPUs. ROCm 4.2 can be installed through pip. But I can not find in Google nor the official docs how to force my DL training to use the GPU. What is the AMD equivalent to the following command?
torch.device('cuda' if torch.cuda.is_available() else 'cpu')
Upvotes: 4
Views: 3677
Reputation: 202
ROCm translates CUDA codes. So torch.cuda.is_available()
should work.
Upvotes: 1