diff --git a/onnxruntime/python/tools/tensorrt/perf/perf.sh b/onnxruntime/python/tools/tensorrt/perf/perf.sh index 8844e77a4d..5f67156043 100755 --- a/onnxruntime/python/tools/tensorrt/perf/perf.sh +++ b/onnxruntime/python/tools/tensorrt/perf/perf.sh @@ -53,7 +53,7 @@ download_files() { setup() { apt update apt-get install -y --no-install-recommends pciutils - pip install --upgrade pip + pip install --upgrade pip pip install -r requirements.txt if [ "$BUILD_ORT" = "False" ] then diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml index 276b2724e3..b347ede296 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml @@ -13,15 +13,16 @@ parameters: - name: RunNvidiaContainer displayName: Run in Nvidia Container (or set trtContainer Variable) type: boolean - default: true + default: false - name: TrtVersion displayName: TensorRT Version type: string - default: 8.2.1.8 + default: 8.4.1.5 values: - 8.2.1.8 - 8.0.1.6 + - 8.4.1.5 - name: ConfigureEPs displayName: Configure EPs (set epList variable - separate by spaces) @@ -81,7 +82,9 @@ jobs: ${{ if eq(parameters.RunNvidiaContainer, true) }}: value: $(dockerfile_path)/Dockerfile.tensorrt ${{ else }}: - ${{ if eq(parameters.TrtVersion, '8.2.1.8') }}: + ${{ if eq(parameters.TrtVersion, '8.4.1.5') }}: + value: $(dockerfile_path)/Dockerfile.ubuntu_cuda11_6_tensorrt8_4 + ${{ elseif eq(parameters.TrtVersion, '8.2.1.8') }}: value: $(dockerfile_path)/Dockerfile.ubuntu_cuda11_4_tensorrt8_2 ${{ elseif eq(parameters.TrtVersion, '8.0.1.6') }}: value: $(dockerfile_path)/Dockerfile.ubuntu_cuda11_4_tensorrt8_0 @@ -123,12 +126,12 @@ jobs: artifact: 'onnxruntime_gpu' targetPath: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/' - - ${{ if eq(parameters.RunNvidiaContainer, true) }}: - - script: 'docker pull $(nvidia_dockerfile)' - displayName: 'Pull Nvidia Dockerfile' - - ${{ if eq(parameters.RunNvidiaContainer, false) }}: - - script: 'Can only run pip package in Nvidia Container' - displayName: 'Please Re-run' + - ${{ if eq(parameters.RunNvidiaContainer, true) }}: + - script: 'docker pull $(nvidia_dockerfile)' + displayName: 'Pull Nvidia Dockerfile' + - ${{ else }}: + - script: 'Can only run pip package in Nvidia Container' + displayName: 'Please Re-run' - ${{ if eq(parameters.BuildORT, true) }}: - script: '$(Build.SourcesDirectory)/onnxruntime/python/tools/tensorrt/perf/build/build_image.sh -o $(Build.SourcesDirectory)/$(dockerfile) -b $(branch) -t $(tensorrt_version) -i $(image) -c 75 ' diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_6_tensorrt8_4 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_6_tensorrt8_4 new file mode 100644 index 0000000000..2af158dc43 --- /dev/null +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_6_tensorrt8_4 @@ -0,0 +1,55 @@ +# -------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# -------------------------------------------------------------- +# Dockerfile to run ONNXRuntime with TensorRT integration + +FROM nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04 + + +# ONNX Runtime Variables +ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime +ARG ONNXRUNTIME_BRANCH=master +ARG CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80 + +ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:/code/cmake-3.21.0-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.4.1-1+cuda11.6" &&\ + 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 + +WORKDIR /code + +# 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 &&\ + cd onnxruntime &&\ + /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 ..