onnxruntime/dockerfiles/Dockerfile.vitisai
Changming Sun 23da468154
Upgrade cmake version to 3.24 (#13569)
### Description
Upgrade cmake version to 3.24 because I need to use a new feature that
is only provided in that version and later. Starting from cmake 3.24,
the
[FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html#module:FetchContent)
module and the
[find_package()](https://cmake.org/cmake/help/latest/command/find_package.html#command:find_package)
command now support integration capabilities, which means calls to
"FetchContent" can be implicitly redirected to "find_package", and vice
versa. Users can use a cmake variable to control the behavior. So, we
don't need to provide such a build option. We can delete our
"onnxruntime_PREFER_SYSTEM_LIB" build option and let cmake handle it.
And it would be easier for who wants to use vcpkg.


### Motivation and Context

Provide a unified package management method, and get aligned with the
community. This change is split from #13523 for easier review.
2022-11-04 22:58:51 -07:00

44 lines
1.8 KiB
Text

# --------------------------------------------------------------
# Copyright(C) Xilinx Inc.
# Licensed under the MIT License.
# --------------------------------------------------------------
# Dockerfile to run ONNXRuntime with Vitis-AI integration
FROM xilinx/vitis-ai-cpu:1.3.598
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=main
ARG PYXIR_REPO=https://github.com/Xilinx/pyxir
ARG PYXIR_BRANCH=v0.2.0
ARG PYXIR_FLAG="--use_vai_rt"
RUN apt-get update && \
apt-get install -y \
sudo \
git \
bash \
gcc-aarch64-linux-gnu && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV PATH /code/cmake-3.24.3-linux-x86_64/bin:$PATH
ENV LD_LIBRARY_PATH /opt/xilinx/xrt/lib:$LD_LIBRARY_PATH
WORKDIR /code
RUN . $VAI_ROOT/conda/etc/profile.d/conda.sh &&\
conda activate vitis-ai-tensorflow &&\
git clone --single-branch --branch ${PYXIR_BRANCH} --recursive ${PYXIR_REPO} pyxir &&\
cd pyxir && python3 setup.py install ${PYXIR_FLAG}
RUN . $VAI_ROOT/conda/etc/profile.d/conda.sh &&\
conda activate vitis-ai-tensorflow &&\
git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
cp onnxruntime/docs/Privacy.md /code/Privacy.md &&\
cp onnxruntime/dockerfiles/LICENSE-IMAGE.txt /code/LICENSE-IMAGE.txt &&\
cp onnxruntime/ThirdPartyNotices.txt /code/ThirdPartyNotices.txt &&\
cd onnxruntime &&\
/bin/sh ./build.sh --config RelWithDebInfo --enable_pybind --build_wheel --use_vitisai --parallel --update --build --build_shared_lib &&\
pip install /code/onnxruntime/build/Linux/RelWithDebInfo/dist/*-linux_x86_64.whl &&\
cd .. &&\
rm -rf onnxruntime cmake-3.24.3-linux-x86_64