Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuda compile ffmpeg #482

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,18 @@ RUN \
sed -i 's/-ljxl_cms/-ljxl_cms -lstdc++ /' /usr/local/lib/pkgconfig/libjxl_cms.pc && \
sed -i 's/-ljxl_threads/-ljxl_threads -lstdc++ /' /usr/local/lib/pkgconfig/libjxl_threads.pc

# bump: nv-codec-headers /NV_CODEC_HEADERS_VERSION=([\d.]+)/ https://github.com/FFmpeg/nv-codec-headers.git|*
# bump: nv-codec-headers after ./hashupdate Dockerfile NV_CODEC_HEADERS $LATEST
# bump: nv-codec-headers link "Source diff $CURRENT..$LATEST" https://github.com/FFmpeg/nv-codec-headers/compare/v$CURRENT..v$LATEST
ARG NV_CODEC_HEADERS_VERSION=12.2.72.0
ARG NV_CODEC_HEADERS_URL="https://github.com/FFmpeg/nv-codec-headers/archive/n$NV_CODEC_HEADERS_VERSION.tar.gz"
ARG NV_CODEC_HEADERS_SHA256=dbeaec433d93b850714760282f1d0992b1254fc3b5a6cb7d76fc1340a1e47563
RUN \
wget $WGET_OPTS -O nv-codec-headers.tar.gz "$NV_CODEC_HEADERS_URL" && \
echo "$NV_CODEC_HEADERS_SHA256 nv-codec-headers.tar.gz" | sha256sum -c - && \
tar $TAR_OPTS nv-codec-headers.tar.gz && cd nv-codec-headers-* && \
make -j$(nproc) install

# bump: ffmpeg /FFMPEG_VERSION=([\d.]+)/ https://github.com/FFmpeg/FFmpeg.git|*
# bump: ffmpeg after ./hashupdate Dockerfile FFMPEG $LATEST
# bump: ffmpeg link "Changelog" https://github.com/FFmpeg/FFmpeg/blob/n$LATEST/Changelog
Expand All @@ -1043,15 +1055,16 @@ ARG ENABLE_FDKAAC=
# ldfalgs -Wl,--allow-multiple-definition is a workaround for linking with multiple rust staticlib to
# not cause collision in toolchain symbols, see comment in checkdupsym script for details.
RUN \
set -ex && \
wget $WGET_OPTS -O ffmpeg.tar.bz2 "$FFMPEG_URL" && \
echo "$FFMPEG_SHA256 ffmpeg.tar.bz2" | sha256sum -c - && \
tar $TAR_OPTS ffmpeg.tar.bz2 && cd ffmpeg* && \
FDKAAC_FLAGS=$(if [[ -n "$ENABLE_FDKAAC" ]] ;then echo " --enable-libfdk-aac --enable-nonfree " ;else echo ""; fi) && \
sed -i 's/add_ldexeflags -fPIE -pie/add_ldexeflags -fPIE -static-pie/' configure && \
./configure \
--pkg-config-flags="--static" \
--extra-cflags="-fopenmp" \
--extra-ldflags="-fopenmp -Wl,--allow-multiple-definition -Wl,-z,stack-size=2097152" \
--extra-cflags="-fopenmp -I/usr/local/cuda/include" \
--extra-ldflags="-fopenmp -Wl,--allow-multiple-definition -Wl,-z,stack-size=2097152 -L/usr/local/cuda/lib64" \
--toolchain=hardened \
--disable-debug \
--disable-shared \
Expand Down Expand Up @@ -1114,6 +1127,9 @@ RUN \
--enable-libzimg \
--enable-openssl \
--enable-libjxl \
--enable-cuda-nvcc \
--enable-libnpp \
--enable-nonfree \
|| (cat ffbuild/config.log ; false) \
&& make -j$(nproc) install

Expand Down
Loading