Files
ebook2audiobook/tools/gpu_notebook_test.py
2025-02-15 06:05:05 -08:00

12 lines
338 B
Python

import torch
print("Torch version:", torch.__version__)
print("CUDA Available:", torch.cuda.is_available())
if torch.cuda.is_available():
print("Number of GPUs:", torch.cuda.device_count())
for i in range(torch.cuda.device_count()):
print(f"GPU {i}: {torch.cuda.get_device_name(i)}")
else:
print("No GPU detected.")