IF3D / check_gpu_availability
leobcc
Add files to check installs
e348bce
raw
history blame
228 Bytes
import torch
if torch.cuda.is_available():
device = torch.device("cuda")
print(f"GPU {torch.cuda.get_device_name(0)} is available")
else:
device = torch.device("cpu")
print("No GPU available, using CPU instead")