mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
[EP Perf Dashboard] Add TensorRT 8.5.1.1 dockerfile (#13843)
### Description - Adds a dockerfile for Ubuntu with TensorRT 8.5.1.1. - Adds option to run EP Perf pipeline with TensorRT 8.5 ### Motivation and Context Necessary to benchmark models with TensorRT 8.5
This commit is contained in:
parent
83c59d2594
commit
db9c677b63
3 changed files with 84 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ TRT_DOCKER_FILES = {
|
|||
"8.0": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_4_tensorrt8_0",
|
||||
"8.2": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_4_tensorrt8_2",
|
||||
"8.4": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_6_tensorrt8_4",
|
||||
"8.5": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_5",
|
||||
"BIN": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_tensorrt_bin",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ parameters:
|
|||
- 8.2.1.8
|
||||
- 8.0.1.6
|
||||
- 8.4.1.5
|
||||
- 8.5.1.1
|
||||
- BIN
|
||||
|
||||
- name: ModelGroups
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
# --------------------------------------------------------------
|
||||
# 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.24.3-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>=41.0.0
|
||||
|
||||
# Install TensorRT
|
||||
RUN v="8.5.1-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-dev=${v} libnvonnxparsers-dev=${v} libnvparsers-dev=${v} libnvinfer-plugin-dev=${v} \
|
||||
python3-libnvinfer=${v} libnvinfer-samples=${v}
|
||||
|
||||
# Compile trtexec
|
||||
RUN cd /usr/src/tensorrt/samples/trtexec && make
|
||||
|
||||
|
||||
# Build final image from base. Builds ORT.
|
||||
FROM base as final
|
||||
|
||||
# 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=37;50;52;60;61;70;75;80
|
||||
|
||||
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
|
||||
RUN /bin/sh build.sh --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}'"'
|
||||
|
||||
# Intall ORT wheel
|
||||
RUN pip install ${ONNXRUNTIME_LOCAL_CODE_DIR}/onnxruntime/build/Linux/Release/dist/*.whl
|
||||
Loading…
Reference in a new issue