summaryrefslogtreecommitdiff
path: root/experiments/crossover_hardware_smoke.py
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/crossover_hardware_smoke.py')
-rwxr-xr-xexperiments/crossover_hardware_smoke.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/experiments/crossover_hardware_smoke.py b/experiments/crossover_hardware_smoke.py
new file mode 100755
index 0000000..89c11c2
--- /dev/null
+++ b/experiments/crossover_hardware_smoke.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+"""Dependency-free checks for frozen crossover hardware profiles."""
+from crossover_hardware import (
+ assert_hardware_report,
+ policy,
+ policy_for_report,
+)
+
+
+def main():
+ report = {
+ "hardware_profile": "a6000",
+ "cuda_visible_devices": "3",
+ "physical_gpu_index": 3,
+ "physical_gpu_uuid": "GPU-smoke",
+ "physical_gpu_name": "NVIDIA RTX A6000",
+ "total_memory_mib": 49140,
+ }
+ a6000 = policy_for_report("a6000", report)
+ assert a6000["allowed_physical_gpu_indices"] == [3]
+ assert_hardware_report(report, a6000)
+ gtx = policy("timan107_gtx1080")
+ assert gtx["allowed_physical_gpu_indices"] == [5, 7]
+ assert gtx["allowed_device_names"] == ["NVIDIA GeForce GTX 1080"]
+ print("crossover hardware smoke: all checks passed")
+
+
+if __name__ == "__main__":
+ main()