Skip to content

Commit 919baba

Browse files
authored
Avoid querying inactive NVLink versions (#2154)
1 parent 7ea8a46 commit 919baba

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cuda_core/tests/system/test_system_device.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,16 +772,19 @@ def test_nvlink():
772772
nvlink_info = device.get_nvlink(link)
773773
assert isinstance(nvlink_info, _device.NvlinkInfo)
774774

775+
with unsupported_before(device, None):
776+
state = nvlink_info.state
777+
assert isinstance(state, bool)
778+
779+
if not state:
780+
continue
781+
775782
with unsupported_before(device, None):
776783
version = nvlink_info.version
777784
assert isinstance(version, tuple)
778785
assert len(version) == 2
779786
assert all(isinstance(i, int) for i in version)
780787

781-
with unsupported_before(device, None):
782-
state = nvlink_info.state
783-
assert isinstance(state, bool)
784-
785788

786789
def test_utilization():
787790
for device in system.Device.get_all_devices():

0 commit comments

Comments
 (0)