Skip to content

Commit

Permalink
Merge Cuda docker files into a single one (microsoft#18020)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 authored and kleiti committed Mar 22, 2024
1 parent 6fe9b6e commit bdcaa90
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 730 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,15 @@ def run(self):

cuda_dependencies = [
"libcublas.so.11",
"libcublas.so.12",
"libcublasLt.so.11",
"libcudnn.so.8",
"libcublasLt.so.12",
"libcudart.so.11.0",
"libcurand.so.10",
"libcudart.so.12.0",
"libcudnn.so.8",
"libcufft.so.10",
"libcufft.so.11",
"libcurand.so.10",
]
rocm_dependencies = [
"librccl.so.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,13 @@ stages:
Steps:
- script: |
tools/ci_build/get_docker_image.py \
--dockerfile tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6 \
--dockerfile tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda \
--context tools/ci_build/github/linux/docker \
--docker-build-args "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u ) --build-arg BUILD_UID=$( id -u )" \
--docker-build-args "--network=host --build-arg BASEIMAGE=nvidia/cuda:11.8.0-devel-ubi8 --build-arg INSTALL_CUDNN=true --build-arg TRT_VERSION=8.6.1.6-1.cuda11.8 --build-arg BUILD_UID=$( id -u )" \
--container-registry onnxruntimebuildcache \
--multiple_repos \
--repository onnxruntimecuda118xtrt86build
displayName: "Get onnxruntimecuda118xtrt86build image for tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6"
displayName: "Get onnxruntimecuda118xtrt86build image for tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda"
workingDirectory: $(Build.SourcesDirectory)/onnxruntime
ContainerRegistry: onnxruntimebuildcache

Expand Down
20 changes: 16 additions & 4 deletions tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ jobs:

- template: templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u )"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntimecuda11build

- task: Cache@2
Expand Down Expand Up @@ -154,9 +160,15 @@ jobs:

- template: templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u )"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntimecuda11build

- task: CmdLine@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ jobs:

- template: templates/get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u )"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntimetensorrt86gpubuild

- template: templates/linux-build-step-with-cache.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ stages:
submodules: recursive
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u )"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntimecuda118xtrt86build
- template: set-version-number-variables-step.yml

Expand Down
11 changes: 9 additions & 2 deletions tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ jobs:

- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u ) --build-arg PLATFORM=${{ parameters.arch }}"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
--build-arg PLATFORM=${{ parameters.arch }}
"
Repository: onnxruntimecuda118xtrt86build${{ parameters.arch }}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ jobs:

- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11_8_tensorrt8_6
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Context: tools/ci_build/github/linux/docker
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux_2_28 --build-arg PLATFORM=x86_64 --build-arg PREPEND_PATH=/usr/local/cuda/bin --build-arg LD_LIBRARY_PATH_ARG=/usr/local/lib64 --build-arg DEVTOOLSET_ROOTPATH=/usr --build-arg BUILD_UID=$( id -u ) --build-arg PLATFORM=${{ parameters.arch }}"
DockerBuildArgs: "
--network=host
--build-arg BASEIMAGE=nvidia/cuda:11.8.0-devel-ubi8
--build-arg TRT_VERSION=8.6.1.6-1.cuda11.8
--build-arg INSTALL_CUDNN=true
--build-arg BUILD_UID=$( id -u )
--build-arg PLATFORM=${{ parameters.arch }}
"
Repository: onnxruntimecuda118xtrt86build${{ parameters.arch }}

- task: Bash@3
Expand Down
51 changes: 31 additions & 20 deletions tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
ARG POLICY=manylinux_2_28
ARG PLATFORM=x86_64
ARG BASEIMAGE=nvidia/cuda:12.2.0-devel-ubi8
ARG TRT_VERSION=8.6.1.6-1.cuda12.0
ARG DEVTOOLSET_ROOTPATH=/usr
ARG LD_LIBRARY_PATH_ARG=/usr/local/lib64
ARG PREPEND_PATH=/usr/local/cuda/binet

ARG INSTALL_CUDNN=false

#Build manylinux docker image begin
FROM $BASEIMAGE AS runtime_base
Expand Down Expand Up @@ -118,7 +117,7 @@ RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.10.5

FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.0b5
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
Expand Down Expand Up @@ -155,23 +154,35 @@ CMD ["/bin/bash"]

#Build manylinux docker image end

#Install TensorRT 8.6.1.6
RUN CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p') &&\
dnf -y install\
libcudnn8-devel-*cuda${CUDA_VERSION}*\
libcudnn8-*cuda${CUDA_VERSION}*\
libnvinfer8-${TRT_VERSION}\
libnvparsers8-${TRT_VERSION}\
libnvonnxparsers8-${TRT_VERSION}\
libnvinfer-plugin8-${TRT_VERSION}\
libnvinfer-vc-plugin8-${TRT_VERSION}\
libnvinfer-devel-${TRT_VERSION}\
libnvparsers-devel-${TRT_VERSION}\
libnvonnxparsers-devel-${TRT_VERSION}\
libnvinfer-plugin-devel-${TRT_VERSION}\
libnvinfer-vc-plugin-devel-${TRT_VERSION}\
libnvinfer-headers-devel-${TRT_VERSION}\
libnvinfer-headers-plugin-devel-${TRT_VERSION}

#Install optinal Cudnn
RUN if [ "$INSTALL_CUDNN" = true ]; then \
CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p') && \
dnf -y install \
libcudnn8-devel-*cuda${CUDA_VERSION}* \
libcudnn8-*cuda${CUDA_VERSION}* ; \
fi

#Install TensorRT only if TRT_VERSION is not empty
RUN if [ -n "$TRT_VERSION" ]; then \
echo "TRT_VERSION is $TRT_VERSION" && \
dnf -y install \
libnvinfer8-${TRT_VERSION} \
libnvparsers8-${TRT_VERSION} \
libnvonnxparsers8-${TRT_VERSION} \
libnvinfer-plugin8-${TRT_VERSION} \
libnvinfer-vc-plugin8-${TRT_VERSION} \
libnvinfer-devel-${TRT_VERSION} \
libnvparsers-devel-${TRT_VERSION} \
libnvonnxparsers-devel-${TRT_VERSION} \
libnvinfer-plugin-devel-${TRT_VERSION} \
libnvinfer-vc-plugin-devel-${TRT_VERSION} \
libnvinfer-headers-devel-${TRT_VERSION} \
libnvinfer-headers-plugin-devel-${TRT_VERSION}; \
else \
echo "TRT_VERSION is none skipping Tensor RT Installation" ; \
fi

ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-11
#Add our own dependencies
ADD scripts /tmp/scripts
Expand Down
166 changes: 0 additions & 166 deletions tools/ci_build/github/linux/docker/Dockerfile.manylinux2_28_cuda11

This file was deleted.

Loading

0 comments on commit bdcaa90

Please sign in to comment.