-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_cuda_backend.py
More file actions
31 lines (23 loc) · 881 Bytes
/
debug_cuda_backend.py
File metadata and controls
31 lines (23 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import sys
# Simulate the dashboard environment setup
os.environ["TNFR_MATH_BACKEND"] = "torch"
os.environ["TNFR_CUDA_ENABLED"] = "true"
# Add src to path
sys.path.append(os.path.join(os.getcwd(), 'src'))
try:
import torch
print(f"PyTorch Version: {torch.__version__}")
print(f"CUDA Available: {torch.cuda.is_available()}")
from tnfr.mathematics.backend import get_backend
backend = get_backend()
print(f"Backend Name: {backend.name}")
print(f"Backend Device: {backend.get_device_name()}")
print(f"Backend Info: {backend.get_backend_info()}")
from tnfr.engines.computation.unified_gpu_system import TNFRUnifiedGPUSystem
gpu_sys = TNFRUnifiedGPUSystem()
print(f"GPU System Available: {gpu_sys.is_available}")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()