Skip to content

Commit ef92037

Browse files
committed
Minor update to Flex Ubuntu22
Minor update to Flex Ubuntu22 Signed-off-by: Milosz Linkiewicz <milosz.linkiewicz@intel.com>
1 parent 9200584 commit ef92037

File tree

6 files changed

+98
-62
lines changed

6 files changed

+98
-62
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: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: 'ubuntu-22.04'
3232
timeout-minutes: 70
3333
env:
34-
LD_LIBRARY_PATH: "/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}"
34+
LD_LIBRARY_PATH: "/opt/intel/oneapi/ipp/latest/lib:${PREFIX}/usr/lib:${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}"
3535
steps:
3636
- name: 'Harden Runner'
3737
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
@@ -81,30 +81,39 @@ 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
86-
- name: 'Configure, build and install ffmpeg repository'
90+
- name: 'Configure ffmpeg repository'
8791
working-directory: "${BUILD_DIR}/ffmpeg"
92+
continue-on-error: true
8893
run: |
8994
./configure \
90-
--disable-debug \
91-
--disable-doc \
92-
--enable-libipp \
93-
--enable-static \
95+
--disable-shared \
96+
--disable-debug \
97+
--disable-doc \
98+
--enable-static \
99+
--enable-libipp \
94100
--enable-gpl \
95101
--enable-libx264 \
96102
--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/' \
99-
--extra-ldflags='-fopenmp -L/opt/intel/oneapi/ipp/latest/lib' \
103+
--enable-opencl \
104+
--extra-libs='-lraisr -lstdc++ -lippcore -lippvm -lipps -lippi -lm' \
105+
--extra-cflags='-fopenmp -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp' \
106+
--extra-ldflags="-fopenmp -L/opt/intel/oneapi/ipp/latest/lib -L${PREFIX}/lib" \
100107
--enable-cross-compile \
101-
--prefix="${PREFIX}" && \
102-
make clean && \
103-
make -j"$(nproc)" && \
104-
sudo -E make install
108+
--prefix="${PREFIX}" || \
109+
{ tail -n 100 "${BUILD_DIR}/ffmpeg/ffbuild/config.log && exit 1 }
105110
106-
- name: 'Libraries path cleanup and ffmpeg check'
111+
- name: 'Build, install and check ffmpeg'
107112
working-directory: "${BUILD_DIR}/ffmpeg"
113+
continue-on-error: true
108114
run: |
115+
make clean
116+
make -j"$(nproc)"
117+
sudo -E make install
109118
sudo -E ldconfig
110119
ffmpeg -buildconf

.github/workflows/codeql.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
ocl-icd-opencl-dev \
7070
opencl-headers \
7171
zlib1g-dev \
72-
make curl git sudo tar unzip wget yasm && \
72+
make curl git sudo tar unzip wget yasm
7373
7474
- name: 'Install Intel OneAPI APT repository'
7575
run: |
@@ -81,7 +81,7 @@ jobs:
8181
8282
- name: 'Download and patch ffmpeg repository'
8383
run: |
84-
set -eo pipefail && \
84+
set -exo pipefail && \
8585
curl -Lf https://github.com/ffmpeg/ffmpeg/archive/${FFMPEG_COMMIT_ID}.tar.gz | tar -zx --strip-components=1 -C "${BUILD_DIR}/ffmpeg"
8686
patch -d "${BUILD_DIR}/ffmpeg" -p1 -i <(cat "${{ github.workspace }}/ffmpeg/"*.patch)
8787
cp "${{ github.workspace }}/ffmpeg/vf_raisr"*.c "${BUILD_DIR}/ffmpeg/libavfilter"
@@ -93,7 +93,11 @@ jobs:
9393
config-file: "${{ github.workspace }}/.github/codeql/codeql-config.yml"
9494

9595
- name: 'Build RAISR from source code'
96-
run: '${{ github.workspace }}/build.sh -DENABLE_RAISR_OPENCL=ON'
96+
run: |
97+
"${{ github.workspace }}/build.sh" -DENABLE_RAISR_OPENCL=ON \
98+
-DCMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;" \
99+
-DCMAKE_C_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp" \
100+
-DCMAKE_CXX_FLAGS="-I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp"
97101
98102
- name: 'Perform CodeQL Analysis'
99103
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11

build.sh

Lines changed: 8 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}")"
@@ -15,6 +15,11 @@ nproc="${nproc:-$(nproc)}"
1515
# Env variable BUILD_TYPE can be one off: RelWithDebInfo, Release, Debug
1616
BUILD_TYPE="${BUILD_TYPE:-Release}"
1717

18+
CMAKE_C_FLAGS=" -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp ${CMAKE_C_FLAGS}"
19+
CMAKE_CXX_FLAGS=" -I/opt/intel/oneapi/ipp/latest/include -I/opt/intel/oneapi/ipp/latest/include/ipp ${CMAKE_CXX_FLAGS}"
20+
CMAKE_LIBRARY_PATH="/opt/intel/oneapi/ipp/latest/lib;${PREFIX}/lib;${CMAKE_LIBRARY_PATH}"
21+
LDFLAGS="${LDFLAGS} -L/opt/intel/oneapi/ipp/latest/lib -L${PREFIX}/lib "
22+
1823
# Helpful when copying and pasting functions and debuging.
1924
if printf '%s' "$0" | grep -q '\.sh'; then
2025
IN_SCRIPT=true
@@ -84,10 +89,10 @@ function check_executable()
8489

8590
if check_executable icpx; then
8691
CXX=$(check_executable -p icpx)
87-
elif check_executable clang++; then
88-
CXX=$(check_executable -p clang++)
8992
elif check_executable g++; then
9093
CXX=$(check_executable -p g++)
94+
elif check_executable clang++; then
95+
CXX=$(check_executable -p clang++)
9196
else
9297
log_error "No suitable cpp compiler found in path."
9398
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)