Skip to content

Commit 281cd67

Browse files
authored
fix nvlink detect (#782)
1 parent 051a2bc commit 281cd67

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lightllm/utils/device_utils.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,8 @@ def has_nvlink():
9494
# Call nvidia-smi to get the topology matrix
9595
result = subprocess.check_output(["nvidia-smi", "topo", "--matrix"])
9696
result = result.decode("utf-8")
97-
9897
# Check if the output contains 'NVLink'
99-
if "NVLink" in result:
100-
return True
101-
else:
102-
return False
98+
return any(f"NV{i}" in result for i in range(1, 8))
10399
except subprocess.CalledProcessError:
104100
# If there's an error (e.g., nvidia-smi is not installed or another issue), assume no NVLink
105101
return False

0 commit comments

Comments
 (0)