From f03aeb6c6170921ed8f939b4d191131104c3fb87 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Thu, 9 Jan 2025 23:47:24 -0800 Subject: [PATCH 01/14] Update CUDA archs in ORT --- tools/gen_ort_dockerfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index ef5c0b3..bcc8eea 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -283,7 +283,7 @@ def dockerfile_for_linux(output_file): ) cuda_archs = "53;62;72;87" else: - cuda_archs = "75;80;86;90" + cuda_archs = "75;80;86;90;100;120" df += """ WORKDIR /workspace/onnxruntime @@ -478,7 +478,7 @@ def dockerfile_for_windows(output_file): WORKDIR /workspace/onnxruntime ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat" RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat') -RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} +RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90,100,120" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} """.format( ep_flags ) From 8f8ea27dca30165157d6bc1be84dbabca26810b2 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Thu, 9 Jan 2025 23:50:12 -0800 Subject: [PATCH 02/14] Update CUDA archs in ORT and fixing typo --- tools/gen_ort_dockerfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index bcc8eea..a28080d 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -478,7 +478,7 @@ def dockerfile_for_windows(output_file): WORKDIR /workspace/onnxruntime ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat" RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat') -RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90,100,120" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} +RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90;100;120" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} """.format( ep_flags ) From 9cf0c012c059a9126f33d1469a395a2a0d7923dc Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Fri, 10 Jan 2025 10:07:19 -0800 Subject: [PATCH 03/14] Update cudnn home --- tools/gen_ort_dockerfile.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index a28080d..08687aa 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -259,10 +259,6 @@ def dockerfile_for_linux(output_file): ep_flags += ' --cuda_version "{}"'.format(FLAGS.cuda_version) if FLAGS.cuda_home is not None: ep_flags += ' --cuda_home "{}"'.format(FLAGS.cuda_home) - if FLAGS.cudnn_home is not None: - ep_flags += ' --cudnn_home "{}"'.format(FLAGS.cudnn_home) - elif target_platform() == "igpu": - ep_flags += ' --cudnn_home "/usr/lib/aarch64-linux-gnu"' if FLAGS.ort_tensorrt: ep_flags += " --use_tensorrt" if FLAGS.ort_version >= "1.12.1": @@ -292,6 +288,16 @@ def dockerfile_for_linux(output_file): """.format( cuda_archs ) + if FLAGS.enable_gpu : #and target_platform() != "igpu" + # For GPU build, include the cudnn_home flag + df += """ + RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} --cudnn_home /usr/local/cudnn-$_CUDNN_VERSION/cuda + """.format(ep_flags) + else: + # For non-GPU + df += """ + RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} + """.format(ep_flags) df += """ RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} From c132ac15d89f4393196914e38df8cb07a78f2f25 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Sat, 11 Jan 2025 14:45:06 -0800 Subject: [PATCH 04/14] Version upgrade for openvino updated from 24.12 --- CMakeLists.txt | 2 +- cmake/download_onnxruntime.cmake | 2 +- tools/gen_ort_dockerfile.py | 39 ++++++++++++++++++-------------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d396d..3e450fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,7 @@ install( # that tar file. We copy over the libraries and other requirements # prior to running this build and therefore these set of install # commands are not needed. -if(TRITON_ONNXRUNTIME_DOCKER_BUILD) +if(TRITON_ONNXRUNTIME_DOCKER_BUILD OR DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime/ diff --git a/cmake/download_onnxruntime.cmake b/cmake/download_onnxruntime.cmake index 0c09025..6401c2b 100644 --- a/cmake/download_onnxruntime.cmake +++ b/cmake/download_onnxruntime.cmake @@ -1,7 +1,7 @@ if(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) set(DOWNLOAD_PATH "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime.zip") - set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime") + set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/onnxruntime") message(NOTICE "Downloading onnxruntime: ${TRITON_ONNXRUNTIME_PACKAGE_URL}") diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 08687aa..09ba74c 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -56,6 +56,10 @@ "2024.4", # OpenVINO short version "2024.4.0.16579.c3152d32c9c", # OpenVINO version with build number ), + "2024.5.0": ( + "2024.5", # OpenVINO short version + "2024.5.0.17288.7975fa5da0c", # OpenVINO version with build number + ), } @@ -158,16 +162,16 @@ def dockerfile_for_linux(output_file): && cmake --version """ - if FLAGS.enable_gpu: - df += """ -# Allow configure to pick up cuDNN where it expects it. -# (Note: $CUDNN_VERSION is defined by base image) -RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ - mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ - ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ - mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ - ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so -""" +# if FLAGS.enable_gpu: +# df += """ +# # Allow configure to pick up cuDNN where it expects it. +# # (Note: $CUDNN_VERSION is defined by base image) +# RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ +# mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ +# ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ +# mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ +# ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so +# """ if FLAGS.ort_openvino is not None: df += """ @@ -401,7 +405,7 @@ def dockerfile_for_linux(output_file): """ df += """ RUN cd /opt/onnxruntime/lib && \ - for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \ + for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\\.so*'`; do \ patchelf --set-rpath '$ORIGIN' $i; \ done @@ -482,7 +486,7 @@ def dockerfile_for_windows(output_file): df += """ WORKDIR /workspace/onnxruntime -ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat" +ARG VS_DEVCMD_BAT="\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat') RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90;100;120" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} """.format( @@ -565,12 +569,13 @@ def preprocess_gpu_flags(): FLAGS.tensorrt_home = "/tensorrt" else: if "CUDNN_VERSION" in os.environ: - version = None - m = re.match(r"([0-9]\.[0-9])\.[0-9]\.[0-9]", os.environ["CUDNN_VERSION"]) - if m: - version = m.group(1) + # version = None + # m = re.match(r"([0-9]\.[0-9])\.[0-9]\.[0-9]", os.environ["CUDNN_VERSION"]) + # if m: + # version = m.group(1) if FLAGS.cudnn_home is None: - FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) + #FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) + FLAGS.cudnn_home = "/usr" if FLAGS.cuda_home is None: FLAGS.cuda_home = "/usr/local/cuda" From cdb1bf4251390a3a6e9313a7c45ba5628f2552f5 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Sat, 11 Jan 2025 18:40:06 -0800 Subject: [PATCH 05/14] Update CUDNN_home for v9.7.0 --- tools/gen_ort_dockerfile.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 09ba74c..4965751 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -263,6 +263,10 @@ def dockerfile_for_linux(output_file): ep_flags += ' --cuda_version "{}"'.format(FLAGS.cuda_version) if FLAGS.cuda_home is not None: ep_flags += ' --cuda_home "{}"'.format(FLAGS.cuda_home) + if FLAGS.cudnn_home is not None: + ep_flags += ' --cudnn_home "{}"'.format(FLAGS.cudnn_home) + elif target_platform() == "igpu": + ep_flags += ' --cudnn_home "/usr/lib/aarch64-linux-gnu"' if FLAGS.ort_tensorrt: ep_flags += " --use_tensorrt" if FLAGS.ort_version >= "1.12.1": @@ -292,16 +296,16 @@ def dockerfile_for_linux(output_file): """.format( cuda_archs ) - if FLAGS.enable_gpu : #and target_platform() != "igpu" - # For GPU build, include the cudnn_home flag - df += """ - RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} --cudnn_home /usr/local/cudnn-$_CUDNN_VERSION/cuda - """.format(ep_flags) - else: - # For non-GPU - df += """ - RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} - """.format(ep_flags) + # if FLAGS.enable_gpu : #and target_platform() != "igpu" + # # For GPU build, include the cudnn_home flag + # df += """ + # RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} --cudnn_home /usr/local/cudnn-$_CUDNN_VERSION/cuda + # """.format(ep_flags) + # else: + # # For non-GPU + # df += """ + # RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} + # """.format(ep_flags) df += """ RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} @@ -575,7 +579,8 @@ def preprocess_gpu_flags(): # version = m.group(1) if FLAGS.cudnn_home is None: #FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) - FLAGS.cudnn_home = "/usr" + #FLAGS.cudnn_home = "/usr/include" + FLAGS.cudnn_home = "/usr/lib/x86_64-linux-gnu/" if FLAGS.cuda_home is None: FLAGS.cuda_home = "/usr/local/cuda" From 05cb26274c016f381694f8986578cf02421aa836 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Sat, 11 Jan 2025 21:13:37 -0800 Subject: [PATCH 06/14] Update the home path --- tools/gen_ort_dockerfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 4965751..2dc9c9a 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -162,16 +162,16 @@ def dockerfile_for_linux(output_file): && cmake --version """ -# if FLAGS.enable_gpu: -# df += """ -# # Allow configure to pick up cuDNN where it expects it. -# # (Note: $CUDNN_VERSION is defined by base image) -# RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ -# mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ -# ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ -# mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ -# ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so -# """ + if FLAGS.enable_gpu: + df += """ +# Allow configure to pick up cuDNN where it expects it. +# (Note: $CUDNN_VERSION is defined by base image) +RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ + mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ + ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ + mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ + ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so +""" if FLAGS.ort_openvino is not None: df += """ @@ -266,7 +266,7 @@ def dockerfile_for_linux(output_file): if FLAGS.cudnn_home is not None: ep_flags += ' --cudnn_home "{}"'.format(FLAGS.cudnn_home) elif target_platform() == "igpu": - ep_flags += ' --cudnn_home "/usr/lib/aarch64-linux-gnu"' + ep_flags += ' --cudnn_home "/usr/include"' if FLAGS.ort_tensorrt: ep_flags += " --use_tensorrt" if FLAGS.ort_version >= "1.12.1": From b85e02772e5c12b4d0b778a5d953f939d1d3e91f Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Sat, 11 Jan 2025 21:56:01 -0800 Subject: [PATCH 07/14] Update path --- tools/gen_ort_dockerfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 2dc9c9a..1778ca5 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -579,8 +579,8 @@ def preprocess_gpu_flags(): # version = m.group(1) if FLAGS.cudnn_home is None: #FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) - #FLAGS.cudnn_home = "/usr/include" - FLAGS.cudnn_home = "/usr/lib/x86_64-linux-gnu/" + FLAGS.cudnn_home = "/usr/include" + #FLAGS.cudnn_home = "/usr/lib/x86_64-linux-gnu/" if FLAGS.cuda_home is None: FLAGS.cuda_home = "/usr/local/cuda" From f019e435d6cb503adf17e7f467d1b4aeed1c3cec Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Sun, 12 Jan 2025 21:54:07 -0800 Subject: [PATCH 08/14] Update CUDNN home --- tools/gen_ort_dockerfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 1778ca5..7843efb 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -579,7 +579,7 @@ def preprocess_gpu_flags(): # version = m.group(1) if FLAGS.cudnn_home is None: #FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) - FLAGS.cudnn_home = "/usr/include" + FLAGS.cudnn_home = "/usr" #FLAGS.cudnn_home = "/usr/lib/x86_64-linux-gnu/" if FLAGS.cuda_home is None: From 153af0eb862f1e224f6489afbf402dc16001cd9e Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Mon, 13 Jan 2025 11:18:17 -0800 Subject: [PATCH 09/14] Remove comments --- tools/gen_ort_dockerfile.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 7843efb..2a657f3 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -296,16 +296,6 @@ def dockerfile_for_linux(output_file): """.format( cuda_archs ) - # if FLAGS.enable_gpu : #and target_platform() != "igpu" - # # For GPU build, include the cudnn_home flag - # df += """ - # RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} --cudnn_home /usr/local/cudnn-$_CUDNN_VERSION/cuda - # """.format(ep_flags) - # else: - # # For non-GPU - # df += """ - # RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} - # """.format(ep_flags) df += """ RUN ./build.sh ${{COMMON_BUILD_ARGS}} --update --build {} @@ -573,14 +563,8 @@ def preprocess_gpu_flags(): FLAGS.tensorrt_home = "/tensorrt" else: if "CUDNN_VERSION" in os.environ: - # version = None - # m = re.match(r"([0-9]\.[0-9])\.[0-9]\.[0-9]", os.environ["CUDNN_VERSION"]) - # if m: - # version = m.group(1) if FLAGS.cudnn_home is None: - #FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version) FLAGS.cudnn_home = "/usr" - #FLAGS.cudnn_home = "/usr/lib/x86_64-linux-gnu/" if FLAGS.cuda_home is None: FLAGS.cuda_home = "/usr/local/cuda" From e6fab15728c77bb9fcb12d48dad50cdfa167d991 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Tue, 14 Jan 2025 07:58:12 -0800 Subject: [PATCH 10/14] Update the supported igpu NVCC --- tools/gen_ort_dockerfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 2a657f3..4099e08 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -285,7 +285,7 @@ def dockerfile_for_linux(output_file): ep_flags += ( " --skip_tests --cmake_extra_defines 'onnxruntime_BUILD_UNIT_TESTS=OFF'" ) - cuda_archs = "53;62;72;87" + cuda_archs = "87;101" else: cuda_archs = "75;80;86;90;100;120" From 139178cee22e7626978f0d7c39cf92eaf84828f4 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Tue, 14 Jan 2025 08:12:24 -0800 Subject: [PATCH 11/14] Update the supported igpu and dgpu NVCC --- tools/gen_ort_dockerfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 4099e08..2c6189d 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -287,7 +287,7 @@ def dockerfile_for_linux(output_file): ) cuda_archs = "87;101" else: - cuda_archs = "75;80;86;90;100;120" + cuda_archs = "75;80;86;89;90;100;120" df += """ WORKDIR /workspace/onnxruntime From 705f1574fd3a1753a57cc3d8ffbfddfa33984bdc Mon Sep 17 00:00:00 2001 From: Misha Chornyi <99709299+mc-nv@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:21:53 -0800 Subject: [PATCH 12/14] Upadate default branch post 24.12 (#290) * Update README and versions for 2.53.0 / 24.12 (#288) * Update 'gen_ort_dockerfile.py' fil to meet changes in ONNX Runtime 1.20.x * remove psutils * Update reformating * restore description * Update OpenVINO to 2024.5 (#287) * Update 'gen_ort_dockerfile.py' fil to meet changes in ONNX Runtime 1.20.x * remove psutils * Add OpenVINO version * Fix pre-commit issues * Extract archive in different location (#289) * Extract archive in different location * Revert "Extract archive in different location" This reverts commit e57256a07c1c39afec0e9355e8433ea01dcbd569. * Update installation instructions * Reapply "Extract archive in different location" This reverts commit 59e24e48c6306990f8a59326164f3acef842b3c4. --- tools/gen_ort_dockerfile.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 2c6189d..2a5a4f7 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -161,16 +161,6 @@ def dockerfile_for_linux(output_file): && apt-get install -y --no-install-recommends cmake=3.28.3* cmake-data=3.28.3* \\ && cmake --version -""" - if FLAGS.enable_gpu: - df += """ -# Allow configure to pick up cuDNN where it expects it. -# (Note: $CUDNN_VERSION is defined by base image) -RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ - mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ - ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ - mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ - ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so """ if FLAGS.ort_openvino is not None: @@ -611,6 +601,7 @@ def preprocess_gpu_flags(): default=None, help='Target for build, can be "linux", "windows", "rhel", or "igpu". If not specified, build targets the current platform.', ) + parser.add_argument( "--cuda-version", type=str, required=False, help="Version for CUDA." ) From 58b08e3ee047b3192181e8a49501273b4fdb0179 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Wed, 15 Jan 2025 13:06:52 -0800 Subject: [PATCH 13/14] Rolling back changes cherry picked from 24.12 --- CMakeLists.txt | 2 +- cmake/download_onnxruntime.cmake | 4 ++-- tools/gen_ort_dockerfile.py | 21 +++++++++++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e450fd..94d396d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,7 @@ install( # that tar file. We copy over the libraries and other requirements # prior to running this build and therefore these set of install # commands are not needed. -if(TRITON_ONNXRUNTIME_DOCKER_BUILD OR DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) +if(TRITON_ONNXRUNTIME_DOCKER_BUILD) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime/ diff --git a/cmake/download_onnxruntime.cmake b/cmake/download_onnxruntime.cmake index 6401c2b..31eca07 100644 --- a/cmake/download_onnxruntime.cmake +++ b/cmake/download_onnxruntime.cmake @@ -1,7 +1,7 @@ if(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) set(DOWNLOAD_PATH "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime.zip") - set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/onnxruntime") + set(EXTRACT_DIR "${CMAKE_BINARY_DIR}/_deps/downloads/onnxruntime") message(NOTICE "Downloading onnxruntime: ${TRITON_ONNXRUNTIME_PACKAGE_URL}") @@ -28,4 +28,4 @@ if(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) endif(NOT DOWNLOAD_RESULT EQUAL 0) -endif(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) \ No newline at end of file +endif(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index 2a5a4f7..d789336 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -56,10 +56,6 @@ "2024.4", # OpenVINO short version "2024.4.0.16579.c3152d32c9c", # OpenVINO version with build number ), - "2024.5.0": ( - "2024.5", # OpenVINO short version - "2024.5.0.17288.7975fa5da0c", # OpenVINO version with build number - ), } @@ -161,6 +157,16 @@ def dockerfile_for_linux(output_file): && apt-get install -y --no-install-recommends cmake=3.28.3* cmake-data=3.28.3* \\ && cmake --version +""" + if FLAGS.enable_gpu: + df += """ +# Allow configure to pick up cuDNN where it expects it. +# (Note: $CUDNN_VERSION is defined by base image) +RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \ + mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \ + ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \ + mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \ + ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so """ if FLAGS.ort_openvino is not None: @@ -389,8 +395,8 @@ def dockerfile_for_linux(output_file): """ df += """ RUN cd /opt/onnxruntime/lib && \ - for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\\.so*'`; do \ - patchelf --set-rpath '$ORIGIN' $i; \ + for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \ + patchelf --set-rpath '$ORIGIN' $i; \ done # For testing copy ONNX custom op library and model @@ -470,7 +476,7 @@ def dockerfile_for_windows(output_file): df += """ WORKDIR /workspace/onnxruntime -ARG VS_DEVCMD_BAT="\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" +ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat" RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat') RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90;100;120" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {} """.format( @@ -601,7 +607,6 @@ def preprocess_gpu_flags(): default=None, help='Target for build, can be "linux", "windows", "rhel", or "igpu". If not specified, build targets the current platform.', ) - parser.add_argument( "--cuda-version", type=str, required=False, help="Version for CUDA." ) From 561658bad6e0c08b385a9a6cece13bd9a4e6e146 Mon Sep 17 00:00:00 2001 From: pvijayakrish Date: Wed, 15 Jan 2025 13:09:59 -0800 Subject: [PATCH 14/14] Rolling back changes cherry picked from 24.12: fixing spaces --- cmake/download_onnxruntime.cmake | 1 + tools/gen_ort_dockerfile.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/download_onnxruntime.cmake b/cmake/download_onnxruntime.cmake index 31eca07..accdca6 100644 --- a/cmake/download_onnxruntime.cmake +++ b/cmake/download_onnxruntime.cmake @@ -29,3 +29,4 @@ if(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) endif(NOT DOWNLOAD_RESULT EQUAL 0) endif(DEFINED TRITON_ONNXRUNTIME_PACKAGE_URL) + diff --git a/tools/gen_ort_dockerfile.py b/tools/gen_ort_dockerfile.py index d789336..f26bdf9 100755 --- a/tools/gen_ort_dockerfile.py +++ b/tools/gen_ort_dockerfile.py @@ -395,8 +395,8 @@ def dockerfile_for_linux(output_file): """ df += """ RUN cd /opt/onnxruntime/lib && \ - for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \ - patchelf --set-rpath '$ORIGIN' $i; \ + for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \ + patchelf --set-rpath '$ORIGIN' $i; \ done # For testing copy ONNX custom op library and model