mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-23 02:38:28 +00:00
[TensorRT EP] support TensorRT 8.6-EA (#15299)
### Description <!-- Describe your changes. --> * Integrate TRT 8.6EA on relevant Linux/Windows/pkg pipelines * Update onnx-tensorrt to 8.6 * Add new dockerfiles for TRT 8.6 and clean old ones * Update [CGManifest](https://github.com/microsoft/onnxruntime/tree/main/cgmanifests) files and ort build deps version * yml/script update * Enable built-in TRT parser option on TRT related pipelines by default * Exclude test TopKOperator.Top3ExplicitAxisInfinity out of TRT EP tests (8.6-EA has issue with topk operator)
This commit is contained in:
parent
e3086b2ed8
commit
8cd5f3ad9c
20 changed files with 142 additions and 334 deletions
|
|
@ -302,7 +302,7 @@
|
|||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"commitHash": "369d6676423c2a6dbf4a5665c4b5010240d99d3c",
|
||||
"commitHash": "ba6a4fb34fdeaa3613bf981610c657e7b663a699",
|
||||
"repositoryUrl": "https://github.com/onnx/onnx-tensorrt.git"
|
||||
},
|
||||
"comments": "onnx_tensorrt"
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ microsoft_wil;https://github.com/microsoft/wil/archive/5f4caba4e7a9017816e47becd
|
|||
mimalloc;https://github.com/microsoft/mimalloc/archive/refs/tags/v2.1.1.zip;d5ee7d34223d0567892db5179849939c8769dc41
|
||||
mp11;https://github.com/boostorg/mp11/archive/refs/tags/boost-1.79.0.zip;c8f04e378535ededbe5af52c8f969d2dedbe73d5
|
||||
onnx;https://github.com/onnx/onnx/archive/refs/tags/v1.13.1.zip;7a2517d3e7442109d540de2c86f29cd76d34cf28
|
||||
#use the commit where it's several commits after 8.5-GA branch (https://github.com/onnx/onnx-tensorrt/commit/369d6676423c2a6dbf4a5665c4b5010240d99d3c)
|
||||
onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/369d6676423c2a6dbf4a5665c4b5010240d99d3c.zip;62119892edfb78689061790140c439b111491275
|
||||
#use the last commit of 8.6-EA branch (https://github.com/onnx/onnx-tensorrt/commit/ba6a4fb34fdeaa3613bf981610c657e7b663a699)
|
||||
onnx_tensorrt;https://github.com/onnx/onnx-tensorrt/archive/ba6a4fb34fdeaa3613bf981610c657e7b663a699.zip;5a474ed86e2c4ee4085d3daeff8222866e933dc0
|
||||
protobuf;https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.zip;7cf2733949036c7d52fda017badcab093fe73bfa
|
||||
psimd;https://github.com/Maratyszcza/psimd/archive/072586a71b55b7f8c584153d223e95687148a900.zip;1f5454b01f06f9656b77e4a5e2e31d7422487013
|
||||
pthreadpool;https://github.com/Maratyszcza/pthreadpool/archive/1787867f6183f056420e532eec640cba25efafea.zip;e43e80781560c5ab404a4da20f34d846f5f5d101
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ static void top_3_explicit_aix_infinity(int opset_version, bool positive) {
|
|||
std::vector<int64_t> expected_indices = {0, 0, 1, 1, 2, 2};
|
||||
std::vector<int64_t> expected_dimensions = {3, 2};
|
||||
int64_t axis = 0;
|
||||
RunTest(opset_version, 3, input_vals, input_dimensions, expected_vals, expected_indices, expected_dimensions, true, axis, 0, 1);
|
||||
RunTest(opset_version, 3, input_vals, input_dimensions, expected_vals, expected_indices, expected_dimensions, false, axis, 0, 1);
|
||||
}
|
||||
|
||||
TEST(TopKOperator, Top3ExplicitAxisInfinity) {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ stages:
|
|||
buildArch: x64
|
||||
msbuildPlatform: x64
|
||||
packageName: x64-tensorrt
|
||||
buildparameter: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --enable_onnx_tests --enable_wcos --build_java --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
buildparameter: --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --enable_onnx_tests --enable_wcos --build_java --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
runTests: ${{ parameters.RunOnnxRuntimeTests }}
|
||||
buildJava: true
|
||||
java_artifact_id: onnxruntime_gpu
|
||||
|
|
@ -316,13 +316,13 @@ stages:
|
|||
Steps:
|
||||
- script: |
|
||||
tools/ci_build/get_docker_image.py \
|
||||
--dockerfile tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5 \
|
||||
--dockerfile tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6 \
|
||||
--context tools/ci_build/github/linux/docker \
|
||||
--docker-build-args "--network=host --build-arg POLICY=manylinux2014 --build-arg PLATFORM=x86_64 --build-arg DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-11/root --build-arg PREPEND_PATH=/opt/rh/devtoolset-11/root/usr/bin: --build-arg LD_LIBRARY_PATH_ARG=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/usr/local/lib64 --build-arg BUILD_UID=$( id -u )" \
|
||||
--container-registry onnxruntimebuildcache \
|
||||
--multiple_repos \
|
||||
--repository onnxruntimecuda116xtrt85build
|
||||
displayName: "Get onnxruntimecuda116xtrt85build image for tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5"
|
||||
--repository onnxruntimecuda118xtrt86build
|
||||
displayName: "Get onnxruntimecuda118xtrt86build image for tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6"
|
||||
workingDirectory: $(Build.SourcesDirectory)/onnxruntime
|
||||
ContainerRegistry: onnxruntimebuildcache
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ stages:
|
|||
inputs:
|
||||
script: |
|
||||
docker run --gpus all -e CC=/opt/rh/devtoolset-11/root/usr/bin/cc -e CXX=/opt/rh/devtoolset-11/root/usr/bin/c++ -e CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -O3 -Wl,--strip-all" -e CXXFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -O3 -Wl,--strip-all" -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/src_dir \
|
||||
--volume $(Build.ArtifactStagingDirectory):/artifact_src -e NIGHTLY_BUILD onnxruntimecuda116xtrt85build \
|
||||
--volume $(Build.ArtifactStagingDirectory):/artifact_src -e NIGHTLY_BUILD onnxruntimecuda118xtrt86build \
|
||||
/src_dir/onnxruntime-inference-examples/c_cxx/squeezenet/run_capi_application.sh -o /src_dir/onnxruntime -p /artifact_src/onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion).tgz -w /src_dir/onnxruntime-inference-examples/c_cxx/squeezenet
|
||||
workingDirectory: '$(Build.ArtifactStagingDirectory)'
|
||||
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ jobs:
|
|||
|
||||
- template: templates/get-docker-image-steps.yml
|
||||
parameters:
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6
|
||||
Context: tools/ci_build/github/linux/docker
|
||||
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux2014 --build-arg PLATFORM=x86_64 --build-arg DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-11/root --build-arg PREPEND_PATH=/opt/rh/devtoolset-11/root/usr/bin: --build-arg LD_LIBRARY_PATH_ARG=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/usr/local/lib64 --build-arg BUILD_UID=$( id -u )"
|
||||
Repository: onnxruntimetensorrt85gpubuild
|
||||
Repository: onnxruntimetensorrt86gpubuild
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=0 \
|
||||
-e NIGHTLY_BUILD \
|
||||
-e BUILD_BUILDNUMBER \
|
||||
onnxruntimetensorrt85gpubuild \
|
||||
onnxruntimetensorrt86gpubuild \
|
||||
/opt/python/cp38-cp38/bin/python3 /onnxruntime_src/tools/ci_build/build.py \
|
||||
--build_dir /build --cmake_generator Ninja \
|
||||
--config Release \
|
||||
|
|
@ -47,9 +47,9 @@ jobs:
|
|||
--build_shared_lib \
|
||||
--parallel \
|
||||
--build_wheel \
|
||||
--enable_onnx_tests --use_cuda --cuda_version=11.6 --cuda_home=/usr/local/cuda-11.6 --cudnn_home=/usr/local/cuda-11.6 \
|
||||
--enable_onnx_tests --use_cuda --cuda_version=11.8 --cuda_home=/usr/local/cuda-11.8 --cudnn_home=/usr/local/cuda-11.8 \
|
||||
--enable_pybind --build_java \
|
||||
--use_tensorrt --tensorrt_placeholder_builder --tensorrt_home /usr \
|
||||
--use_tensorrt --use_tensorrt_builtin_parser --tensorrt_placeholder_builder --tensorrt_home /usr \
|
||||
--cmake_extra_defines CMAKE_CUDA_HOST_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/cc CMAKE_CUDA_ARCHITECTURES=75
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@ parameters:
|
|||
- name: TrtVersion
|
||||
displayName: TensorRT Version
|
||||
type: string
|
||||
default: 8.5.1.1
|
||||
default: 8.6.0.12
|
||||
values:
|
||||
- 8.2.1.8
|
||||
- 8.0.1.6
|
||||
- 8.4.1.5
|
||||
- 8.5.1.1
|
||||
- 8.6.0.12
|
||||
- BIN
|
||||
|
||||
- name: ModelGroups
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ steps:
|
|||
packageType: upack
|
||||
feed: '/7424c8e4-5c62-490e-95c4-79446f31017c'
|
||||
definition: '517c4f6f-5437-4392-a70d-4f15ec5be2f0'
|
||||
version: 1.0.41
|
||||
version: 1.0.44
|
||||
downloadPath: $(Build.BinariesDirectory)/deps
|
||||
|
||||
# The private ADO project
|
||||
|
|
@ -22,7 +22,7 @@ steps:
|
|||
packageType: upack
|
||||
feed: '/4c7631f5-24c0-4307-8822-1aa8f180c325'
|
||||
definition: 'fd9dd5ad-b73e-4678-890e-edcf680dbc1a'
|
||||
version: 1.0.41
|
||||
version: 1.0.44
|
||||
downloadPath: $(Build.BinariesDirectory)/deps
|
||||
|
||||
# You can add more ADO accounts at here.
|
||||
|
|
|
|||
|
|
@ -26,17 +26,17 @@ stages:
|
|||
timeoutInMinutes: 180
|
||||
pool: 'Onnxruntime-Linux-GPU'
|
||||
variables:
|
||||
CUDA_VERSION: '11.6'
|
||||
CUDA_VERSION: '11.8'
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
submodules: recursive
|
||||
- template: get-docker-image-steps.yml
|
||||
parameters:
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6
|
||||
Context: tools/ci_build/github/linux/docker
|
||||
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux2014 --build-arg PLATFORM=x86_64 --build-arg DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-11/root --build-arg PREPEND_PATH=/opt/rh/devtoolset-11/root/usr/bin: --build-arg LD_LIBRARY_PATH_ARG=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/usr/local/lib64 --build-arg BUILD_UID=$( id -u )"
|
||||
Repository: onnxruntimecuda114xtrt82build
|
||||
Repository: onnxruntimecuda118xtrt86build
|
||||
- template: set-version-number-variables-step.yml
|
||||
|
||||
- task: CmdLine@2
|
||||
|
|
@ -44,9 +44,9 @@ stages:
|
|||
script: |
|
||||
mkdir -p $HOME/.onnx
|
||||
docker run --gpus all -e CC=/opt/rh/devtoolset-11/root/usr/bin/cc -e CXX=/opt/rh/devtoolset-11/root/usr/bin/c++ -e CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -O3 -Wl,--strip-all" -e CXXFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fstack-clash-protection -fcf-protection -O3 -Wl,--strip-all" -e NVIDIA_VISIBLE_DEVICES=all --rm --volume /data/onnx:/data/onnx:ro --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build \
|
||||
--volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecuda114xtrt82build \
|
||||
--volume /data/models:/build/models:ro --volume $HOME/.onnx:/home/onnxruntimedev/.onnx -e NIGHTLY_BUILD onnxruntimecuda118xtrt86build \
|
||||
/opt/python/cp38-cp38/bin/python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release \
|
||||
--skip_submodule_sync --parallel --build_shared_lib ${{ parameters.buildJavaOption }} --use_tensorrt --tensorrt_placeholder_builder --cuda_version=$(CUDA_VERSION) --cuda_home=/usr/local/cuda-$(CUDA_VERSION) --cudnn_home=/usr --tensorrt_home=/usr --cmake_extra_defines CMAKE_CUDA_HOST_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/cc 'CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80'
|
||||
--skip_submodule_sync --parallel --build_shared_lib ${{ parameters.buildJavaOption }} --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_placeholder_builder --cuda_version=$(CUDA_VERSION) --cuda_home=/usr/local/cuda-$(CUDA_VERSION) --cudnn_home=/usr --tensorrt_home=/usr --cmake_extra_defines CMAKE_CUDA_HOST_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/cc 'CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80'
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
|
||||
- ${{ if eq(parameters.buildJava, true) }}:
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ jobs:
|
|||
|
||||
- template: get-docker-image-steps.yml
|
||||
parameters:
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6
|
||||
Context: tools/ci_build/github/linux/docker
|
||||
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux2014 --build-arg PLATFORM=x86_64 --build-arg DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-11/root --build-arg PREPEND_PATH=/opt/rh/devtoolset-11/root/usr/bin: --build-arg LD_LIBRARY_PATH_ARG=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/usr/local/lib64 --build-arg BUILD_UID=$( id -u ) --build-arg PLATFORM=${{ parameters.arch }}"
|
||||
Repository: onnxruntimecuda116xtrt85build${{ parameters.arch }}
|
||||
Repository: onnxruntimecuda118xtrt86build${{ parameters.arch }}
|
||||
|
||||
|
||||
- task: Bash@3
|
||||
|
|
@ -34,7 +34,7 @@ jobs:
|
|||
inputs:
|
||||
targetType: filePath
|
||||
filePath: tools/ci_build/github/linux/run_python_dockerbuild.sh
|
||||
arguments: -i onnxruntimecuda116xtrt85build${{ parameters.arch }} -x "-d GPU"
|
||||
arguments: -i onnxruntimecuda118xtrt86build${{ parameters.arch }} -x "-d GPU"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: ONNXRuntime python wheel'
|
||||
|
|
|
|||
|
|
@ -307,10 +307,10 @@ stages:
|
|||
|
||||
- template: get-docker-image-steps.yml
|
||||
parameters:
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_6_tensorrt8_5
|
||||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.manylinux2014_cuda11_8_tensorrt8_6
|
||||
Context: tools/ci_build/github/linux/docker
|
||||
DockerBuildArgs: "--network=host --build-arg POLICY=manylinux2014 --build-arg PLATFORM=x86_64 --build-arg DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-11/root --build-arg PREPEND_PATH=/opt/rh/devtoolset-11/root/usr/bin: --build-arg LD_LIBRARY_PATH_ARG=/opt/rh/devtoolset-11/root/usr/lib64:/opt/rh/devtoolset-11/root/usr/lib:/opt/rh/devtoolset-11/root/usr/lib64/dyninst:/opt/rh/devtoolset-11/root/usr/lib/dyninst:/usr/local/lib64 --build-arg BUILD_UID=$( id -u )"
|
||||
Repository: onnxruntimecuda116xtrt85build
|
||||
Repository: onnxruntimecuda118xtrt86build
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Build Python Wheel'
|
||||
|
|
@ -324,14 +324,14 @@ stages:
|
|||
--volume /data/models:/build/models:ro \
|
||||
--volume $HOME/.onnx:/home/onnxruntimedev/.onnx \
|
||||
-e BUILD_BUILDNUMBER \
|
||||
onnxruntimecuda116xtrt85build \
|
||||
onnxruntimecuda118xtrt86build \
|
||||
$(PythonManylinuxDir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py \
|
||||
--build_dir /build --cmake_generator Ninja \
|
||||
--config Release --update --build \
|
||||
--skip_submodule_sync \
|
||||
--parallel \
|
||||
--build_wheel \
|
||||
--enable_onnx_tests --use_tensorrt --cuda_version=11.6 --tensorrt_home=/usr --cuda_home=/usr/local/cuda-11.6 --cudnn_home=/usr/local/cuda-11.6 \
|
||||
--enable_onnx_tests --use_tensorrt --use_tensorrt_builtin_parser --cuda_version=11.8 --tensorrt_home=/usr --cuda_home=/usr/local/cuda-11.8 --cudnn_home=/usr/local/cuda-11.8 \
|
||||
${{ parameters.gpu_build_py_parameters }} \
|
||||
--cmake_extra_defines CMAKE_CUDA_HOST_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/cc 'CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80'
|
||||
workingDirectory: $(Build.SourcesDirectory)
|
||||
|
|
@ -361,7 +361,7 @@ stages:
|
|||
--skip_submodule_sync \
|
||||
--parallel \
|
||||
--build_wheel \
|
||||
--enable_onnx_tests --use_tensorrt --cuda_version=11.4 --tensorrt_home=/usr --cuda_home=/usr/local/cuda-11.4 --cudnn_home=/usr/local/cuda-11.4 \
|
||||
--enable_onnx_tests --use_tensorrt --use_tensorrt_builtin_parser --cuda_version=11.4 --tensorrt_home=/usr --cuda_home=/usr/local/cuda-11.4 --cudnn_home=/usr/local/cuda-11.4 \
|
||||
${{ parameters.gpu_build_py_parameters }} --ctest_path '' \
|
||||
--cmake_extra_defines CMAKE_CUDA_HOST_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/cc 'CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80'
|
||||
|
||||
|
|
@ -392,7 +392,7 @@ stages:
|
|||
variables:
|
||||
CUDA_VERSION: '11.6'
|
||||
buildArch: x64
|
||||
EpBuildFlags: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=$(CUDA_VERSION) --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$(CUDA_VERSION)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80"
|
||||
EpBuildFlags: --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=$(CUDA_VERSION) --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$(CUDA_VERSION)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80"
|
||||
EnvSetupScript: setup_env_gpu.bat
|
||||
EP_NAME: gpu
|
||||
strategy:
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ stages:
|
|||
parameters:
|
||||
MACHINE_POOL: 'onnxruntime-gpu-winbuild-t4'
|
||||
PYTHON_VERSION: '3.8'
|
||||
EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
EP_BUILD_FLAGS: --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
ENV_SETUP_SCRIPT: setup_env_gpu.bat
|
||||
EP_NAME: gpu
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ stages:
|
|||
parameters:
|
||||
MACHINE_POOL: 'onnxruntime-gpu-winbuild-t4'
|
||||
PYTHON_VERSION: '3.9'
|
||||
EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
EP_BUILD_FLAGS: --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
ENV_SETUP_SCRIPT: setup_env_gpu.bat
|
||||
EP_NAME: gpu
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ stages:
|
|||
parameters:
|
||||
MACHINE_POOL: 'onnxruntime-gpu-winbuild-t4'
|
||||
PYTHON_VERSION: '3.10'
|
||||
EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
EP_BUILD_FLAGS: --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
|
||||
ENV_SETUP_SCRIPT: setup_env_gpu.bat
|
||||
EP_NAME: gpu
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ jobs:
|
|||
displayName: 'Generate cmake config'
|
||||
inputs:
|
||||
scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py'
|
||||
arguments: '--config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 16 2019" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_placeholder_builder --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75'
|
||||
arguments: '--config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 16 2019" --build_wheel --enable_onnx_tests --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_placeholder_builder --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75'
|
||||
workingDirectory: '$(Build.BinariesDirectory)'
|
||||
|
||||
- task: VSBuild@1
|
||||
|
|
@ -84,7 +84,7 @@ jobs:
|
|||
del wheel_filename_file
|
||||
python.exe -m pip install -q --upgrade %WHEEL_FILENAME%
|
||||
set PATH=$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig);%PATH%
|
||||
python $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 16 2019" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_placeholder_builder --tensorrt_home="C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
|
||||
python $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(BuildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 16 2019" --build_wheel --enable_onnx_tests --use_tensorrt --use_tensorrt_builtin_parser --tensorrt_placeholder_builder --tensorrt_home="C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8" --cuda_version=11.6 --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
|
||||
|
||||
workingDirectory: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'
|
||||
displayName: 'Run tests'
|
||||
|
|
|
|||
|
|
@ -1,176 +0,0 @@
|
|||
ARG BASEIMAGE=nvidia/cuda:11.4.2-cudnn8-devel-centos7
|
||||
ARG POLICY=manylinux2014
|
||||
ARG PLATFORM=x86_64
|
||||
ARG DEVTOOLSET_ROOTPATH=
|
||||
ARG LD_LIBRARY_PATH_ARG=
|
||||
ARG PREPEND_PATH=
|
||||
|
||||
#We need CUDA, TensorRT and manylinux. But the CUDA Toolkit End User License Agreement says NVIDIA CUDA Driver Libraries(libcuda.so, libnvidia-ptxjitcompiler.so) are only distributable in applications that meet this criteria:
|
||||
#1. The application was developed starting from a NVIDIA CUDA container obtained from Docker Hub or the NVIDIA GPU Cloud, and
|
||||
#2. The resulting application is packaged as a Docker container and distributed to users on Docker Hub or the NVIDIA GPU Cloud only.
|
||||
#So we use CUDA as the base image then add manylinux and TensorRT on top of it.
|
||||
|
||||
#Build manylinux2014 docker image begin
|
||||
FROM $BASEIMAGE AS runtime_base
|
||||
ARG POLICY
|
||||
ARG PLATFORM
|
||||
ARG DEVTOOLSET_ROOTPATH
|
||||
ARG LD_LIBRARY_PATH_ARG
|
||||
ARG PREPEND_PATH
|
||||
LABEL maintainer="The ManyLinux project"
|
||||
|
||||
ENV AUDITWHEEL_POLICY=${POLICY} AUDITWHEEL_ARCH=${PLATFORM} AUDITWHEEL_PLAT=${POLICY}_${PLATFORM}
|
||||
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
|
||||
ENV DEVTOOLSET_ROOTPATH=${DEVTOOLSET_ROOTPATH}
|
||||
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH_ARG}
|
||||
ENV PATH=${PREPEND_PATH}${PATH}
|
||||
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
|
||||
# first copy the fixup mirrors script, keep the script around
|
||||
COPY build_scripts/fixup-mirrors.sh /usr/local/sbin/fixup-mirrors
|
||||
|
||||
# setup entrypoint, this will wrap commands with `linux32` with i686 images
|
||||
COPY build_scripts/install-entrypoint.sh \
|
||||
build_scripts/update-system-packages.sh \
|
||||
build_scripts/build_utils.sh \
|
||||
/build_scripts/
|
||||
|
||||
RUN /build_scripts/install-entrypoint.sh && rm -rf /build_scripts
|
||||
COPY manylinux-entrypoint /usr/local/bin/manylinux-entrypoint
|
||||
ENTRYPOINT ["manylinux-entrypoint"]
|
||||
|
||||
COPY build_scripts/install-runtime-packages.sh \
|
||||
build_scripts/update-system-packages.sh \
|
||||
build_scripts/build_utils.sh \
|
||||
/build_scripts/
|
||||
RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh && rm -rf /build_scripts/
|
||||
|
||||
COPY build_scripts/build_utils.sh /build_scripts/
|
||||
|
||||
COPY build_scripts/install-autoconf.sh /build_scripts/
|
||||
RUN export AUTOCONF_ROOT=autoconf-2.71 && \
|
||||
export AUTOCONF_HASH=431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c && \
|
||||
export AUTOCONF_DOWNLOAD_URL=http://ftp.gnu.org/gnu/autoconf && \
|
||||
manylinux-entrypoint /build_scripts/install-autoconf.sh
|
||||
|
||||
COPY build_scripts/install-automake.sh /build_scripts/
|
||||
RUN export AUTOMAKE_ROOT=automake-1.16.5 && \
|
||||
export AUTOMAKE_HASH=07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605 && \
|
||||
export AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake && \
|
||||
manylinux-entrypoint /build_scripts/install-automake.sh
|
||||
|
||||
COPY build_scripts/install-libtool.sh /build_scripts/
|
||||
RUN export LIBTOOL_ROOT=libtool-2.4.7 && \
|
||||
export LIBTOOL_HASH=04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8 && \
|
||||
export LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool && \
|
||||
manylinux-entrypoint /build_scripts/install-libtool.sh
|
||||
|
||||
COPY build_scripts/install-libxcrypt.sh /build_scripts/
|
||||
RUN export LIBXCRYPT_VERSION=4.4.28 && \
|
||||
export LIBXCRYPT_HASH=db7e37901969cb1d1e8020cb73a991ef81e48e31ea5b76a101862c806426b457 && \
|
||||
export LIBXCRYPT_DOWNLOAD_URL=https://github.com/besser82/libxcrypt/archive && \
|
||||
export PERL_ROOT=perl-5.34.0 && \
|
||||
export PERL_HASH=551efc818b968b05216024fb0b727ef2ad4c100f8cb6b43fab615fa78ae5be9a && \
|
||||
export PERL_DOWNLOAD_URL=https://www.cpan.org/src/5.0 && \
|
||||
manylinux-entrypoint /build_scripts/install-libxcrypt.sh
|
||||
|
||||
FROM runtime_base AS build_base
|
||||
COPY build_scripts/install-build-packages.sh /build_scripts/
|
||||
RUN manylinux-entrypoint /build_scripts/install-build-packages.sh
|
||||
|
||||
|
||||
FROM build_base AS build_git
|
||||
COPY build_scripts/build-git.sh /build_scripts/
|
||||
RUN export GIT_ROOT=git-2.36.2 && \
|
||||
export GIT_HASH=6dc2cdea5fb23d823ba4871cc23222c1db31dfbb6d6c6ff74c4128700df57c68 && \
|
||||
export GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git && \
|
||||
manylinux-entrypoint /build_scripts/build-git.sh
|
||||
|
||||
|
||||
FROM build_base AS build_cpython
|
||||
COPY build_scripts/build-sqlite3.sh /build_scripts/
|
||||
RUN export SQLITE_AUTOCONF_ROOT=sqlite-autoconf-3390200 && \
|
||||
export SQLITE_AUTOCONF_HASH=852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de && \
|
||||
export SQLITE_AUTOCONF_DOWNLOAD_URL=https://www.sqlite.org/2022 && \
|
||||
manylinux-entrypoint /build_scripts/build-sqlite3.sh
|
||||
|
||||
COPY build_scripts/build-openssl.sh /build_scripts/
|
||||
RUN export OPENSSL_ROOT=openssl-1.1.1q && \
|
||||
export OPENSSL_HASH=d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca && \
|
||||
export OPENSSL_DOWNLOAD_URL=https://www.openssl.org/source && \
|
||||
manylinux-entrypoint /build_scripts/build-openssl.sh
|
||||
|
||||
COPY build_scripts/build-cpython.sh /build_scripts/
|
||||
|
||||
|
||||
FROM build_cpython AS build_cpython38
|
||||
COPY build_scripts/ambv-pubkey.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.8.13
|
||||
|
||||
|
||||
FROM build_cpython AS build_cpython39
|
||||
COPY build_scripts/ambv-pubkey.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.9.13
|
||||
|
||||
|
||||
FROM build_cpython AS build_cpython310
|
||||
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.10.5
|
||||
|
||||
FROM build_cpython AS build_cpython311
|
||||
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2
|
||||
|
||||
FROM build_cpython AS all_python
|
||||
COPY build_scripts/install-pypy.sh \
|
||||
build_scripts/pypy.sha256 \
|
||||
build_scripts/finalize-python.sh \
|
||||
/build_scripts/
|
||||
RUN manylinux-entrypoint /build_scripts/install-pypy.sh 3.8 7.3.9
|
||||
RUN manylinux-entrypoint /build_scripts/install-pypy.sh 3.9 7.3.9
|
||||
COPY --from=build_cpython38 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
|
||||
RUN manylinux-entrypoint /build_scripts/finalize-python.sh
|
||||
|
||||
|
||||
FROM runtime_base
|
||||
COPY --from=build_git /manylinux-rootfs /
|
||||
COPY --from=build_cpython /manylinux-rootfs /
|
||||
COPY --from=all_python /opt/_internal /opt/_internal/
|
||||
COPY build_scripts/finalize.sh \
|
||||
build_scripts/update-system-packages.sh \
|
||||
build_scripts/python-tag-abi-tag.py \
|
||||
build_scripts/requirements3.8.txt \
|
||||
build_scripts/requirements3.9.txt \
|
||||
build_scripts/requirements3.10.txt \
|
||||
build_scripts/requirements3.11.txt \
|
||||
build_scripts/requirements-base-tools.txt \
|
||||
/build_scripts/
|
||||
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
|
||||
RUN manylinux-entrypoint /build_scripts/finalize.sh && rm -rf /build_scripts
|
||||
|
||||
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
#Build manylinux2014 docker image end
|
||||
|
||||
#Install TensorRT 8.2.2.1
|
||||
#RUN yum install -y wget
|
||||
RUN v="8.2.2-1.cuda11.4" &&\
|
||||
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo &&\
|
||||
yum -y install libnvinfer8-${v} libnvparsers8-${v} libnvonnxparsers8-${v} libnvinfer-plugin8-${v} \
|
||||
libnvinfer-devel-${v} libnvparsers-devel-${v} libnvonnxparsers-devel-${v} libnvinfer-plugin-devel-${v}
|
||||
|
||||
#Add our own dependencies
|
||||
ADD scripts /tmp/scripts
|
||||
RUN cd /tmp/scripts && /tmp/scripts/manylinux/install_centos.sh && /tmp/scripts/manylinux/install_deps.sh && rm -rf /tmp/scripts
|
||||
|
||||
ARG BUILD_UID=1001
|
||||
ARG BUILD_USER=onnxruntimedev
|
||||
RUN adduser --uid $BUILD_UID $BUILD_USER
|
||||
WORKDIR /home/$BUILD_USER
|
||||
USER $BUILD_USER
|
||||
ENV PATH /usr/local/dotnet:$PATH
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
ARG BASEIMAGE=nvidia/cuda:11.4.0-cudnn8-devel-centos7
|
||||
ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-centos7
|
||||
ARG POLICY=manylinux2014
|
||||
ARG PLATFORM=x86_64
|
||||
ARG DEVTOOLSET_ROOTPATH=
|
||||
|
|
@ -103,6 +103,11 @@ RUN export OPENSSL_ROOT=openssl-1.1.1q && \
|
|||
COPY build_scripts/build-cpython.sh /build_scripts/
|
||||
|
||||
|
||||
FROM build_cpython AS build_cpython37
|
||||
COPY build_scripts/cpython-pubkeys.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.7.13
|
||||
|
||||
|
||||
FROM build_cpython AS build_cpython38
|
||||
COPY build_scripts/ambv-pubkey.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.8.13
|
||||
|
|
@ -119,15 +124,17 @@ RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.10.5
|
|||
|
||||
FROM build_cpython AS build_cpython311
|
||||
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2
|
||||
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.0b5
|
||||
|
||||
FROM build_cpython AS all_python
|
||||
COPY build_scripts/install-pypy.sh \
|
||||
build_scripts/pypy.sha256 \
|
||||
build_scripts/finalize-python.sh \
|
||||
/build_scripts/
|
||||
RUN manylinux-entrypoint /build_scripts/install-pypy.sh 3.7 7.3.9
|
||||
RUN manylinux-entrypoint /build_scripts/install-pypy.sh 3.8 7.3.9
|
||||
RUN manylinux-entrypoint /build_scripts/install-pypy.sh 3.9 7.3.9
|
||||
COPY --from=build_cpython37 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython38 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
|
||||
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
|
||||
|
|
@ -142,6 +149,7 @@ COPY --from=all_python /opt/_internal /opt/_internal/
|
|||
COPY build_scripts/finalize.sh \
|
||||
build_scripts/update-system-packages.sh \
|
||||
build_scripts/python-tag-abi-tag.py \
|
||||
build_scripts/requirements3.7.txt \
|
||||
build_scripts/requirements3.8.txt \
|
||||
build_scripts/requirements3.9.txt \
|
||||
build_scripts/requirements3.10.txt \
|
||||
|
|
@ -157,12 +165,12 @@ CMD ["/bin/bash"]
|
|||
|
||||
#Build manylinux2014 docker image end
|
||||
|
||||
#Install TensorRT 8.0.1.6
|
||||
#Install TensorRT 8.6.0.12
|
||||
#RUN yum install -y wget
|
||||
RUN v="8.0.1-1.cuda11.3" &&\
|
||||
RUN v="8.6.0.12-1.cuda11.8" &&\
|
||||
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo &&\
|
||||
yum -y install libnvinfer8-${v} libnvparsers8-${v} libnvonnxparsers8-${v} libnvinfer-plugin8-${v} \
|
||||
libnvinfer-devel-${v} libnvparsers-devel-${v} libnvonnxparsers-devel-${v} libnvinfer-plugin-devel-${v}
|
||||
yum -y install libnvinfer8-${v} libnvparsers8-${v} libnvonnxparsers8-${v} libnvinfer-plugin8-${v} libnvinfer-vc-plugin8-${v}\
|
||||
libnvinfer-devel-${v} libnvparsers-devel-${v} libnvonnxparsers-devel-${v} libnvinfer-plugin-devel-${v} libnvinfer-vc-plugin-devel-${v}
|
||||
|
||||
#Add our own dependencies
|
||||
ADD scripts /tmp/scripts
|
||||
|
|
@ -173,4 +181,4 @@ ARG BUILD_USER=onnxruntimedev
|
|||
RUN adduser --uid $BUILD_UID $BUILD_USER
|
||||
WORKDIR /home/$BUILD_USER
|
||||
USER $BUILD_USER
|
||||
ENV PATH /usr/local/dotnet:$PATH
|
||||
ENV PATH /usr/local/dotnet:$PATH
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# --------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
# --------------------------------------------------------------
|
||||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
ARG OS_VERSION=18.04
|
||||
FROM nvidia/cuda:11.4.0-cudnn8-devel-ubuntu${OS_VERSION}
|
||||
|
||||
# ONNX Runtime Variables
|
||||
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
||||
ARG ONNXRUNTIME_BRANCH=main
|
||||
ARG CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80
|
||||
|
||||
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/code/cmake-3.24.3-linux-x86_64/bin:/opt/miniconda/bin:${PATH}
|
||||
ENV LD_LIBRARY_PATH /opt/miniconda/lib:$LD_LIBRARY_PATH
|
||||
|
||||
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.0.1-1+cuda11.3" &&\
|
||||
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/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}
|
||||
|
||||
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 &&\
|
||||
/bin/sh onnxruntime/dockerfiles/scripts/checkout_submodules.sh 8.0 &&\
|
||||
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 ..
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
# --------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
# --------------------------------------------------------------
|
||||
# Dockerfile to run ONNXRuntime with TensorRT integration
|
||||
|
||||
ARG OS_VERSION=20.04
|
||||
FROM nvidia/cuda:11.4.2-cudnn8-devel-ubuntu${OS_VERSION}
|
||||
|
||||
|
||||
# ONNX Runtime Variables
|
||||
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
|
||||
ARG ONNXRUNTIME_BRANCH=main
|
||||
ARG CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80
|
||||
|
||||
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/code/cmake-3.24.3-linux-x86_64/bin:/opt/miniconda/bin:${PATH}
|
||||
ENV LD_LIBRARY_PATH /opt/miniconda/lib:$LD_LIBRARY_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.2.1-1+cuda11.4" &&\
|
||||
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/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}
|
||||
|
||||
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 &&\
|
||||
/bin/sh onnxruntime/dockerfiles/scripts/checkout_submodules.sh 8.2 &&\
|
||||
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 ..
|
||||
|
|
@ -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.6.0.12-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-vc-plugin8=${v}\
|
||||
libnvinfer-dev=${v} libnvonnxparsers-dev=${v} libnvparsers-dev=${v} libnvinfer-plugin-dev=${v} libnvinfer-vc-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
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Tag: nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04
|
||||
# Label: com.nvidia.cuda.version: 11.6.1
|
||||
# Label: com.nvidia.cudnn.version: 8.4.0
|
||||
# Tag: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
|
||||
# Label: com.nvidia.cuda.version: 11.8.0
|
||||
# Label: com.nvidia.cudnn.version: 8.7.0
|
||||
# Ubuntu 20.04
|
||||
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
|
||||
|
||||
|
|
@ -11,11 +11,11 @@ ADD scripts /tmp/scripts
|
|||
RUN /tmp/scripts/install_ubuntu.sh -p $PYTHON_VERSION && /tmp/scripts/install_os_deps.sh && /tmp/scripts/install_python_deps.sh -p $PYTHON_VERSION && rm -rf /tmp/scripts
|
||||
|
||||
# Install TensorRT
|
||||
RUN v="8.5.1-1+cuda11.8" &&\
|
||||
RUN v="8.6.0.12-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} \
|
||||
sudo apt-get install -y libnvinfer8=${v} libnvonnxparsers8=${v} libnvparsers8=${v} libnvinfer-plugin8=${v} libnvinfer-vc-plugin8=${v}\
|
||||
libnvinfer-dev=${v} libnvonnxparsers-dev=${v} libnvparsers-dev=${v} libnvinfer-plugin-dev=${v} libnvinfer-vc-plugin-dev=${v}\
|
||||
python3-libnvinfer=${v} libnvinfer-samples=${v}
|
||||
|
||||
WORKDIR /root
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ elif [ $BUILD_DEVICE = "gpu" ]; then
|
|||
--docker-build-args="--build-arg BASEIMAGE=nvcr.io/nvidia/cuda:11.6.2-cudnn8-devel-${BUILD_OS} --build-arg BUILD_USER=onnxruntimedev --build-arg BUILD_UID=$(id -u) --build-arg PYTHON_VERSION=${PYTHON_VER} --build-arg INSTALL_DEPS_EXTRA_ARGS=\"${INSTALL_DEPS_EXTRA_ARGS}\" --build-arg USE_CONDA=${USE_CONDA} --network=host" \
|
||||
--dockerfile Dockerfile.ubuntu_gpu_training --context .
|
||||
elif [[ $BUILD_DEVICE = "tensorrt"* ]]; then
|
||||
IMAGE="$BUILD_OS-cuda11.8-cudnn8.4-tensorrt8.5"
|
||||
IMAGE="$BUILD_OS-cuda11.8-cudnn8.7-tensorrt8.6"
|
||||
DOCKER_FILE=Dockerfile.ubuntu_tensorrt
|
||||
|
||||
$GET_DOCKER_IMAGE_CMD --repository "onnxruntime-$IMAGE" \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
REM Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
REM Licensed under the MIT License.
|
||||
|
||||
set PATH=C:\local\TensorRT-8.5.1.7.Windows10.x86_64.cuda-11.8.cudnn8.6\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\extras\CUPTI\lib64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin;%PATH%
|
||||
set PATH=C:\local\TensorRT-8.6.0.12.Windows10.x86_64.cuda-11.8\lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\extras\CUPTI\lib64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin;%PATH%
|
||||
set GRADLE_OPTS=-Dorg.gradle.daemon=false
|
||||
set CUDA_MODULE_LOADING=LAZY
|
||||
|
|
|
|||
Loading…
Reference in a new issue