Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Add fallback strategy to nccl check #4259

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions vllm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,21 @@ def nccl_integrity_check(filepath):
the version of the library.
"""
exit_code = os.system(f"ldd {filepath} 2>&1 > /dev/null")
if exit_code != 0:
raise RuntimeError(f"Failed to load NCCL library from {filepath} .")
import ctypes
if exit_code != 0:
logger.info(
f"Failed to perform ldd check for NCCL library: {filepath}, "
f"try fallback to load {filepath} directly from system. It will depends "
f"on your current environment, please ensure that LD_LIBRARY_PATH"
f" has been set correctly."
)
try:
nccl = ctypes.CDLL(filepath)
except Exception as e:
raise RuntimeError(f"Failed to load NCCL library from {filepath} . Error: {e}")
else:
nccl = ctypes.CDLL(filepath)

nccl = ctypes.CDLL(filepath)
version = ctypes.c_int()
nccl.ncclGetVersion.restype = ctypes.c_int
nccl.ncclGetVersion.argtypes = [ctypes.POINTER(ctypes.c_int)]
Expand Down
Loading