mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-19 19:00:47 +00:00
[EP Perf] Update env to ubuntu 22.04 (#23570)
### Description <!-- Describe your changes. --> * Update env to cuda 12.6/ubuntu 22.04 (ubuntu 20.04 uses outdated py38 by default) * Clean old trt8.6 test config ### 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. -->
This commit is contained in:
parent
cddc271b0b
commit
816e8cb2fb
7 changed files with 6 additions and 199 deletions
|
|
@ -16,10 +16,8 @@ import subprocess
|
|||
import sys
|
||||
|
||||
TRT_DOCKER_FILES = {
|
||||
"8.6_cuda11.8_cudnn8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6",
|
||||
"8.6_cuda12.3_cudnn9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_3_tensorrt8_6",
|
||||
"10.7_cuda11.8_cudnn8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10",
|
||||
"10.7_cuda12.5_cudnn9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10",
|
||||
"10.7_cuda12.6_cudnn9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10",
|
||||
"BIN": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_tensorrt_bin",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@ parameters:
|
|||
- name: TrtVersion
|
||||
displayName: TensorRT Version
|
||||
type: string
|
||||
default: 10.7_cuda12.5_cudnn9
|
||||
default: 10.7_cuda12.6_cudnn9
|
||||
values:
|
||||
- 8.6_cuda11.8_cudnn8
|
||||
- 8.6_cuda12.3_cudnn9
|
||||
- 10.7_cuda11.8_cudnn8
|
||||
- 10.7_cuda12.5_cudnn9
|
||||
- 10.7_cuda12.6_cudnn9
|
||||
- BIN
|
||||
|
||||
- name: UseTensorrtOssParser
|
||||
|
|
|
|||
|
|
@ -1,93 +0,0 @@
|
|||
# --------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
# --------------------------------------------------------------
|
||||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
# Build base image with required system packages
|
||||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 AS base
|
||||
|
||||
# The local directory into which to build and install CMAKE
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
||||
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${ONNXRUNTIME_LOCAL_CODE_DIR}/cmake-3.30.1-linux-x86_64/bin:/opt/miniconda/bin:${PATH}
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update &&\
|
||||
apt-get install -y sudo git bash unattended-upgrades wget
|
||||
RUN unattended-upgrade
|
||||
|
||||
# Install python3
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python3-wheel &&\
|
||||
cd /usr/local/bin &&\
|
||||
ln -s /usr/bin/python3 python &&\
|
||||
ln -s /usr/bin/pip3 pip;
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install setuptools>=68.2.2
|
||||
|
||||
# Install TensorRT
|
||||
RUN v="8.6.1.6-1+cuda11.8" &&\
|
||||
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\
|
||||
apt-get update &&\
|
||||
sudo apt-get install -y libnvinfer8=${v} libnvonnxparsers8=${v} libnvparsers8=${v} libnvinfer-plugin8=${v} libnvinfer-lean8=${v} libnvinfer-vc-plugin8=${v} libnvinfer-dispatch8=${v}\
|
||||
libnvinfer-headers-dev=${v} libnvinfer-headers-plugin-dev=${v} libnvinfer-dev=${v} libnvonnxparsers-dev=${v} libnvparsers-dev=${v} libnvinfer-plugin-dev=${v} libnvinfer-lean-dev=${v} libnvinfer-vc-plugin-dev=${v} libnvinfer-dispatch-dev=${v}\
|
||||
python3-libnvinfer=${v} libnvinfer-samples=${v} tensorrt-dev=${v} tensorrt-libs=${v}
|
||||
|
||||
# Compile trtexec
|
||||
RUN cd /usr/src/tensorrt/samples/trtexec && make
|
||||
|
||||
# Install Valgrind
|
||||
RUN apt-get install -y valgrind
|
||||
|
||||
# Build final image from base. Builds ORT.
|
||||
FROM base as final
|
||||
ARG BUILD_USER=onnxruntimedev
|
||||
ARG BUILD_UID=1000
|
||||
RUN adduser --gecos 'onnxruntime Build User' --disabled-password $BUILD_USER --uid $BUILD_UID
|
||||
USER $BUILD_USER
|
||||
|
||||
# ONNX Runtime arguments
|
||||
|
||||
# URL to the github repo from which to clone ORT.
|
||||
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
||||
|
||||
# The local directory into which to clone ORT.
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
||||
# The git branch of ORT to checkout and build.
|
||||
ARG ONNXRUNTIME_BRANCH=main
|
||||
|
||||
# Optional. The specific commit to pull and build from. If not set, the latest commit is used.
|
||||
ARG ONNXRUNTIME_COMMIT_ID
|
||||
|
||||
# The supported CUDA architecture
|
||||
ARG CMAKE_CUDA_ARCHITECTURES=75
|
||||
|
||||
WORKDIR ${ONNXRUNTIME_LOCAL_CODE_DIR}
|
||||
|
||||
# Clone ORT repository with branch
|
||||
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
|
||||
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh
|
||||
|
||||
WORKDIR ${ONNXRUNTIME_LOCAL_CODE_DIR}/onnxruntime
|
||||
|
||||
# Reset to a specific commit if specified by build args.
|
||||
RUN if [ -z "$ONNXRUNTIME_COMMIT_ID" ] ; then echo "Building branch ${ONNXRUNTIME_BRANCH}" ;\
|
||||
else echo "Building branch ${ONNXRUNTIME_BRANCH} @ commit ${ONNXRUNTIME_COMMIT_ID}" &&\
|
||||
git reset --hard ${ONNXRUNTIME_COMMIT_ID} && git submodule update --recursive ; fi
|
||||
|
||||
# Build ORT
|
||||
ENV CUDA_MODULE_LOADING="LAZY"
|
||||
ARG PARSER_CONFIG=""
|
||||
RUN /bin/sh build.sh ${PARSER_CONFIG} --parallel --build_shared_lib --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_tensorrt --tensorrt_home /usr/lib/x86_64-linux-gnu/ --config Release --build_wheel --skip_tests --skip_submodule_sync --cmake_extra_defines '"CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'"'
|
||||
|
||||
# Switch to root to continue following steps of CI
|
||||
USER root
|
||||
|
||||
# Intall ORT wheel
|
||||
RUN pip install ${ONNXRUNTIME_LOCAL_CODE_DIR}/onnxruntime/build/Linux/Release/dist/*.whl
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
# Build base image with required system packages
|
||||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 AS base
|
||||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS base
|
||||
|
||||
# The local directory into which to build and install CMAKE
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
# --------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
# --------------------------------------------------------------
|
||||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
# Build base image with required system packages
|
||||
FROM nvidia/cuda:12.3.1-devel-ubuntu20.04 AS base
|
||||
|
||||
# The local directory into which to build and install CMAKE
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
||||
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${ONNXRUNTIME_LOCAL_CODE_DIR}/cmake-3.30.1-linux-x86_64/bin:/opt/miniconda/bin:${PATH}
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update &&\
|
||||
apt-get install -y sudo git bash unattended-upgrades wget
|
||||
RUN unattended-upgrade
|
||||
|
||||
# Install python3
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python3-wheel &&\
|
||||
cd /usr/local/bin &&\
|
||||
ln -s /usr/bin/python3 python &&\
|
||||
ln -s /usr/bin/pip3 pip;
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install setuptools>=68.2.2
|
||||
|
||||
# Install cuDNN v9
|
||||
RUN apt-get -y install cudnn9-cuda-12
|
||||
|
||||
# Install TensorRT
|
||||
RUN v="8.6.1.6-1+cuda12.0" &&\
|
||||
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\
|
||||
apt-get update &&\
|
||||
sudo apt-get install -y libnvinfer8=${v} libnvonnxparsers8=${v} libnvparsers8=${v} libnvinfer-plugin8=${v} libnvinfer-lean8=${v} libnvinfer-vc-plugin8=${v} libnvinfer-dispatch8=${v}\
|
||||
libnvinfer-headers-dev=${v} libnvinfer-headers-plugin-dev=${v} libnvinfer-dev=${v} libnvonnxparsers-dev=${v} libnvparsers-dev=${v} libnvinfer-plugin-dev=${v} libnvinfer-lean-dev=${v} libnvinfer-vc-plugin-dev=${v} libnvinfer-dispatch-dev=${v}\
|
||||
python3-libnvinfer=${v} libnvinfer-samples=${v} tensorrt-dev=${v} tensorrt-libs=${v}
|
||||
|
||||
# Compile trtexec
|
||||
RUN cd /usr/src/tensorrt/samples/trtexec && make
|
||||
|
||||
# Install Valgrind
|
||||
RUN apt-get install -y valgrind
|
||||
|
||||
# Build final image from base. Builds ORT.
|
||||
FROM base as final
|
||||
ARG BUILD_USER=onnxruntimedev
|
||||
ARG BUILD_UID=1000
|
||||
RUN adduser --gecos 'onnxruntime Build User' --disabled-password $BUILD_USER --uid $BUILD_UID
|
||||
USER $BUILD_USER
|
||||
|
||||
# ONNX Runtime arguments
|
||||
|
||||
# URL to the github repo from which to clone ORT.
|
||||
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
||||
|
||||
# The local directory into which to clone ORT.
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
||||
# The git branch of ORT to checkout and build.
|
||||
ARG ONNXRUNTIME_BRANCH=main
|
||||
|
||||
# Optional. The specific commit to pull and build from. If not set, the latest commit is used.
|
||||
ARG ONNXRUNTIME_COMMIT_ID
|
||||
|
||||
# The supported CUDA architecture
|
||||
ARG CMAKE_CUDA_ARCHITECTURES=75
|
||||
|
||||
WORKDIR ${ONNXRUNTIME_LOCAL_CODE_DIR}
|
||||
|
||||
# Clone ORT repository with branch
|
||||
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
|
||||
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh
|
||||
|
||||
WORKDIR ${ONNXRUNTIME_LOCAL_CODE_DIR}/onnxruntime
|
||||
|
||||
# Reset to a specific commit if specified by build args.
|
||||
RUN if [ -z "$ONNXRUNTIME_COMMIT_ID" ] ; then echo "Building branch ${ONNXRUNTIME_BRANCH}" ;\
|
||||
else echo "Building branch ${ONNXRUNTIME_BRANCH} @ commit ${ONNXRUNTIME_COMMIT_ID}" &&\
|
||||
git reset --hard ${ONNXRUNTIME_COMMIT_ID} && git submodule update --recursive ; fi
|
||||
|
||||
# Build ORT
|
||||
ENV CUDA_MODULE_LOADING="LAZY"
|
||||
ARG PARSER_CONFIG=""
|
||||
RUN /bin/sh build.sh ${PARSER_CONFIG} --parallel --build_shared_lib --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_tensorrt --tensorrt_home /usr/lib/x86_64-linux-gnu/ --config Release --build_wheel --skip_tests --skip_submodule_sync --cmake_extra_defines '"CMAKE_CUDA_ARCHITECTURES='${CMAKE_CUDA_ARCHITECTURES}'"'
|
||||
|
||||
# Switch to root to continue following steps of CI
|
||||
USER root
|
||||
|
||||
# Intall ORT wheel
|
||||
RUN pip install ${ONNXRUNTIME_LOCAL_CODE_DIR}/onnxruntime/build/Linux/Release/dist/*.whl
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
# Build base image with required system packages
|
||||
FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 AS base
|
||||
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04 AS base
|
||||
|
||||
# The local directory into which to build and install CMAKE
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# Dockerfile to run ONNXRuntime with TensorRT installed from provided binaries
|
||||
|
||||
# Build base image with required system packages
|
||||
FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 AS base
|
||||
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04 AS base
|
||||
|
||||
# The local directory into which to build and install CMAKE
|
||||
ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code
|
||||
|
|
|
|||
Loading…
Reference in a new issue