Skip to content

Commit 7c04f11

Browse files
t-visoumith
authored andcommitted
search for ldconfig in /sbin for nccl detection (pytorch#2276)
1 parent f6585e8 commit 7c04f11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ def run(self):
282282
THD_LIB = os.path.join(lib_path, 'libTHD.1.dylib')
283283
NCCL_LIB = os.path.join(lib_path, 'libnccl.1.dylib')
284284

285-
if WITH_NCCL and subprocess.call('ldconfig -p | grep libnccl >/dev/null', shell=True) == 0:
285+
if WITH_NCCL and (subprocess.call('ldconfig -p | grep libnccl >/dev/null', shell=True) == 0 or
286+
subprocess.call('/sbin/ldconfig -p | grep libnccl >/dev/null', shell=True) == 0):
286287
SYSTEM_NCCL = True
287288

288289
main_compile_args = ['-D_THP_CORE']

0 commit comments

Comments
 (0)