From 6dc8db24ae2243618b47b13fe6a97461e94bea8e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 23 Sep 2026 21:41:13 -0700 Subject: [PATCH] test: skip unsupported NVML device capabilities Keep PCI and fan/cooler assertions for capable NVML devices while skipping unsupported queries within each device subtest. Treat cooler support as a per-device capability rather than an architecture guarantee. Preserve the CUDA-only enumeration and capability gates now on main. The system event round trip already uses CUDA devices, so that patch hunk is unnecessary. Addresses nvbug 6566653. --- cuda_core/tests/system/test_system_device.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cuda_core/tests/system/test_system_device.py b/cuda_core/tests/system/test_system_device.py index 278719b3a1b..7b240a9f050 100644 --- a/cuda_core/tests/system/test_system_device.py +++ b/cuda_core/tests/system/test_system_device.py @@ -182,7 +182,8 @@ def test_device_pci_info(subtests): for cuda_device in CudaDevice.get_all_devices(): device = cuda_device.to_system_device() with subtests.test(device_index=device.index): - pci_info = device.pci_info + with unsupported_before(device, None): + pci_info = device.pci_info assert isinstance(pci_info, _device.PciInfo) assert isinstance(pci_info.bus_id, str) @@ -712,9 +713,10 @@ def test_fan(subtests): device_index = device.index num_fans = None # The fan APIs are only supported on discrete devices with fans, - # but when they are not available `device.num_fans` returns 0. + # but when they are not available `device.num_fans` usually returns 0. with subtests.test(device_index=device_index, fan_api="get_num_fans"): - value = device.num_fans + with unsupported_before(device, None): + value = device.num_fans assert isinstance(value, int) assert value >= 0 num_fans = value @@ -763,11 +765,13 @@ def test_cooler(subtests): device = cuda_device.to_system_device() with subtests.test(device_index=device.index): # The cooler APIs are only supported on discrete devices with fans, - # but when they are not available `device.num_fans` returns 0. - if device.num_fans == 0: + # but when they are not available `device.num_fans` usually returns 0. + with unsupported_before(device, None): + num_fans = device.num_fans + if num_fans == 0: pytest.skip("Device has no coolers to test") - with unsupported_before(device, DeviceArch.MAXWELL): + with unsupported_before(device, None): cooler_info = device.cooler assert isinstance(cooler_info, _device.CoolerInfo)