Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Created October 4, 2023 13:20
Show Gist options
  • Save n1ckfg/67c7d6d65326b50db8b700704b2c83c7 to your computer and use it in GitHub Desktop.
Save n1ckfg/67c7d6d65326b50db8b700704b2c83c7 to your computer and use it in GitHub Desktop.
check_gpu.py
import torch
import onnxruntime as ort
torch.cuda.is_available() # Nvidia or AMD GPU
torch.backends.mps.is_available() # Apple GPU
ort.get_device() # any GPU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment