Skip to content

[Cherry-pick release/2.15] [xccl] WA: resolve libccl.so.1 next to the already loaded libccl.so.2 - #5676

Merged
chuanqi129 merged 1 commit into
release/2.15from
cherry-pick-5670-by-chuanqi129
Oct 13, 2026
Merged

chuanqi129 merged 1 commit into
release/2.15from
cherry-pick-5670-by-chuanqi129

Conversation

@torchxpubot

Copy link
Copy Markdown
Contributor

#5648 preloaded libccl.so.1 by soname, assuming libtorch_xpu.so's RPATH would locate it the same way it locates libccl.so.2. It does not, so the workaround never took effect and PYTORCHDGQ-10126 still reproduces.

LD_DEBUG on a PyPI/venv install shows only three RPATHs ever being used -- numpy's extension module, torch/_C.cpython-*.so and libtorch_global_deps.so -- all objects that were dlopen'd directly. libtorch_xpu.so is pulled in as an indirect dependency, so glibc resolves our dlopen() against those, never against ours. libccl.so.2 is found only because it is a DT_NEEDED of libtorch_global_deps.so:

find library=libccl.so.2 ... (RPATH from file .../libtorch_global_deps.so)
find library=libccl.so.1 ... search cache=/etc/ld.so.cache
... (system search path)

Ask the loader for the resolved path of libccl.so.2 and open libccl.so.1 from the same directory instead, which does not depend on any search path.

Cherry-pick of #5670 to release/2.15.
Cherry-picked from commit d44bbbc.

…#5670)

#5648 preloaded libccl.so.1 by soname, assuming libtorch_xpu.so's RPATH
would locate it the same way it locates libccl.so.2. It does not, so the
workaround never took effect and PYTORCHDGQ-10126 still reproduces.

LD_DEBUG on a PyPI/venv install shows only three RPATHs ever being used
-- numpy's extension module, torch/_C.cpython-*.so and
libtorch_global_deps.so -- all objects that were dlopen'd directly.
libtorch_xpu.so is pulled in as an indirect dependency, so glibc
resolves our dlopen() against those, never against ours. libccl.so.2 is
found only because it is a DT_NEEDED of libtorch_global_deps.so:

find library=libccl.so.2 ... (RPATH from file
.../libtorch_global_deps.so)
  find library=libccl.so.1 ... search cache=/etc/ld.so.cache
                           ... (system search path)

Ask the loader for the resolved path of libccl.so.2 and open libccl.so.1
from the same directory instead, which does not depend on any search
path.

(cherry picked from commit d44bbbc)
@github-actions github-actions Bot added disable_e2e Disable all e2e test jobs for the PR disable_win Disable Windows CI test jobs for the PR labels Oct 12, 2026
@chuanqi129
chuanqi129 merged commit e92f615 into release/2.15 Oct 13, 2026
19 of 21 checks passed
@chuanqi129
chuanqi129 deleted the cherry-pick-5670-by-chuanqi129 branch October 13, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_e2e Disable all e2e test jobs for the PR disable_win Disable Windows CI test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants