PyTorch ROCm is out - How to select Radeon GPU as device

Viewed 3145

since Pytorch released the ROCm version, which enables me to use other gpus than nvidias, how can I select my radeon gpu as device in python? Obviously, code like device = torch.cuda.is_available or device = torch.device("cuda") is not working. Thanks for any help. :)

1 Answers

This took me forever to figure out. I'm still having some configuration issues with my AMD GPU, so I haven't been able to test that this works, but, according to this github pytorch thread, the Rocm integration is written so you can just call torch.device('cuda') and no actual porting is required!

See the thread here: https://github.com/pytorch/pytorch/issues/10670

Related