Skip to content

Commit 429f914

Browse files
dyastremskymc-nv
authored andcommitted
Ensure HPCX dependencies found in container (#5922)
* Add HPCX dependencies to search path * Copy hpcx to CPU-only container * Add ucc path to CPU-only image * Fixed if statement * Fix df variable * Combine hpcx LD_LIBRARY_PATH
1 parent fa4aca4 commit 429f914

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

build.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,12 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu,
11031103
if 'onnxruntime' in backends:
11041104
df += '''
11051105
ENV LD_LIBRARY_PATH /opt/tritonserver/backends/onnxruntime:${LD_LIBRARY_PATH}
1106+
'''
1107+
1108+
# Necessary for libtorch.so to find correct HPCX libraries
1109+
if ('pytorch' in backends):
1110+
df += '''
1111+
ENV LD_LIBRARY_PATH /opt/hpcx/ucc/lib/:/opt/hpcx/ucx/lib/:${LD_LIBRARY_PATH}
11061112
'''
11071113

11081114
backend_dependencies = ""
@@ -1209,6 +1215,13 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu,
12091215
COPY --from=min_container /usr/local/cuda-12.1/targets/{cuda_arch}-linux/lib/libnvToolsExt.so.1 /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
12101216
COPY --from=min_container /usr/local/cuda-12.1/targets/{cuda_arch}-linux/lib/libnvJitLink.so.12 /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
12111217
1218+
RUN mkdir -p /opt/hpcx/ucc/lib/ /opt/hpcx/ucx/lib/
1219+
COPY --from=min_container /opt/hpcx/ucc/lib/libucc.so.1 /opt/hpcx/ucc/lib/libucc.so.1
1220+
COPY --from=min_container /opt/hpcx/ucx/lib/libucm.so.0 /opt/hpcx/ucx/lib/libucm.so.0
1221+
COPY --from=min_container /opt/hpcx/ucx/lib/libucp.so.0 /opt/hpcx/ucx/lib/libucp.so.0
1222+
COPY --from=min_container /opt/hpcx/ucx/lib/libucs.so.0 /opt/hpcx/ucx/lib/libucs.so.0
1223+
COPY --from=min_container /opt/hpcx/ucx/lib/libuct.so.0 /opt/hpcx/ucx/lib/libuct.so.0
1224+
12121225
COPY --from=min_container /usr/lib/{libs_arch}-linux-gnu/libcudnn.so.8 /usr/lib/{libs_arch}-linux-gnu/libcudnn.so.8
12131226
12141227
# patchelf is needed to add deps of libcublasLt.so.12 to libtorch_cuda.so

0 commit comments

Comments
 (0)