mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-09 22:00:49 +08:00
Add files via upload
This commit is contained in:
parent
d90af62f75
commit
5a7efc7b23
19
testzluda.py
Normal file
19
testzluda.py
Normal file
@ -0,0 +1,19 @@
|
||||
import torch
|
||||
|
||||
try:
|
||||
# Check if CUDA is available
|
||||
if not torch.cuda.is_available():
|
||||
raise RuntimeError("CUDA is not available")
|
||||
|
||||
# Create tensors on the GPU
|
||||
ten1 = torch.randn((2, 4), device="cuda")
|
||||
ten2 = torch.randn((4, 8), device="cuda")
|
||||
|
||||
# Perform matrix multiplication
|
||||
output = torch.mm(ten1, ten2)
|
||||
|
||||
# Print success message
|
||||
print("zluda is correctly installed and working")
|
||||
except Exception as e:
|
||||
# Print failure message if any exception occurs
|
||||
print(f"zluda isn't installed correctly: {e}")
|
||||
Loading…
Reference in New Issue
Block a user