Skip to content

Commit 800f97a

Browse files
committed
Minor update to Flex Ubuntu22
Minor update to Flex Ubuntu22 Signed-off-by: Milosz Linkiewicz <[email protected]>
1 parent 9200584 commit 800f97a

File tree

5 files changed

+75
-51
lines changed

5 files changed

+75
-51
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
./license*
44
./test*
55
*Dockerfile*
6+
.github/**
7+
.vscode**
8+
./_build/*
9+
./build/*
10+
./docs*
11+
./_install*

.github/workflows/build-baremetal-ubuntu.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,27 @@ jobs:
8181
cp "${{ github.workspace }}/ffmpeg/vf_raisr"*.c "${BUILD_DIR}/ffmpeg/libavfilter"
8282
8383
- name: 'Build RAISR from source code'
84-
run: './build.sh -DENABLE_RAISR_OPENCL=ON'
84+
run: |
85+
./build.sh -DENABLE_RAISR_OPENCL=ON \
86+
-DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \
87+
-DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \
88+
-DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp"
8589
8690
- name: 'Configure, build and install ffmpeg repository'
8791
working-directory: "${BUILD_DIR}/ffmpeg"
8892
run: |
8993
./configure \
90-
--disable-debug \
91-
--disable-doc \
92-
--enable-libipp \
93-
--enable-static \
94+
--disable-shared \
95+
--disable-debug \
96+
--disable-doc \
97+
--enable-static \
98+
--enable-libipp \
9499
--enable-gpl \
95100
--enable-libx264 \
96101
--enable-libx265 \
97-
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm -lintlc -lsvml' \
98-
--extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include/ipp/' \
102+
--enable-opencl \
103+
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \
104+
--extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp' \
99105
--extra-ldflags='-fopenmp -L/opt/intel/oneapi/ipp/latest/lib' \
100106
--enable-cross-compile \
101107
--prefix="${PREFIX}" && \

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright 2024-2025 Intel Corporation
55

66
# Fails the script if any of the commands error (Other than if and some others)
7-
set -ex -o pipefail
7+
set -e -o pipefail
88

99
SCRIPT_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")")"
1010
REPOSITORY_DIR="$(readlink -f "${SCRIPT_DIR}")"
@@ -84,10 +84,10 @@ function check_executable()
8484

8585
if check_executable icpx; then
8686
CXX=$(check_executable -p icpx)
87-
elif check_executable clang++; then
88-
CXX=$(check_executable -p clang++)
8987
elif check_executable g++; then
9088
CXX=$(check_executable -p g++)
89+
elif check_executable clang++; then
90+
CXX=$(check_executable -p clang++)
9191
else
9292
log_error "No suitable cpp compiler found in path."
9393
log_error "Please either install one or set it via cxx=*"

docker/Flex/Dockerfile.ubuntu22.04

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ ARG FFMPEG_REPO=https://github.com/ffmpeg/ffmpeg/archive/${FFMPEG_VER}.tar.gz
2929

3030
ARG PREFIX=/opt/build
3131
ARG DL_PREFIX=/opt
32-
33-
ENV LD_LIBRARY_PATH="/opt/build/lib:/opt/build/lib64:$LD_LIBRARY_PATH"
34-
ENV PKG_CONFIG_PATH="/opt/build/lib/pkgconfig:$PKG_CONFIG_PATH"
32+
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/lib:${PREFIX}/lib64:/usr/lib:/usr/local/lib:/usr/local/lib64"
33+
ENV PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH"
3534
ENV DEBIAN_FRONTEND="noninteractive"
3635
ENV TZ="Europe/Warsaw"
3736

@@ -120,43 +119,46 @@ RUN curl -Lf "${MEDIA_DRIVER_REPO}" | tar xz --strip-components=1 -C "${DL_PREFI
120119

121120
WORKDIR ${DL_PREFIX}/Video-Super-Resolution-Library
122121
COPY . ${DL_PREFIX}/Video-Super-Resolution-Library
123-
RUN ./build.sh -DENABLE_RAISR_OPENCL=ON
122+
RUN ./build.sh -DENABLE_RAISR_OPENCL=ON \
123+
-DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \
124+
-DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \
125+
-DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp"
124126

125127
WORKDIR ${DL_PREFIX}/ffmpeg
126128
RUN curl -Lf "${FFMPEG_REPO}" | \
127129
tar -zx --strip-components=1 -C "${DL_PREFIX}/ffmpeg" && \
128-
git -C "${DL_PREFIX}/ffmpeg" apply --whitespace=fix "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/"*.patch && \
130+
patch -d "${DL_PREFIX}/ffmpeg" -p1 -i <(cat "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/"*.patch) && \
129131
cp "${DL_PREFIX}/Video-Super-Resolution-Library/ffmpeg/vf_raisr"*.c "${DL_PREFIX}/ffmpeg/libavfilter"
130132

131133
# Configure and build ffmpeg
132134
WORKDIR ${DL_PREFIX}/ffmpeg
133-
# RUN ./configure --disable-shared \
134135
RUN ./configure \
135-
--disable-debug \
136-
--disable-doc \
137-
--enable-static \
138-
--enable-libipp \
139-
--enable-gpl \
136+
--disable-shared \
137+
--disable-debug \
138+
--disable-doc \
139+
--enable-static \
140+
--enable-libipp \
141+
--enable-gpl \
140142
--enable-libx264 \
141143
--enable-libx265 \
142-
--enable-opencl \
143-
--enable-vaapi \
144+
--enable-opencl \
145+
--enable-vaapi \
144146
--enable-libsvtav1 \
145-
--enable-libvpx \
146-
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm -lintlc -lsvml' \
147-
--extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include/ipp/' \
148-
--extra-ldflags='-fopenmp -L/opt/intel/oneapi/ipp/latest/lib' \
149-
--enable-cross-compile \
150-
--prefix="${PREFIX}" && \
147+
--enable-libvpx \
148+
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \
149+
--extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp' \
150+
--extra-ldflags="-fopenmp -L/opt/intel/oneapi/ipp/latest/lib -L${PREFIX}/lib" \
151+
--enable-cross-compile \
152+
--prefix="${PREFIX}" && \
151153
make clean && \
152154
make -j"$(nproc)" && \
153155
make install
154156

155-
# cleanup
157+
# # cleanup
156158
WORKDIR ${PREFIX}
157-
RUN mkdir -p "${PREFIX}/usr/lib" && \
158-
ldd "${PREFIX}/bin/ffmpeg" | cut -d ' ' -f 3 | xargs -i cp {} "${PREFIX}/usr/lib/" && \
159-
LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/usr/lib:/usr/local/lib:/usr/local/lib64" /opt/build/bin/ffmpeg -buildconf && \
159+
RUN mkdir -p "${PREFIX}/usr/lib" "${PREFIX}/usr/local" && \
160+
LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/lib" ldd "${PREFIX}/bin/ffmpeg" | cut -d ' ' -f 3 | xargs -i cp {} "${PREFIX}/usr/lib/" && \
161+
LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/usr/lib" "${PREFIX}/bin/ffmpeg" -buildconf && \
160162
mv "${PREFIX}/bin" "${PREFIX}/usr/bin" && \
161163
mv "${PREFIX}/lib" "${PREFIX}/usr/local/"
162164

@@ -172,18 +174,12 @@ LABEL org.opencontainers.image.version="1.0.0"
172174
LABEL org.opencontainers.image.vendor="Intel® Corporation"
173175
LABEL org.opencontainers.image.licenses="BSD 3-Clause License"
174176

175-
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib/intel64:/usr/local/lib:/usr/local/lib64"
177+
ENV LD_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib:/usr/local/lib:/usr/local/lib64:/usr/lib"
176178
ENV LIBVA_DRIVERS_PATH=/usr/local/lib/dri
177179

178180
SHELL ["/bin/bash", "-ex", "-o", "pipefail", "-c"]
179181

180182
WORKDIR /opt/raisrfolder
181-
COPY --from=build /opt/build /
182-
COPY ./filters_1.5x/ /opt/raisrfolder/filters_1.5x/
183-
COPY ./filters_2x/ /opt/raisrfolder/filters_2x/
184-
185-
COPY docker/Flex/nginx.conf /usr/local/nginx/conf/nginx.conf.copy
186-
187183
RUN apt-get update --fix-missing && \
188184
apt-get full-upgrade -y && \
189185
apt-get install --no-install-recommends -y \
@@ -200,7 +196,14 @@ RUN apt-get update --fix-missing && \
200196
gcc \
201197
zlib1g-dev \
202198
make && \
203-
curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
199+
apt-get clean && \
200+
rm -rf /var/lib/apt/lists/* && \
201+
groupadd -g 2110 vfio && \
202+
useradd -m -s /bin/bash -G vfio -u 2610 raisr && \
203+
usermod -aG sudo raisr && \
204+
passwd -d raisr
205+
206+
RUN curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
204207
curl -fsSL https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics-archive-keyring.gpg > /dev/null && \
205208
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/intel-oneAPI.list && \
206209
echo "deb [signed-by=/usr/share/keyrings/intel-graphics-archive-keyring.gpg arch=amd64] https://repositories.intel.com/graphics/ubuntu jammy flex" > /etc/apt/sources.list.d/intel-graphics.list && \
@@ -211,11 +214,14 @@ RUN apt-get update --fix-missing && \
211214
intel-oneapi-ipp-2022.0 && \
212215
apt-get clean && \
213216
rm -rf /var/lib/apt/lists/* && \
214-
ln -s /usr/bin/ffmpeg /opt/raisrfolder/ffmpeg && \
215-
mkdir -p /opt/nginx /opt/nginx-rtmp-module && \
217+
mkdir -p "/opt/nginx" "/opt/nginx-rtmp-module" && \
216218
curl -Lf https://github.com/arut/nginx-rtmp-module/archive/refs/heads/master.tar.gz | tar xz --strip-components=1 -C "/opt/nginx-rtmp-module" && \
217-
curl -Lf http://nginx.org/download/nginx-1.24.0.tar.gz | tar xz --strip-components=1 -C "/opt/nginx" && \
218-
ldconfig
219+
curl -Lf http://nginx.org/download/nginx-1.24.0.tar.gz | tar xz --strip-components=1 -C "/opt/nginx"
220+
221+
COPY --from=build /opt/build /
222+
COPY ./filters_1.5x/ /opt/raisrfolder/filters_1.5x/
223+
COPY ./filters_2x/ /opt/raisrfolder/filters_2x/
224+
COPY docker/Flex/nginx.conf /usr/local/nginx/conf/nginx.conf.copy
219225

220226
# Install ngnix and run ffmpeg to verify that the raisr filter is supported
221227
WORKDIR /opt/nginx
@@ -224,10 +230,15 @@ RUN ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module && \
224230
make install && \
225231
rm -rf nginx-rtmp-module nginx && \
226232
cp -f /usr/local/nginx/conf/nginx.conf.copy /usr/local/nginx/conf/nginx.conf && \
233+
ln -s /usr/bin/ffmpeg /opt/raisrfolder/ffmpeg && \
234+
ldconfig && \
227235
ffmpeg -buildconf && \
228236
ffmpeg -h filter=raisr
229237

230238
WORKDIR /opt/raisrfolder
231-
SHELL ["/bin/bash", "-c"]
232-
CMD ["-h", "filter=raisr"]
239+
USER "raisr"
240+
241+
SHELL [ "/bin/bash", "-c" ]
242+
CMD [ "-buildconf" ]
233243
ENTRYPOINT [ "/opt/raisrfolder/ffmpeg" ]
244+
HEALTHCHECK --interval=30s --timeout=5s CMD ps aux | grep "ffmpeg" || exit 1

docker/Xeon/Dockerfile.ubuntu22.04

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ RUN apt-get update --fix-missing && \
9595
ca-certificates \
9696
libx264-1* \
9797
libx265-1* && \
98-
apt-get clean && \
98+
apt-get clean && \
9999
rm -rf /var/lib/apt/lists/* && \
100100
groupadd -g 2110 vfio && \
101-
useradd -m -s /bin/bash -G vfio -u 1002 raisr && \
102-
usermod -aG sudo raisr
101+
useradd -m -s /bin/bash -G vfio -u 2610 raisr && \
102+
usermod -aG sudo raisr && \
103+
passwd -d raisr
103104

104105
COPY --chown=raisr:raisr filters_1.5x /opt/raisrfolder/filters_1.5x
105106
COPY --chown=raisr:raisr filters_2x /opt/raisrfolder/filters_2x
@@ -113,5 +114,5 @@ USER "raisr"
113114
HEALTHCHECK --interval=30s --timeout=5s CMD ps aux | grep "ffmpeg" || exit 1
114115

115116
SHELL ["/bin/bash", "-c"]
116-
CMD ["-h", "filter=raisr"]
117+
CMD ["-buildconf"]
117118
ENTRYPOINT [ "/opt/raisrfolder/ffmpeg" ]

0 commit comments

Comments
 (0)