2019-07-09 09:03:55 +00:00
|
|
|
# --------------------------------------------------------------
|
|
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
# --------------------------------------------------------------
|
|
|
|
|
# Dockerfile to run ONNXRuntime with TensorRT integration
|
|
|
|
|
|
|
|
|
|
# nVidia TensorRT Base Image
|
2020-02-13 22:34:00 +00:00
|
|
|
FROM nvcr.io/nvidia/tensorrt:20.01-py3
|
2019-07-09 09:03:55 +00:00
|
|
|
MAINTAINER Vinitra Swamy "viswamy@microsoft.com"
|
|
|
|
|
|
|
|
|
|
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
2019-11-07 00:54:10 +00:00
|
|
|
ARG ONNXRUNTIME_BRANCH=master
|
2019-07-09 09:03:55 +00:00
|
|
|
|
|
|
|
|
RUN apt-get update &&\
|
|
|
|
|
apt-get install -y sudo git bash
|
|
|
|
|
|
|
|
|
|
WORKDIR /code
|
|
|
|
|
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/code/cmake-3.14.3-Linux-x86_64/bin:/opt/miniconda/bin:${PATH}
|
2019-11-06 19:29:55 +00:00
|
|
|
ENV LD_LIBRARY_PATH /opt/miniconda/lib:$LD_LIBRARY_PATH
|
2019-07-09 09:03:55 +00:00
|
|
|
|
|
|
|
|
# Prepare onnxruntime repository & build onnxruntime with TensorRT
|
2019-11-07 00:54:10 +00:00
|
|
|
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
|
2019-09-13 21:16:47 +00:00
|
|
|
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
|
2019-10-20 14:58:36 +00:00
|
|
|
cp onnxruntime/docs/Privacy.md /code/Privacy.md &&\
|
2019-07-09 09:03:55 +00:00
|
|
|
cp onnxruntime/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt &&\
|
2019-08-09 20:02:06 +00:00
|
|
|
cp onnxruntime/ThirdPartyNotices.txt /code/ThirdPartyNotices.txt &&\
|
2019-07-09 09:03:55 +00:00
|
|
|
cd onnxruntime &&\
|
2020-05-25 00:38:44 +00:00
|
|
|
/bin/sh ./build.sh --cuda_home /usr/local/cuda --cudnn_home /usr/lib/x86_64-linux-gnu/ --use_tensorrt --tensorrt_home /workspace/tensorrt --config Release --build_wheel --update --build --cmake_extra_defines ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) &&\
|
2019-07-09 09:03:55 +00:00
|
|
|
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
|
|
|
|
|
cd .. &&\
|
2019-08-31 05:32:24 +00:00
|
|
|
rm -rf onnxruntime cmake-3.14.3-Linux-x86_64
|