Skip to content

Commit 002ce1a

Browse files
committed
Fix nvbug6084457: Make NVLINK_MAX_LINKS version-dependent
1 parent 774e988 commit 002ce1a

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

cuda_bindings/cuda/bindings/nvml.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,11 @@ class FieldId(_FastEnum):
15931593

15941594
MAX = 289
15951595

1596-
NVLINK_MAX_LINKS = 18
1596+
1597+
if tuple(int(x) for x in system_get_nvml_version().split(".")) < (3, 13):
1598+
NVLINK_MAX_LINKS = 18
1599+
else:
1600+
NVLINK_MAX_LINKS = 36
15971601

15981602

15991603
class RUSD(_FastEnum):

cuda_core/tests/system/test_system_device.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,10 +762,18 @@ def test_compute_running_processes():
762762

763763

764764
def test_nvlink():
765+
from cuda.bindings._version import version_tuple as cuda_bindings_version
766+
767+
nvml_version = system.get_nvml_version()
768+
765769
for device in system.Device.get_all_devices():
766770
max_links = _device.NvlinkInfo.max_links
767771
assert isinstance(max_links, int)
768772
assert max_links > 0
773+
if nvml_version >= (3, 13) and cuda_bindings_version > (13, 3, 1):
774+
assert max_links == 36
775+
else:
776+
assert max_links == 18
769777

770778
for link in range(max_links):
771779
with unsupported_before(device, None):

0 commit comments

Comments
 (0)