Spaces:
Sleeping
Sleeping
Download scripts/check_cuda.py from Nitishkumar-ai/commitguard-env: direct link, hf CLI and curl.
- Browser
- Download file 298 Bytes
-
https://huggingface.co/spaces/Nitishkumar-ai/commitguard-env/resolve/main/scripts/check_cuda.py
- Command line
-
hf download hf://spaces/Nitishkumar-ai/commitguard-env/scripts/check_cuda.py
-
curl -L -o check_cuda.py https://huggingface.co/spaces/Nitishkumar-ai/commitguard-env/resolve/main/scripts/check_cuda.py
298 Bytes
| import torch | |
| print(f'CUDA available: {torch.cuda.is_available()}') | |
| if torch.cuda.is_available(): | |
| print(f'Device count: {torch.cuda.device_count()}') | |
| print(f'Device name: {torch.cuda.get_device_name(0)}') | |
| print(f'Memory: {torch.cuda.get_device_properties(0).total_memory / 1e9:.2f} GB') | |