onnxruntime/dockerfiles/Dockerfile.tensorrt
Olivia Jain eee627fde9
Track Session Creation Time (#10281)
* add back previous changes lost in merge

* post session to dashboard

* post session creation time to dashboard

* fix trt 8 functionality:

* add component governance

* Remove hardcoded values

* Update linux-gpu-tensorrt-daily-perf-pipeline.yml for Azure Pipelines

* cleanup errors

* post results only once

* checkout 8.0 GA

* try build 8.0 without building shared lib

* add back build_shared_lib, not the problem

* add upload_time to table

* use identifier to post

* Shorten to TRT x.x

* shorten commit hash using rev_parse

* use shortened commit hash

* use nvidia's default TRT_VERSION
2022-01-21 13:20:53 -08:00

32 lines
1.6 KiB
Text

# --------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------
# Dockerfile to run ONNXRuntime with TensorRT integration
# nVidia TensorRT Base Image
ARG TRT_CONTAINER_VERSION=21.12
FROM nvcr.io/nvidia/tensorrt:${TRT_CONTAINER_VERSION}-py3
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=master
ARG CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80
RUN apt-get update &&\
apt-get install -y sudo git bash unattended-upgrades
RUN unattended-upgrade
WORKDIR /code
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/code/cmake-3.21.0-linux-x86_64/bin:/opt/miniconda/bin:${PATH}
# Prepare onnxruntime repository & build onnxruntime with TensorRT
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh
# Checkout appropriate TRT_VERSION and build
RUN cd onnxruntime &&\
trt_version=${TRT_VERSION:0:3} &&\
./onnxruntime/python/tools/tensorrt/perf/build/checkout_trt.sh ${trt_version} &&\
/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}'"' &&\
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
cd ..