1
1
#!/usr/bin/env python3
2
- # Copyright 2020-2023 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # Copyright 2020-2024 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
3
#
4
4
# Redistribution and use in source and binary forms, with or without
5
5
# modification, are permitted provided that the following conditions
43
43
),
44
44
}
45
45
46
+ OPENVINO_VERSION_MAP = {
47
+ "2024.0.0" : (
48
+ "2024.0" , # OpenVINO short version
49
+ "2024.0.0.14509.34caeefd078" , # OpenVINO version with build number
50
+ ),
51
+ "2024.1.0" : (
52
+ "2024.1" , # OpenVINO short version
53
+ "2024.1.0.15008.f4afc983258" , # OpenVINO version with build number
54
+ ),
55
+ }
56
+
46
57
47
58
def target_platform ():
48
59
if FLAGS .target_platform is not None :
@@ -127,22 +138,29 @@ def dockerfile_for_linux(output_file):
127
138
# Install OpenVINO
128
139
ARG ONNXRUNTIME_OPENVINO_VERSION
129
140
ENV INTEL_OPENVINO_DIR /opt/intel/openvino_${ONNXRUNTIME_OPENVINO_VERSION}
141
+ """
142
+ df += """
143
+ ARG OPENVINO_SHORT_VERSION={}
144
+ ARG OPENVINO_VERSION_WITH_BUILD_NUMBER={}
145
+ """ .format (
146
+ OPENVINO_VERSION_MAP [FLAGS .ort_openvino ][0 ],
147
+ OPENVINO_VERSION_MAP [FLAGS .ort_openvino ][1 ],
148
+ )
130
149
150
+ df += """
131
151
# Step 1: Download and install core components
132
- # Ref: https://docs.openvino.ai/2023.3/openvino_docs_install_guides_installing_openvino_from_archive_linux .html#step-1-download-and-install-the-openvino-core-components
133
- RUN curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.3 /linux/l_openvino_toolkit_ubuntu22_2023.3.0.13775.ceeafaf64f3_x86_64 .tgz --output openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
152
+ # Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux .html#step-1-download-and-install-the-openvino-core-components
153
+ RUN curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_SHORT_VERSION} /linux/l_openvino_toolkit_ubuntu22_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64 .tgz --output openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
134
154
tar -xf openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
135
155
mkdir -p ${INTEL_OPENVINO_DIR} && \
136
- mv l_openvino_toolkit_ubuntu22_2023.3.0.13775.ceeafaf64f3_x86_64 /* ${INTEL_OPENVINO_DIR} && \
156
+ mv l_openvino_toolkit_ubuntu22_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64 /* ${INTEL_OPENVINO_DIR} && \
137
157
rm openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
138
158
(cd ${INTEL_OPENVINO_DIR}/install_dependencies && \
139
159
./install_openvino_dependencies.sh -y) && \
140
160
ln -s ${INTEL_OPENVINO_DIR} ${INTEL_OPENVINO_DIR}/../openvino_`echo ${ONNXRUNTIME_OPENVINO_VERSION} | awk '{print substr($0,0,4)}'`
141
161
142
162
# Step 2: Configure the environment
143
- # Ref: https://docs.openvino.ai/2023.3/openvino_docs_install_guides_installing_openvino_from_archive_linux.html#step-2-configure-the-environment
144
- ENV InferenceEngine_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
145
- ENV ngraph_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
163
+ # Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html#step-2-configure-the-environment
146
164
ENV OpenVINO_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
147
165
ENV LD_LIBRARY_PATH $INTEL_OPENVINO_DIR/runtime/lib/intel64:$LD_LIBRARY_PATH
148
166
ENV PKG_CONFIG_PATH=$INTEL_OPENVINO_DIR/runtime/lib/intel64/pkgconfig
@@ -155,43 +173,40 @@ def dockerfile_for_linux(output_file):
155
173
# From ORT 1.9 onwards we will switch back to using rel-* branches
156
174
if FLAGS .ort_version == "1.8.1" :
157
175
df += """
158
- #
159
- # ONNX Runtime build
160
- #
161
- ARG ONNXRUNTIME_VERSION
162
- ARG ONNXRUNTIME_REPO
163
- ARG ONNXRUNTIME_BUILD_CONFIG
164
-
165
- RUN git clone -b tensorrt-8.0 --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
166
- (cd onnxruntime && git submodule update --init --recursive)
176
+ #
177
+ # ONNX Runtime build
178
+ #
179
+ ARG ONNXRUNTIME_VERSION
180
+ ARG ONNXRUNTIME_REPO
181
+ ARG ONNXRUNTIME_BUILD_CONFIG
167
182
183
+ RUN git clone -b tensorrt-8.0 --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
184
+ (cd onnxruntime && git submodule update --init --recursive)
168
185
"""
169
186
# Use the tensorrt-8.5ea branch to use Tensor RT 8.5a to use the built-in tensorrt parser
170
187
elif FLAGS .ort_version == "1.12.1" :
171
188
df += """
172
- #
173
- # ONNX Runtime build
174
- #
175
- ARG ONNXRUNTIME_VERSION
176
- ARG ONNXRUNTIME_REPO
177
- ARG ONNXRUNTIME_BUILD_CONFIG
178
-
179
- RUN git clone -b tensorrt-8.5ea --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
180
- (cd onnxruntime && git submodule update --init --recursive)
189
+ #
190
+ # ONNX Runtime build
191
+ #
192
+ ARG ONNXRUNTIME_VERSION
193
+ ARG ONNXRUNTIME_REPO
194
+ ARG ONNXRUNTIME_BUILD_CONFIG
181
195
196
+ RUN git clone -b tensorrt-8.5ea --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
197
+ (cd onnxruntime && git submodule update --init --recursive)
182
198
"""
183
199
else :
184
200
df += """
185
- #
186
- # ONNX Runtime build
187
- #
188
- ARG ONNXRUNTIME_VERSION
189
- ARG ONNXRUNTIME_REPO
190
- ARG ONNXRUNTIME_BUILD_CONFIG
191
-
192
- RUN git clone -b rel-${ONNXRUNTIME_VERSION} --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
193
- (cd onnxruntime && git submodule update --init --recursive)
201
+ #
202
+ # ONNX Runtime build
203
+ #
204
+ ARG ONNXRUNTIME_VERSION
205
+ ARG ONNXRUNTIME_REPO
206
+ ARG ONNXRUNTIME_BUILD_CONFIG
194
207
208
+ RUN git clone -b rel-${ONNXRUNTIME_VERSION} --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
209
+ (cd onnxruntime && git submodule update --init --recursive)
195
210
"""
196
211
197
212
if FLAGS .onnx_tensorrt_tag != "" :
0 commit comments