Last active
November 3, 2023 17:45
-
-
Save ngaloppo/b6082e7677556f591c11a50788ab2fa7 to your computer and use it in GitHub Desktop.
Build OpenVINO for SLES in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
IMAGE_NAME=openvino-suse:2023.2.0 | |
OPENVINO_RELEASE_BRANCH=releases/2023/2 | |
docker build -t ${IMAGE_NAME} --build-arg OPENVINO_RELEASE_BRANCH=$OPENVINO_RELEASE_BRANCH | |
id=$(docker create ${IMAGE_NAME}) | |
docker cp "$id":/opt/openvino . | |
docker rm -v "$id" | |
tar cvzf openvino-suse.tar.gz openvino | |
rm -rf openvino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM opensuse/leap:15.3 as ov-builder | |
ARG OPENVINO_RELEASE_BRANCH=releases/2023/2 | |
WORKDIR /tmp | |
RUN zypper -n install git | |
RUN git clone --single-branch --branch ${OPENVINO_RELEASE_BRANCH} https://github.com/openvinotoolkit/openvino.git && \ | |
cd openvino && \ | |
git submodule update --init --recursive && \ | |
chmod +x install_build_dependencies.sh && \ | |
./install_build_dependencies.sh | |
WORKDIR /tmp/openvino | |
RUN mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release \ | |
-DENABLE_INTEL_GNA=OFF -DENABLE_OV_PADDLE_FRONTEND=OFF -DENABLE_CPPLINT=OFF -DENABLE_CLANG_FORMAT=OFF \ | |
-DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install .. && \ | |
make --jobs=$(nproc --all) install | |
FROM opensuse/leap:15.3 as suse-openvino | |
RUN mkdir -p /opt | |
COPY --from=ov-builder /tmp/install /opt/openvino | |
# patch dependency install script to ignore unknown packages (e.g. python39-venv) | |
RUN sed -i -e 's/zypper in/zypper --ignore-unknown in/' /opt/openvino/install_dependencies/install_openvino_dependencies.sh | |
RUN bash /opt/openvino/install_dependencies/install_openvino_dependencies.sh -y | |
# GPU drivers | |
ARG SUSE_RELEASE=15sp3 | |
RUN zypper addrepo -r https://repositories.intel.com/graphics/sles/${SUSE_RELEASE}/intel-graphics.repo && \ | |
zypper --non-interactive --gpg-auto-import-keys refresh && \ | |
zypper install -y \ | |
intel-level-zero-gpu level-zero intel-gsc intel-opencl intel-ocloc \ | |
intel-media-driver libigfxcmrt7 libvpl2 libvpl-tools libmfxgen1 libmfx1 \ | |
libigdfcl-devel intel-igc-cm libigfxcmrt-devel level-zero-devel \ | |
ocl-icd-devel \ | |
clinfo libOpenCL1 libva-utils hwinfo | |
WORKDIR /opt/openvino/samples/cpp | |
RUN bash ./build_samples.sh | |
WORKDIR /opt | |
RUN zypper -n in tar gzip | |
RUN tar cvzf /tmp/openvino-${SUSE_RELEASE}.tar.gz openvino | |
WORKDIR /root/openvino_cpp_samples_build | |
RUN echo "source /opt/openvino/setupvars.sh" >> /root/.bashrc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment