From cef7015b62ea09535ba637cf6cd408af8267bd40 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Wed, 11 Nov 2026 00:53:38 -0400 Subject: [PATCH] tests: hyperloom_benchmark_test checks GTT only where amdgpu exposes it (onto #2115, engine#2018) #2115 registers this test, and CI's build job then fails it at line 205: the job runs in a GPU-less ubuntu:26.04 container, box_conditions() reads no /sys/class/drm/card0/device/mem_info_gtt_*, and the test asserted they were not None. That is also why the test never had a ctest row. The real-value asserts now run where the counters exist. Where they do not, the test asserts the script's own contract ("absent is a null, never a zero"). A faked GPU_SYSFS root exercises the GPU-less branch on every box. Co-authored-by: bong-water-water-bong Co-Authored-By: Claude Opus 5.5 --- tests/hyperloom_benchmark_test.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/hyperloom_benchmark_test.py b/tests/hyperloom_benchmark_test.py index d477ab535..d1dca7482 100644 --- a/tests/hyperloom_benchmark_test.py +++ b/tests/hyperloom_benchmark_test.py @@ -202,8 +202,22 @@ def main(): # below stands in for a box that exposes nothing. box = bench.box_conditions() assert box["tctl_c"] is None or 20.0 < box["tctl_c"] < 120.0, box - assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box - assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + # The GTT counters exist only where amdgpu does. On such a box every one must come back a number; CI's build job + # runs in a GPU-less container (engine#2018: this is why the test had no ctest row), where they must be null. + if (bench.GPU_SYSFS / "mem_info_gtt_used").exists(): + assert box["gtt_used_gib"] is not None and box["gtt_total_gib"] is not None, box + assert 0.0 <= box["gtt_used_gib"] <= box["gtt_total_gib"], box + else: + assert box["gtt_used_gib"] is None and box["gtt_total_gib"] is None, box + # ...and the GPU-less branch runs everywhere, not only in CI: a root with no counters is a null, never a zero. + real_sysfs = bench.GPU_SYSFS + try: + with tempfile.TemporaryDirectory() as tmp: + bench.GPU_SYSFS = pathlib.Path(tmp) + nogpu = bench.box_conditions() + assert nogpu["gtt_used_gib"] is None and nogpu["gtt_total_gib"] is None, nogpu + finally: + bench.GPU_SYSFS = real_sysfs assert box["mem_available_gib"] is not None and box["mem_available_gib"] > 0, box # The hwmon channel is found by label, not by a hardcoded index: the k10temp Tctl has come back as # hwmon2 and as hwmon4 across six reboots in three days. A root with no Tctl label yields null.