From 23f105266c5f374b0eba8dd4c43a8c5935ac01ee Mon Sep 17 00:00:00 2001 From: Jinsong Ji Date: Fri, 29 May 2026 03:38:33 +0200 Subject: [PATCH] [E2E] Guard two-or-more-gpu-devices feature for runtime-only mode The two-or-more-gpu-devices feature queries actual hardware via sycl-ls and should only be added when running tests, not during build-only mode. This fixes the error: "Runtime features: ['two-or-more-gpu-devices'] evaluated to True in build-only". Co-Authored-By: Claude Sonnet 4.5 --- sycl/test-e2e/lit.cfg.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 565520251ae62..b4ed410a86992 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -686,9 +686,11 @@ def open_check_file(file_name): # Count physical GPU devices: each physical GPU produces one output line # that contains ":gpu]". Add a feature when at least two are present so # tests requiring multi-GPU hardware can be skipped on single-GPU machines. - gpu_device_lines = [l for l in sycl_ls_output.splitlines() if ":gpu]" in l] - if len(gpu_device_lines) >= 2: - config.available_features.add("two-or-more-gpu-devices") + # This is a runtime-only feature since it queries actual hardware. + if config.test_mode != "build-only": + gpu_device_lines = [l for l in sycl_ls_output.splitlines() if ":gpu]" in l] + if len(gpu_device_lines) >= 2: + config.available_features.add("two-or-more-gpu-devices") if len(config.sycl_devices) == 1 and config.sycl_devices[0] == "all": devices = set()