13 lines
435 B
Python
13 lines
435 B
Python
import torch
|
|
|
|
def check_cuda_availability():
|
|
if torch.cuda.is_available():
|
|
print("CUDA доступна!")
|
|
print(f"Количество доступных GPU: {torch.cuda.device_count()}")
|
|
for i in range(torch.cuda.device_count()):
|
|
print(f"GPU {i}: {torch.cuda.get_device_name(i)}")
|
|
else:
|
|
print("CUDA недоступна.")
|
|
|
|
if __name__ == "__main__":
|
|
check_cuda_availability() |