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

Using alternative managed symbolic links for library paths #4982

Merged
merged 2 commits into from
Oct 14, 2022
Merged
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
26 changes: 13 additions & 13 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def create_dockerfile_linux(ddir, dockerfile_name, argmap, backends, repoagents,
# stage of the PyTorch backend
if not FLAGS.enable_gpu and ('pytorch' in backends):
df += '''
RUN patchelf --add-needed /usr/local/cuda/lib64/stubs/libcublasLt.so.11 backends/pytorch/libtorch_cuda.so
RUN patchelf --add-needed /usr/local/cuda/lib64/stubs/libcublasLt.so backends/pytorch/libtorch_cuda.so
'''

with open(os.path.join(ddir, dockerfile_name), "w") as dfile:
Expand Down Expand Up @@ -1093,21 +1093,21 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu,
cuda_arch = 'sbsa' if target_machine == 'aarch64' else 'x86_64'
df += '''
RUN mkdir -p /usr/local/cuda/lib64/stubs
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcusparse.so /usr/local/cuda/lib64/stubs/libcusparse.so.11
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcusolver.so /usr/local/cuda/lib64/stubs/libcusolver.so.11
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcurand.so /usr/local/cuda/lib64/stubs/libcurand.so.10
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcufft.so /usr/local/cuda/lib64/stubs/libcufft.so.10
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcublas.so /usr/local/cuda/lib64/stubs/libcublas.so.11
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcublasLt.so /usr/local/cuda/lib64/stubs/libcublasLt.so.11
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcusparse.so /usr/local/cuda/lib64/stubs/.
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcusolver.so /usr/local/cuda/lib64/stubs/.
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcurand.so /usr/local/cuda/lib64/stubs/.
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcufft.so /usr/local/cuda/lib64/stubs/.
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcublas.so /usr/local/cuda/lib64/stubs/.
COPY --from=min_container /usr/local/cuda/lib64/stubs/libcublasLt.so /usr/local/cuda/lib64/stubs/.

RUN mkdir -p /usr/local/cuda/targets/{cuda_arch}-linux/lib
COPY --from=min_container /usr/local/cuda-11.8/targets/{cuda_arch}-linux/lib/libcudart.so.11.0 /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
COPY --from=min_container /usr/local/cuda-11.8/targets/{cuda_arch}-linux/lib/libcupti.so.11.8 /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
COPY --from=min_container /usr/local/cuda-11.8/targets/{cuda_arch}-linux/lib/libnvToolsExt.so.1 /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
COPY --from=min_container /usr/local/cuda/targets/{cuda_arch}-linux/lib/libcudart.so /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
COPY --from=min_container /usr/local/cuda/targets/{cuda_arch}-linux/lib/libcupti.so /usr/local/cuda/targets/{cuda_arch}-linux/lib/.
COPY --from=min_container /usr/local/cuda/targets/{cuda_arch}-linux/lib/libnvToolsExt.so /usr/local/cuda/targets/{cuda_arch}-linux/lib/.

COPY --from=min_container /usr/lib/{libs_arch}-linux-gnu/libcudnn.so.8 /usr/lib/{libs_arch}-linux-gnu/libcudnn.so.8
COPY --from=min_container /usr/lib/{libs_arch}-linux-gnu/libcudnn.so /usr/lib/{libs_arch}-linux-gnu/libcudnn.so

# patchelf is needed to add deps of libcublasLt.so.11 to libtorch_cuda.so
# patchelf is needed to add deps of libcublasLt.so to libtorch_cuda.so
RUN apt-get update && \
apt-get install -y --no-install-recommends openmpi-bin patchelf

Expand All @@ -1122,7 +1122,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu,
# this dependency is not present in the ubuntu base image, we must
# copy it from the Triton min container ourselves.
df += '''
COPY --from=min_container /usr/lib/{libs_arch}-linux-gnu/libnccl.so.2 /usr/lib/{libs_arch}-linux-gnu/libnccl.so.2
COPY --from=min_container /usr/lib/{libs_arch}-linux-gnu/libnccl.so /usr/lib/{libs_arch}-linux-gnu/libnccl.so
'''.format(libs_arch=libs_arch)

# Add dependencies needed for python backend
Expand Down