Skip to content

Commit c3dbf49

Browse files
committed
Revert changes in ORT file
1 parent 98c37f2 commit c3dbf49

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def dockerfile_for_linux(output_file):
9494
df += """
9595
# Ensure apt-get won't prompt for selecting options
9696
ENV DEBIAN_FRONTEND=noninteractive
97-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
9897
9998
# The Onnx Runtime dockerfile is the collection of steps in
10099
# https://github.com/microsoft/onnxruntime/tree/master/dockerfiles
@@ -106,7 +105,7 @@ def dockerfile_for_linux(output_file):
106105
df += """
107106
# The manylinux container defaults to Python 3.7, but some feature installation
108107
# requires a higher version.
109-
ARG PYVER=3.12
108+
ARG PYVER=3.10
110109
ENV PYTHONPATH=/opt/python/v
111110
RUN ln -sf /opt/python/cp${PYVER/./}* ${PYTHONPATH}
112111
@@ -154,11 +153,19 @@ def dockerfile_for_linux(output_file):
154153
&& . /etc/os-release \\
155154
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \\
156155
&& apt-get update -q=2 \\
157-
&& apt-get install -y --no-install-recommends cmake=3.28.3* cmake-data=3.28.3* \\
156+
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* \\
158157
&& cmake --version
159158
160-
RUN python3 -m pip install psutil
161-
159+
"""
160+
if FLAGS.enable_gpu:
161+
df += """
162+
# Allow configure to pick up cuDNN where it expects it.
163+
# (Note: $CUDNN_VERSION is defined by base image)
164+
RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \
165+
mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \
166+
ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \
167+
mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \
168+
ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so
162169
"""
163170

164171
if FLAGS.ort_openvino is not None:
@@ -178,10 +185,10 @@ def dockerfile_for_linux(output_file):
178185
df += """
179186
# Step 1: Download and install core components
180187
# Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html#step-1-download-and-install-the-openvino-core-components
181-
RUN curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/${OPENVINO_SHORT_VERSION}/linux/l_openvino_toolkit_ubuntu24_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64.tgz --output openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
188+
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 && \
182189
tar -xf openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
183190
mkdir -p ${INTEL_OPENVINO_DIR} && \
184-
mv l_openvino_toolkit_ubuntu24_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64/* ${INTEL_OPENVINO_DIR} && \
191+
mv l_openvino_toolkit_ubuntu22_${OPENVINO_VERSION_WITH_BUILD_NUMBER}_x86_64/* ${INTEL_OPENVINO_DIR} && \
185192
rm openvino_${ONNXRUNTIME_OPENVINO_VERSION}.tgz && \
186193
(cd ${INTEL_OPENVINO_DIR}/install_dependencies && \
187194
./install_openvino_dependencies.sh -y) && \
@@ -190,9 +197,9 @@ def dockerfile_for_linux(output_file):
190197
# Step 2: Configure the environment
191198
# Ref: https://docs.openvino.ai/2024/get-started/install-openvino/install-openvino-archive-linux.html#step-2-configure-the-environment
192199
ENV OpenVINO_DIR=$INTEL_OPENVINO_DIR/runtime/cmake
193-
ENV LD_LIBRARY_PATH=$INTEL_OPENVINO_DIR/runtime/lib/intel64:$LD_LIBRARY_PATH
200+
ENV LD_LIBRARY_PATH $INTEL_OPENVINO_DIR/runtime/lib/intel64:$LD_LIBRARY_PATH
194201
ENV PKG_CONFIG_PATH=$INTEL_OPENVINO_DIR/runtime/lib/intel64/pkgconfig
195-
ENV PYTHONPATH=$INTEL_OPENVINO_DIR/python/python3.12:$INTEL_OPENVINO_DIR/python/python3:$PYTHONPATH
202+
ENV PYTHONPATH $INTEL_OPENVINO_DIR/python/python3.10:$INTEL_OPENVINO_DIR/python/python3:$PYTHONPATH
196203
"""
197204

198205
## TEMPORARY: Using the tensorrt-8.0 branch until ORT 1.9 release to enable ORT backend with TRT 8.0 support.
@@ -280,7 +287,7 @@ def dockerfile_for_linux(output_file):
280287
df += """
281288
WORKDIR /workspace/onnxruntime
282289
ARG COMMON_BUILD_ARGS="--config ${{ONNXRUNTIME_BUILD_CONFIG}} --skip_submodule_sync --parallel --build_shared_lib \
283-
--compile_no_warning_as_error --build_dir /workspace/build --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES='{}' "
290+
--build_dir /workspace/build --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES='{}' "
284291
""".format(
285292
cuda_archs
286293
)
@@ -351,7 +358,7 @@ def dockerfile_for_linux(output_file):
351358
RUN cp /workspace/onnxruntime/include/onnxruntime/core/providers/openvino/openvino_provider_factory.h \
352359
/opt/onnxruntime/include
353360
354-
RUN apt-get update && apt-get install -y --no-install-recommends libtbb12
361+
RUN apt-get update && apt-get install -y --no-install-recommends libtbb2
355362
356363
RUN cp /workspace/build/${ONNXRUNTIME_BUILD_CONFIG}/libonnxruntime_providers_openvino.so \
357364
/opt/onnxruntime/lib && \
@@ -387,7 +394,7 @@ def dockerfile_for_linux(output_file):
387394
"""
388395
df += """
389396
RUN cd /opt/onnxruntime/lib && \
390-
for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\\.so*'`; do \
397+
for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \
391398
patchelf --set-rpath '$ORIGIN' $i; \
392399
done
393400
@@ -468,7 +475,7 @@ def dockerfile_for_windows(output_file):
468475

469476
df += """
470477
WORKDIR /workspace/onnxruntime
471-
ARG VS_DEVCMD_BAT="\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
478+
ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
472479
RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat')
473480
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 {}
474481
""".format(

0 commit comments

Comments
 (0)