import torch
if torch.cuda.is_available():
= torch.cuda.current_device()
device print(f"GPU Name: {torch.cuda.get_device_name(device)}")
print(f"GPU Memory Total: {torch.cuda.get_device_properties(device).total_memory / (1024**3):.2f} GB")
print(f"GPU Memory Free: {torch.cuda.get_device_properties(device).total_memory / (1024**3):.2f} GB")
print(f"Compute Capability: {torch.cuda.get_device_capability(device)}")
else:
print("No GPU available. Using CPU.")
GPU Name: NVIDIA GeForce RTX 2060
GPU Memory Total: 6.00 GB
GPU Memory Free: 6.00 GB
Compute Capability: (7, 5)