We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 051a2bc commit 281cd67Copy full SHA for 281cd67
lightllm/utils/device_utils.py
@@ -94,12 +94,8 @@ def has_nvlink():
94
# Call nvidia-smi to get the topology matrix
95
result = subprocess.check_output(["nvidia-smi", "topo", "--matrix"])
96
result = result.decode("utf-8")
97
-
98
# Check if the output contains 'NVLink'
99
- if "NVLink" in result:
100
- return True
101
- else:
102
- return False
+ return any(f"NV{i}" in result for i in range(1, 8))
103
except subprocess.CalledProcessError:
104
# If there's an error (e.g., nvidia-smi is not installed or another issue), assume no NVLink
105
return False
0 commit comments