This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ROCm-Research-Archive/_TestScripts/Claude Test Scripts/gpu_test.py
T
2026-08-20 00:45:43 +02:00

14 lines
477 B
Python

import torch
print(f"PyTorch: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"HIP version: {torch.version.hip}")
print(f"Device count: {torch.cuda.device_count()}")
if torch.cuda.is_available():
print(f"Device name: {torch.cuda.get_device_name(0)}")
t = torch.randn(100, 100, device="cuda")
r = torch.mm(t, t)
print(f"GPU matmul OK: result shape {r.shape}")
print("GPU COMPUTE WORKS!")
else:
print("NO GPU DETECTED")