diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 565520251ae6..b4ed410a8699 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()