Reputation: 421
In Python, on a machine that has an NVIDIA GPU, one can confirm the mps device name of the GPU using:
torch.cuda.get_device_name()
Per the docs: https://pytorch.org/docs/stable/generated/torch.cuda.get_device_name.html#torch.cuda.get_device_name
How do I confirm the mps device name for an Intel-based Mac, which has an AMD GPU? I don't see any mention of that in the docs.
Upvotes: 1
Views: 924
Reputation: 65
Works like magic for Macbook Pro2019 with Intel Silicon, i9.
print("PyTorch is using", torch.get_num_threads(), "GPU threads.")
device = torch.device("cuda" if torch.cuda.is_available() else "mps")
Upvotes: 1