Virtual-LPU / scripts /rig_tests.ps1
iparaco's picture
Upload 118 files
e59bd9d verified
Raw History Blame
1.52 kB
# RIG TEST RUNNER — mission §18: "hardware tests must run on the real system".
# Runs the full V7 suite on THIS machine (2x Tesla P100) and saves results.
# The two hardware-gated tests that skip in the CPU sandbox run FOR REAL here:
# test_01_gpu_identification (NVML: 2 GPUs, P100 names)
# test_t08_gpu_metrics_hardware_gated (live util/mem per card)
$ErrorActionPreference = "Stop"
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$python = "C:\Ipara.co\LPU\LPU_V7\.venv\Scripts\python.exe"
Write-Host "== LPU V7 rig tests (real hardware) ==" | Tee-Object "$here\..\docs\RIG_TEST_RESULTS.txt" -Append
& $python -m pytest "$here\..\tests" -v --tb=short 2>&1 |
Tee-Object -FilePath "$here\..\docs\RIG_TEST_RESULTS.txt" -Append
$exit = $LASTEXITCODE
Write-Host "pytest exit code: $exit" | Tee-Object "$here\..\docs\RIG_TEST_RESULTS.txt" -Append
# NVML sanity in this shell too (independent of pytest)
& $python -c @'
from lpu.monitoring.gpu_monitor import GPUMonitor
mon = GPUMonitor(sample_seconds=0.5, enabled=True)
print("NVML available:", mon.available)
print("GPU count:", mon.device_count)
print("driver:", mon.driver_version())
for s in mon.sample_all(force=True):
print(f"GPU {s.index}: {s.name} util={s.utilization_pct}% "
f"mem={s.mem_used_mb}/{s.mem_total_mb} MB temp={s.temperature_c}C "
f"power={s.power_w}W")
print("per-process VRAM:", mon.per_process_vram_mb())
mon.close()
'@ 2>&1 | Tee-Object "$here\..\docs\RIG_TEST_RESULTS.txt" -Append
exit $exit