From efff817979d949cb70b96928de1cef2a7a6cef3f Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 1 Sep 2026 15:25:52 -0700 Subject: [PATCH] fix(ci): guard Unix-only fcntl import in driver/GPU sanity check #7360 added a module-level `import fcntl` to print_driver_gpu_info.py. fcntl is a Unix-only module, so the Driver / GPU sanity check step now crashes on every Windows CI runner with ModuleNotFoundError: No module named 'fcntl', failing sanity and skipping all Windows component tests. The KFD ioctl query that needs fcntl only runs on Linux (/dev/kfd), so move the import into _get_kfd_version() where it is used. No behavior change on Linux; Windows now runs the sanity check to completion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build_tools/print_driver_gpu_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build_tools/print_driver_gpu_info.py b/build_tools/print_driver_gpu_info.py index 6339e041e4a..95fe1573603 100644 --- a/build_tools/print_driver_gpu_info.py +++ b/build_tools/print_driver_gpu_info.py @@ -20,7 +20,6 @@ but does not fail. """ -import fcntl import os from pathlib import Path import platform @@ -41,6 +40,11 @@ def _get_kfd_version() -> Tuple[int, int]: + # fcntl is a Unix-only stdlib module and is only needed for this Linux + # KFD ioctl query. Import it lazily so the Windows sanity check does not + # crash at import time with ModuleNotFoundError: No module named 'fcntl'. + import fcntl + fd = os.open(_KFD_DEVICE, os.O_RDWR) try: buf = bytearray(8)