fix(docker): set LD_LIBRARY_PATH for AWS EFA OFI plugin discovery#2585
Merged
Conversation
NCCL silently falls back to socket transport when libnccl-net-ofi.so is not on the dynamic linker search path. Add /opt/amazon/ofi-nccl/lib (plugin) and /opt/amazon/efa/lib (libfabric) to LD_LIBRARY_PATH and /etc/ld.so.conf.d in both release stages so EFA SRD is used on p4d/p5/p5en hosts where aws-efa-installer mounts these paths. Supersedes NVIDIA-NeMo#2410 — that change targeted /opt/amazon/aws-ofi-nccl/lib, which does not exist on current aws-efa-installer layouts; verified on p5.48xlarge that the OFI plugin actually lives at /opt/amazon/ofi-nccl/lib. Also registers via ld.so.conf.d so the cache can be refreshed with a single ldconfig at runtime once host paths are mounted. Signed-off-by: oliver könig <okoenig@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
/ok to test |
terrykong
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
/opt/amazon/ofi-nccl/liband/opt/amazon/efa/libtoLD_LIBRARY_PATHin the release stage of bothdocker/Dockerfileanddocker/Dockerfile.ngc_pytorch, and registers them in/etc/ld.so.conf.d/aws-efa.confso a runtimeldconfigrefreshes the cache once host paths are mounted.Why
Without these on the dynamic-linker search path, NCCL silently falls back to its socket transport on EFA-enabled AWS hosts (p4d / p5 / p5en) instead of routing through the SRD fabric. Same intent as #2410, but with the correct install path for the current
aws-efa-installerlayout.Why a new PR rather than amending #2410
#2410 prepends
/opt/amazon/aws-ofi-nccl/lib— that directory does not exist on a stock currentaws-efa-installerinstall. The OFI plugin actually lives at/opt/amazon/ofi-nccl/lib:So #2410 as-is is inert on these hosts.
Verification
Built an image carrying #2410's change (
nvcr.io/nvidian/nemo-rl:testing-2410-cuda) and ran it on ap5.48xlargeEFA node with/opt/amazonhostPath-mounted:echo $LD_LIBRARY_PATH(image-baked)/opt/amazon/aws-ofi-nccl/lib:/opt/amazon/efa/lib:...ls /opt/amazon/aws-ofi-nccl/libNo such file or directoryldconfig -p | grep libnccl-netlibnccl-net-ofi.soRepeated with the corrected path (
LD_LIBRARY_PATH=/opt/amazon/ofi-nccl/lib:...plus a/etc/ld.so.conf.dentry):ld.so --library-path "$LD_LIBRARY_PATH" --list .../libnccl-net-ofi.soldconfig:ldconfig -p | grep libnccl-netlibnccl-net-ofi.so → /opt/amazon/ofi-nccl/lib/libnccl-net-ofi.soSo the path correction lets NCCL's runtime
dlopen("libnccl-net-ofi.so")resolve, which is what the original PR aimed for.Note on the test methodology in #2410
ldconfig -preads/etc/ld.so.cache, notLD_LIBRARY_PATH— so the validation step in #2410's description (exec pod0 -- ldconfig -p | grep libnccl-net) wouldn't reflect anyENV LD_LIBRARY_PATHchange, with either the original or corrected path. The fix on this PR side: write the paths to/etc/ld.so.conf.d/aws-efa.conftoo — then aldconfig && ldconfig -pat runtime (after host mounts are in place) does show the plugin in the cache.Related