File size: 804 Bytes
323c6ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import tensorflow as tf
import psutil

print("--- Hardware Verification ---")
print(f"TensorFlow Version: {tf.__version__}")

# Check GPU availability
gpus = tf.config.list_physical_devices('GPU')
if gpus:
    print(f"✅ GPU Detected: {gpus}")
else:
    print("⚠️ No GPU detected by TensorFlow. Running on CPU instead.")

# Check Telemetry Packages
print(f"Available RAM: {psutil.virtual_memory().available / (1024**3):.2f} GB")

try:
    import pynvml
    pynvml.nvmlInit()
    handle = pynvml.nvmlDeviceGetHandleByIndex(0)
    temp = pynvml.nvmlDeviceGetTemperature(handle, pynvml.NVML_TEMPERATURE_GPU)
    print(f"✅ NVML initialized. Current GPU Temp: {temp}°C")
except Exception as e:
    print("⚠️ NVML (GPU Tracking) failed to initialize. Ensure an NVIDIA GPU and drivers are present.")