#!/bin/bash
/home/fabian/ComfyUI/venv/bin/python -c "
import torch
print('CUDA available:', torch.cuda.is_available())
print('HIP version:', torch.version.hip)
if torch.cuda.is_available():
    print('Device:', torch.cuda.get_device_name(0))
    print('VRAM:', torch.cuda.get_device_properties(0).total_memory / 1024**3, 'GB')
    # Quick matmul test
    import time
    a = torch.randn(1024, 1024, device='cuda', dtype=torch.float16)
    b = torch.randn(1024, 1024, device='cuda', dtype=torch.float16)
    torch.cuda.synchronize()
    t0 = time.time()
    for _ in range(10):
        c = torch.matmul(a, b)
    torch.cuda.synchronize()
    t1 = time.time()
    print(f'10x matmul 1024x1024 f16: {(t1-t0)*1000:.0f}ms')
else:
    print('CUDA NOT AVAILABLE')
"
