Skip to content

Commit cfcb81a

Browse files
authored
Skip the tests when the requested NVML function is unavailable (#1898)
1 parent 33efe60 commit cfcb81a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

cuda_bindings/cuda/bindings/_test_helpers/arch_check.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99

1010
from cuda.bindings import nvml
11+
from cuda.bindings._internal.utils import FunctionNotFoundError as NvmlSymbolNotFoundError
1112

1213

1314
@cache
@@ -49,9 +50,10 @@ def unsupported_before(device: int, expected_device_arch: nvml.DeviceArch | str
4950

5051
try:
5152
yield
52-
except nvml.NotSupportedError:
53-
# The API call raised NotSupportedError, so we skip the test, but
54-
# don't fail it
53+
except (nvml.NotSupportedError, nvml.FunctionNotFoundError, NvmlSymbolNotFoundError):
54+
# The API call raised NotSupportedError, NVML status FunctionNotFoundError,
55+
# or NvmlSymbolNotFoundError (symbol absent from the loaded NVML DLL), so we
56+
# skip the test but don't fail it
5557
pytest.skip(
5658
f"Unsupported call for device architecture {nvml.DeviceArch(device_arch).name} "
5759
f"on device '{nvml.device_get_name(device)}'"

cuda_core/tests/system/test_system_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def test_clock():
586586
with unsupported_before(device, DeviceArch.MAXWELL):
587587
try:
588588
offsets = clock.get_offsets(pstate)
589-
except system.InvalidArgumentError:
589+
except (system.InvalidArgumentError, system.NotFoundError):
590590
pass
591591
else:
592592
assert isinstance(offsets, system.ClockOffsets)

0 commit comments

Comments
 (0)