Last active
April 6, 2022 16:37
-
-
Save fauxneticien/343b1dd7b68a30cb6f8983dacac28721 to your computer and use it in GitHub Desktop.
Check CUDA/cuDNN info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as: | |
# wget -O check-cuda.py https://gist.github.com/fauxneticien/343b1dd7b68a30cb6f8983dacac28721/raw && python check-cuda.py | |
# Adapted from https://amytabb.com/til/2020/10/05/cudnn-pytorch/ | |
import torch | |
print("Is cuda available?", torch.cuda.is_available()) | |
print("CUDA version:", torch.version.cuda) | |
print("cuDNN version:", torch.backends.cudnn.version()) | |
print("cuDNN enabled? ", torch.backends.cudnn.enabled) | |
print("Try creating a tensor 'x' and moving to GPU...") | |
x = torch.rand(5, 3).to('cuda') | |
print("What device is 'x' on?", x.device) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment