Skip to content

Commit 926558f

Browse files
authored
support Media-Entertainment-AI-Suite
* support Media-Entertainment-AI-Suite 1. provide a dockerfile for both ivsr/svp v24.12 and raisr v23.11.1 2. provide a simple Helm Chart to deploy service Signed-off-by: Xiaoxia Liang <xiaoxia.liang@intel.com> * Update ivsr version to v25.03 from v24.12 and upgrade raisr ffmpeg plugin to ffmpeg n7.1 from n6.1 Signed-off-by: Xiaoxia Liang <xiaoxia.liang@intel.com> * Add license header and refine README.md Signed-off-by: Xiaoxia Liang <xiaoxia.liang@intel.com> --------- Signed-off-by: Xiaoxia Liang <xiaoxia.liang@intel.com>
1 parent da5a935 commit 926558f

File tree

8 files changed

+1402
-0
lines changed

8 files changed

+1402
-0
lines changed

Dockerfile

Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
# SPDX-License-Identifier: BSD 3-Clause License
2+
#
3+
# Copyright (c) 2025, Intel Corporation
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# * Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
#
12+
# * Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# * Neither the name of the copyright holder nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
ARG IMAGE=ubuntu:22.04
32+
FROM $IMAGE AS base
33+
34+
RUN apt-get update && \
35+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36+
curl wget ca-certificates gpg-agent software-properties-common && \
37+
rm -rf /var/lib/apt/lists/*
38+
39+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
40+
41+
FROM base as build
42+
LABEL vendor="Intel Corporation"
43+
44+
ARG ENABLE_OV_PATCH
45+
ARG OV_VERSION
46+
# openvino
47+
RUN apt-get update && \
48+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --fix-missing \
49+
apt-utils \
50+
ca-certificates \
51+
curl \
52+
cmake \
53+
cython3 \
54+
flex \
55+
bison \
56+
gcc \
57+
g++ \
58+
git \
59+
make \
60+
patch \
61+
pkg-config \
62+
wget && \
63+
apt-get clean && \
64+
rm -rf /var/lib/apt/lists/*
65+
66+
RUN no_proxy=$no_proxy wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | \
67+
gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
68+
RUN echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy flex' | \
69+
tee /etc/apt/sources.list.d/intel.gpu.jammy.list
70+
71+
# clone ivsr repo
72+
ARG WORKSPACE=/workspace
73+
ARG IVSR_DIR=${WORKSPACE}/ivsr
74+
ARG IVSR_REPO=https://github.com/OpenVisualCloud/iVSR.git
75+
ARG IVSR_VERSION=v25.03
76+
77+
WORKDIR ${IVSR_DIR}
78+
RUN git clone ${IVSR_REPO} ${IVSR_DIR} && \
79+
git checkout ${IVSR_VERSION}
80+
81+
#install opencv
82+
ARG OPENCV_REPO=https://github.com/opencv/opencv/archive/4.5.3-openvino-2021.4.2.tar.gz
83+
WORKDIR ${WORKSPACE}
84+
RUN wget -qO - ${OPENCV_REPO} | tar xz
85+
86+
WORKDIR ${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2
87+
RUN mkdir build && mkdir install
88+
WORKDIR ${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2/build
89+
RUN cmake \
90+
-DCMAKE_BUILD_TYPE=Release \
91+
-DCMAKE_INSTALL_PREFIX=${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2/install \
92+
-DCMAKE_INSTALL_LIBDIR=lib \
93+
-DOPENCV_GENERATE_PKGCONFIG=ON \
94+
-DBUILD_DOCS=OFF \
95+
-DBUILD_EXAMPLES=OFF \
96+
-DBUILD_PERF_TESTS=OFF \
97+
-DBUILD_TESTS=OFF \
98+
-DWITH_OPENEXR=OFF \
99+
-DWITH_OPENJPEG=OFF \
100+
-DWITH_GSTREAMER=OFF \
101+
-DWITH_JASPER=OFF \
102+
.. && \
103+
make -j "$(nproc)" && \
104+
make install
105+
106+
WORKDIR ${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2/install/bin
107+
RUN bash ./setup_vars_opencv4.sh
108+
109+
RUN if [ "$OV_VERSION" = "2022.3" ]; then \
110+
apt-get update; \
111+
xargs apt-get install -y --no-install-recommends --fix-missing < ${IVSR_DIR}/ivsr_sdk/dgpu_umd_stable_555_0124.txt; \
112+
apt-get install -y vainfo clinfo; \
113+
apt-get clean; \
114+
rm -rf /var/lib/apt/lists/*; \
115+
fi
116+
117+
WORKDIR /tmp/gpu_deps
118+
RUN if [ "$OV_VERSION" = "2023.2" ] || [ "$OV_VERSION" = "2024.5" ]; then \
119+
# for GPU
120+
apt-get update; \
121+
apt-get install -y vainfo clinfo; \
122+
apt-get install -y --no-install-recommends ocl-icd-libopencl1; \
123+
apt-get clean; \
124+
rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*; \
125+
fi
126+
WORKDIR /tmp/gpu_deps
127+
RUN if [ "$OV_VERSION" = "2023.2" ]; then \
128+
# hadolint ignore=DL3003
129+
curl -L -O https://github.com/intel/compute-runtime/releases/download/23.05.25593.11/libigdgmm12_22.3.0_amd64.deb; \
130+
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13700.14/intel-igc-core_1.0.13700.14_amd64.deb; \
131+
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.13700.14/intel-igc-opencl_1.0.13700.14_amd64.deb; \
132+
curl -L -O https://github.com/intel/compute-runtime/releases/download/23.13.26032.30/intel-opencl-icd_23.13.26032.30_amd64.deb; \
133+
curl -L -O https://github.com/intel/compute-runtime/releases/download/23.13.26032.30/libigdgmm12_22.3.0_amd64.deb; \
134+
dpkg -i ./*.deb && rm -Rf /tmp/gpu_deps; \
135+
fi
136+
137+
WORKDIR /tmp/gpu_deps
138+
RUN if [ "$OV_VERSION" = "2024.5" ]; then \
139+
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.17384.11/intel-igc-core_1.0.17384.11_amd64.deb; \
140+
curl -L -O https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.17384.11/intel-igc-opencl_1.0.17384.11_amd64.deb; \
141+
curl -L -O https://github.com/intel/compute-runtime/releases/download/24.31.30508.7/intel-level-zero-gpu-dbgsym_1.3.30508.7_amd64.ddeb; \
142+
curl -L -O https://github.com/intel/compute-runtime/releases/download/24.31.30508.7/intel-level-zero-gpu_1.3.30508.7_amd64.deb; \
143+
curl -L -O https://github.com/intel/compute-runtime/releases/download/24.31.30508.7/intel-opencl-icd-dbgsym_24.31.30508.7_amd64.ddeb; \
144+
curl -L -O https://github.com/intel/compute-runtime/releases/download/24.31.30508.7/intel-opencl-icd_24.31.30508.7_amd64.deb; \
145+
curl -L -O https://github.com/intel/compute-runtime/releases/download/24.31.30508.7/libigdgmm12_22.4.1_amd64.deb; \
146+
dpkg -i ./*.deb && rm -Rf /tmp/gpu_deps; \
147+
fi
148+
ENV LD_LIBRARY_PATH=${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2/install/lib:$LD_LIBRARY_PATH
149+
ENV OpenCV_DIR=${WORKSPACE}/opencv-4.5.3-openvino-2021.4.2/install/lib/cmake/opencv4
150+
ARG IVSR_OV_DIR=${IVSR_DIR}/ivsr_ov/based_on_openvino_${OV_VERSION}/openvino
151+
ARG CUSTOM_OV_INSTALL_DIR=${IVSR_OV_DIR}/install
152+
ARG IVSR_SDK_DIR=${IVSR_DIR}/ivsr_sdk/
153+
154+
RUN apt-get update && \
155+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
156+
build-essential \
157+
ca-certificates \
158+
curl \
159+
cmake \
160+
cython3 \
161+
flex \
162+
bison \
163+
gcc \
164+
g++ \
165+
git \
166+
libdrm-dev \
167+
libudev-dev \
168+
libtool \
169+
libusb-1.0-0-dev \
170+
make \
171+
patch \
172+
pkg-config \
173+
xz-utils \
174+
ocl-icd-opencl-dev \
175+
opencl-headers && \
176+
rm -rf /var/lib/apt/lists/*
177+
178+
ARG PYTHON
179+
180+
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
181+
${PYTHON} lib${PYTHON}-dev python3-pip && \
182+
apt-get clean && \
183+
rm -rf /var/lib/apt/lists/*
184+
185+
RUN pip --no-cache-dir install --upgrade \
186+
pip \
187+
setuptools
188+
189+
RUN ln -sf $(which ${PYTHON}) /usr/local/bin/python && \
190+
ln -sf $(which ${PYTHON}) /usr/local/bin/python3 && \
191+
ln -sf $(which ${PYTHON}) /usr/bin/python && \
192+
ln -sf $(which ${PYTHON}) /usr/bin/python3
193+
194+
ARG OV_REPO=https://github.com/openvinotoolkit/openvino.git
195+
ARG OV_BRANCH=${OV_VERSION}.0
196+
WORKDIR ${IVSR_OV_DIR}
197+
198+
RUN git config --global user.email "noname@example.com" && \
199+
git config --global user.name "no name"
200+
201+
RUN git clone ${OV_REPO} ${IVSR_OV_DIR} && \
202+
git checkout ${OV_BRANCH} && \
203+
git submodule update --init --recursive
204+
205+
RUN if [ "$ENABLE_OV_PATCH" = "true" ] && [ "$OV_VERSION" = "2022.3" ]; then \
206+
{ set -e; \
207+
for patch_file in $(find ../patches -iname "*.patch" | sort -n); do \
208+
echo "Applying: ${patch_file}"; \
209+
git am --whitespace=fix ${patch_file}; \
210+
done; }; \
211+
fi
212+
213+
WORKDIR ${IVSR_OV_DIR}/build
214+
RUN cmake \
215+
-DCMAKE_INSTALL_PREFIX=${PWD}/../install \
216+
-DENABLE_INTEL_CPU=ON \
217+
-DENABLE_CLDNN=ON \
218+
-DENABLE_INTEL_GPU=ON \
219+
-DENABLE_ONEDNN_FOR_GPU=OFF \
220+
-DENABLE_INTEL_GNA=OFF \
221+
-DENABLE_INTEL_MYRIAD_COMMON=OFF \
222+
-DENABLE_INTEL_MYRIAD=OFF \
223+
-DENABLE_PYTHON=ON \
224+
-DENABLE_OPENCV=ON \
225+
-DENABLE_SAMPLES=ON \
226+
-DENABLE_CPPLINT=OFF \
227+
-DTREAT_WARNING_AS_ERROR=OFF \
228+
-DENABLE_TESTS=OFF \
229+
-DENABLE_GAPI_TESTS=OFF \
230+
-DENABLE_BEH_TESTS=OFF \
231+
-DENABLE_FUNCTIONAL_TESTS=OFF \
232+
-DENABLE_OV_CORE_UNIT_TESTS=OFF \
233+
-DENABLE_OV_CORE_BACKEND_UNIT_TESTS=OFF \
234+
-DENABLE_DEBUG_CAPS=ON \
235+
-DENABLE_GPU_DEBUG_CAPS=ON \
236+
-DENABLE_CPU_DEBUG_CAPS=ON \
237+
-DCMAKE_BUILD_TYPE=Release \
238+
.. && \
239+
make -j $(nproc --all) && \
240+
make install && \
241+
bash ${PWD}/../install/setupvars.sh
242+
243+
ARG CUSTOM_IE_DIR=${CUSTOM_OV_INSTALL_DIR}/runtime
244+
ARG CUSTOM_IE_LIBDIR=${CUSTOM_IE_DIR}/lib/intel64
245+
ARG CUSTOM_OV=${CUSTOM_IE_DIR}
246+
247+
ENV OpenVINO_DIR=${CUSTOM_IE_DIR}/cmake
248+
ENV InferenceEngine_DIR=${CUSTOM_IE_DIR}/cmake
249+
ENV TBB_DIR=${CUSTOM_IE_DIR}/3rdparty/tbb/cmake
250+
ENV ngraph_DIR=${CUSTOM_IE_DIR}/cmake
251+
ENV LD_LIBRARY_PATH=${CUSTOM_IE_DIR}/3rdparty/tbb/lib:${CUSTOM_IE_LIBDIR}:$LD_LIBRARY_PATH
252+
253+
WORKDIR ${IVSR_SDK_DIR}/build
254+
RUN cmake .. \
255+
-DENABLE_LOG=OFF -DENABLE_PERF=OFF -DENABLE_THREADPROCESS=ON \
256+
-DCMAKE_BUILD_TYPE=Release && \
257+
make -j $(nproc --all) && \
258+
make install && \
259+
echo "Building vsr sdk finished."
260+
261+
# build raisr
262+
# install 3rd-party libraries required by raisr and raisr
263+
WORKDIR ${WORKSPACE}
264+
RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7e07b203-af56-4b52-b69d-97680826a8df/l_ipp_oneapi_p_2021.12.1.16_offline.sh && \
265+
chmod +x ./l_ipp_oneapi_p_2021.12.1.16_offline.sh && \
266+
./l_ipp_oneapi_p_2021.12.1.16_offline.sh -a -s --eula accept && \
267+
source /opt/intel/oneapi/ipp/latest/env/vars.sh && \
268+
rm ./l_ipp_oneapi_p_2021.12.1.16_offline.sh
269+
270+
ENV LD_LIBRARY_PATH=/opt/intel/oneapi/ipp/2021.12/lib:${LD_LIBRARY_PATH}
271+
ENV LIBRARY_PATH=/opt/intel/oneapi/ipp/2021.12/lib
272+
ENV IPPROOT=/opt/intel/oneapi/ipp/2021.12
273+
ENV CMAKE_PREFIX_PATH=/opt/intel/oneapi/ipp/2021.12/lib/cmake/ipp
274+
ARG RAISR_REPO=https://github.com/OpenVisualCloud/Video-Super-Resolution-Library.git
275+
ARG RAISR_BRANCH=v23.11.1
276+
ARG RAISR_DIR=${WORKSPACE}/raisr
277+
WORKDIR ${RAISR_DIR}
278+
RUN git clone ${RAISR_REPO} ${RAISR_DIR} && \
279+
git checkout ${RAISR_BRANCH}
280+
281+
RUN ./build.sh -DENABLE_RAISR_OPENCL=ON
282+
283+
#build ffmpeg with iVSR SDK backend and raisr
284+
RUN apt-get update && \
285+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
286+
ca-certificates tar g++ wget pkg-config nasm yasm libglib2.0-dev flex bison gobject-introspection libgirepository1.0-dev python3-dev \
287+
libx11-dev \
288+
libxv-dev \
289+
libxt-dev \
290+
libasound2-dev \
291+
libpango1.0-dev \
292+
libtheora-dev \
293+
libvisual-0.4-dev \
294+
libgl1-mesa-dev \
295+
libcurl4-gnutls-dev \
296+
librtmp-dev \
297+
mjpegtools \
298+
libx264-dev \
299+
libx265-dev \
300+
libde265-dev \
301+
libva-dev \
302+
&& \
303+
rm -rf /var/lib/apt/lists/*
304+
ENV LD_LIBRARY_PATH=${IVSR_SDK_DIR}/lib:/usr/local/lib:$LD_LIBRARY_PATH
305+
ENV C_INCLUDE_PATH="/opt/intel/oneapi/ipp/latest/include/ipp"
306+
307+
ARG FFMPEG_DIR=${WORKSPACE}/ffmpeg
308+
309+
ARG FFMPEG_REPO=https://github.com/FFmpeg/FFmpeg.git
310+
ARG FFMPEG_VERSION=n7.1
311+
WORKDIR ${FFMPEG_DIR}
312+
RUN git clone ${FFMPEG_REPO} ${FFMPEG_DIR} && \
313+
git checkout ${FFMPEG_VERSION}
314+
315+
Run cp ${IVSR_DIR}/ivsr_ffmpeg_plugin/patches/*.patch ${FFMPEG_DIR}/
316+
# apply patches of ivsr ffmpeg
317+
RUN { set -e; \
318+
for patch_file in $(find -iname "*.patch" | sort -n); do \
319+
echo "Applying: ${patch_file}"; \
320+
git am --whitespace=fix ${patch_file}; \
321+
done; }
322+
323+
# apply patches of raisr ffmpeg
324+
COPY ./patches/* ${FFMPEG_DIR}/
325+
RUN git -C "${FFMPEG_DIR}" am "${FFMPEG_DIR}/0001-Upgrade-Raisr-ffmpeg-plugin-to-n7.1-from-n6.1.1.patch"
326+
327+
RUN if [ -f "${CUSTOM_OV_INSTALL_DIR}/setvars.sh" ]; then \
328+
. ${CUSTOM_OV_INSTALL_DIR}/setvars.sh ; \
329+
fi && \
330+
export LD_LIBRARY_PATH=${IVSR_SDK_DIR}/lib:${CUSTOM_IE_LIBDIR}:${TBB_DIR}/../lib:"$LD_LIBRARY_PATH" && \
331+
./configure \
332+
--extra-cflags=-fopenmp \
333+
--extra-ldflags=-fopenmp \
334+
--enable-libivsr \
335+
--disable-static \
336+
--disable-doc \
337+
--enable-shared \
338+
--enable-vaapi \
339+
--enable-gpl \
340+
--enable-libx264 \
341+
--enable-libx265 \
342+
--enable-version3 \
343+
--enable-libipp \
344+
--enable-opencl \
345+
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \
346+
--enable-cross-compile && \
347+
make -j $(nproc --all) && \
348+
make install
349+
350+
WORKDIR ${WORKSPACE}
351+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)