| import torch | |
| import sys | |
| print('Python executable:', sys.executable) | |
| print('torch.__version__:', torch.__version__) | |
| print('torch.version.cuda:', torch.version.cuda) | |
| print('torch.backends.cudnn.version():', getattr(torch.backends.cudnn, 'version', lambda: None)()) | |
| print('torch.cuda.is_available():', torch.cuda.is_available()) | |
| try: | |
| print('torch.cuda.device_count():', torch.cuda.device_count()) | |
| if torch.cuda.is_available(): | |
| for i in range(torch.cuda.device_count()): | |
| print('device', i, torch.cuda.get_device_name(i)) | |
| print('memory_allocated:', torch.cuda.memory_allocated(i)) | |
| print('memory_reserved :', torch.cuda.memory_reserved(i)) | |
| except Exception as e: | |
| print('Error querying cuda devices:', e) | |