Skip to content

Commit

Permalink
Update to CUDA 12.3.1 and ffmpeg 6.1.1 (#103)
Browse files Browse the repository at this point in the history
* Update to CUDA 12.3.1 and ffmpeg 6.1.1

* Adding support for older headers

* Not using deprecated method
  • Loading branch information
troykelly authored Jan 16, 2024
1 parent 93242b8 commit 3547a9a
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 44 deletions.
43 changes: 30 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ jobs:
build:
strategy:
matrix:
version: [12.2.0, 12.0.1, 12.0.0, 11.8.0]
ffmpeg: [5.1.2, "6.0", "6.1-dev"]
version: [12.3.1, 12.2.2, 12.0.1, 12.0.0, 11.8.0]
ffmpeg: [5.1.4, "6.0.1", "6.1.1"]
os: [ubuntu22.04]
include:
- version: 12.2.2
nvcodec: 12.0.16.0
- version: 12.0.1
nvcodec: 12.0.16.0
- version: 12.0.0
nvcodec: 12.0.16.0
- version: 11.8.0
nvcodec: 12.0.16.0
# yamllint disable rule:line-length
name: 👷 Build CUDA ${{ matrix.version }} on ${{ matrix.os }} with ffmpeg ${{ matrix.ffmpeg }}
needs:
Expand Down Expand Up @@ -97,7 +106,7 @@ jobs:
type=ref,event=branch
type=ref,event=pr
type=sha
type=edge,enable=${{ matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},priority=700,prefix=,suffix=,branch=$repo.default_branch
type=edge,enable=${{ matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},priority=700,prefix=,suffix=,branch=$repo.default_branch
# yamllint enable rule:line-length

- name: 🏗 Set up QEMU
Expand All @@ -121,6 +130,23 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.CI_PAT }}

- name: 🚀 Conditional Build Args
id: buildargs
run: |
args="BUILD_DATE=\"${{ steps.flags.outputs.date }}\" \
BUILD_DESCRIPTION=\"${{ needs.information.outputs.description }}\" \
BUILD_NAME=\"${{ needs.information.outputs.name }}\" \
BUILD_REF=\"${{ github.sha }}\" \
BUILD_REPOSITORY=\"${{ github.repository }}\" \
BUILD_VERSION=\"${{ needs.information.outputs.version }}\" \
CUDA=\"${{ matrix.version }}\" \
OS=\"${{ matrix.os }}\" \
FFMPEG_VERSION=\"${{ matrix.ffmpeg }}\""
if [[ -n "${{ matrix.nvcodec }}" ]]; then
args+=" NVCODEC_HEADERS_VERSION=\"${{ matrix.nvcodec }}\""
fi
echo "args=${args}" >> $GITHUB_OUTPUT
- name: 🚀 Build
uses: docker/build-push-action@v5
with:
Expand All @@ -135,13 +161,4 @@ jobs:
# yamllint disable-line rule:line-length
# platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8
platforms: linux/amd64
build-args: |
BUILD_DATE=${{ needs.information.outputs.version }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=${{ needs.information.outputs.version }}
CUDA=${{ matrix.version }}
OS=${{ matrix.os }}
FFMPEG_VERSION=${{ matrix.ffmpeg }}
build-args: ${{ steps.buildargs.outputs.args }}
55 changes: 36 additions & 19 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,18 @@ jobs:
deploy:
strategy:
matrix:
version: [12.2.0, 12.0.1, 12.0.0, 11.8.0]
ffmpeg: [5.1.2, "6.0", "6.1-dev"]
version: [12.3.1, 12.2.2, 12.0.1, 12.0.0, 11.8.0]
ffmpeg: [5.1.4, "6.0.1", "6.1.1"]
os: [ubuntu22.04]
include:
- version: 12.2.2
nvcodec: 12.0.16.0
- version: 12.0.1
nvcodec: 12.0.16.0
- version: 12.0.0
nvcodec: 12.0.16.0
- version: 11.8.0
nvcodec: 12.0.16.0
# yamllint disable rule:line-length
name: 👷 Build & Deploy CUDA ${{ matrix.version }} on ${{ matrix.os }} with ffmpeg ${{ matrix.ffmpeg }}
needs:
Expand Down Expand Up @@ -101,15 +110,15 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},prefix=,suffix=
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},prefix=,suffix=
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},prefix=,suffix=
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},prefix=,suffix=
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},prefix=,suffix=
type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},prefix=,suffix=
type=sha
type=edge,enable=${{ matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},priority=700,prefix=,suffix=,branch=$repo.default_branch
type=raw,prefix=,suffix=,value=${{ matrix.version }}-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }}
type=raw,prefix=,suffix=,value=${{ matrix.version }}-${{ matrix.os }}-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.ffmpeg == '6.0' }}
type=edge,enable=${{ matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},priority=700,prefix=,suffix=,branch=$repo.default_branch
type=raw,prefix=,suffix=,value=${{ matrix.version }}-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }}
type=raw,prefix=,suffix=,value=${{ matrix.version }}-${{ matrix.os }}-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.ffmpeg == '6.1.1' }}
type=raw,prefix=,suffix=,value=${{ matrix.version }}-${{ matrix.ffmpeg }}-${{ matrix.os }}-latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,prefix=,suffix=,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.2.0' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.0' }},prefix=,suffix=
type=raw,prefix=,suffix=,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && matrix.version == '12.3.1' && matrix.os == 'ubuntu22.04' && matrix.ffmpeg == '6.1.1' }},prefix=,suffix=
# yamllint enable rule:line-length

- name: 🏗 Set up QEMU
Expand All @@ -133,6 +142,23 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.CI_PAT }}

- name: 🚀 Conditional Build Args
id: buildargs
run: |
args="BUILD_DATE=\"${{ steps.flags.outputs.date }}\" \
BUILD_DESCRIPTION=\"${{ needs.information.outputs.description }}\" \
BUILD_NAME=\"${{ needs.information.outputs.name }}\" \
BUILD_REF=\"${{ github.sha }}\" \
BUILD_REPOSITORY=\"${{ github.repository }}\" \
BUILD_VERSION=\"${{ needs.information.outputs.version }}\" \
CUDA=\"${{ matrix.version }}\" \
OS=\"${{ matrix.os }}\" \
FFMPEG_VERSION=\"${{ matrix.ffmpeg }}\""
if [[ -n "${{ matrix.nvcodec }}" ]]; then
args+=" NVCODEC_HEADERS_VERSION=\"${{ matrix.nvcodec }}\""
fi
echo "args=${args}" >> $GITHUB_OUTPUT
- name: 🚀 Build
uses: docker/build-push-action@v5
with:
Expand All @@ -147,13 +173,4 @@ jobs:
# yamllint disable-line rule:line-length
# platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8
platforms: linux/amd64
build-args: |
BUILD_DATE=${{ steps.flags.outputs.date }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=${{ needs.information.outputs.version }}
CUDA=${{ matrix.version }}
OS=${{ matrix.os }}
FFMPEG_VERSION=${{ matrix.ffmpeg }}
build-args: ${{ steps.buildargs.outputs.args }}
29 changes: 17 additions & 12 deletions ffmpeg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG CUDA=12.2.0
ARG CUDA=12.3.1
ARG OS=ubuntu22.04
ARG BULDIMAGE=${CUDA}-devel-${OS}
ARG RUNIMAGE=${CUDA}-runtime-${OS}
Expand All @@ -8,7 +8,7 @@ ARG CUDA
ARG OS

RUN apt-get update && \
apt-get -y --allow-change-held-packages full-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-change-held-packages full-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get -qqy install \
automake \
autoconf \
Expand Down Expand Up @@ -118,26 +118,31 @@ RUN apt-get update && \
wget \
yasm

ARG FFMPEG_VERSION=6.0
ARG AVISYNTHPLUS_VERSION=3.7.2
ARG NVCODEC_HEADERS_VERSION=12.0.16.0
ARG FFMPEG_VERSION=6.1.1
ARG AVISYNTHPLUS_VERSION=3.7.3
ARG NVCODEC_HEADERS_VERSION=12.1.14.0
# Vapoursynth versions 64 and 65 are broken
ARG VAPOURSYNTH_VERSION=63

RUN rm -Rf /opt/src/* && \
mkdir -p /opt/src/nv-codec-headers /opt/src/ffmpeg /opt/src/vapoursynth && \
git clone --depth 1 --branch n${NVCODEC_HEADERS_VERSION} https://git.videolan.org/git/ffmpeg/nv-codec-headers.git /opt/src/nv-codec-headers && \
git clone --depth 1 --branch n${FFMPEG_VERSION} https://git.ffmpeg.org/ffmpeg.git /opt/src/ffmpeg && \
git clone --depth 1 https://github.com/vapoursynth/vapoursynth.git /opt/src/vapoursynth && \
curl -L https://github.com/AviSynth/AviSynthPlus/archive/refs/tags/v${AVISYNTHPLUS_VERSION}.tar.gz | tar -xz -C /opt/src && \
cd /opt/src/nv-codec-headers && \
git clone --depth 1 --branch R${VAPOURSYNTH_VERSION} https://github.com/vapoursynth/vapoursynth.git /opt/src/vapoursynth && \
curl -L https://github.com/AviSynth/AviSynthPlus/archive/refs/tags/v${AVISYNTHPLUS_VERSION}.tar.gz | tar -xz -C /opt/src

RUN cd /opt/src/nv-codec-headers && \
make && \
make install && \
cd /opt/src/vapoursynth && \
make install

RUN cd /opt/src/vapoursynth && \
pip3 install -r ./python-requirements.txt && \
./autogen.sh && \
LIBGNUTLS_CFLAGS=-I/usr/include/gnutls ./configure --prefix=/usr && \
make -j$(nproc) && \
make install && \
cd /opt/src/AviSynthPlus-${AVISYNTHPLUS_VERSION} && \
make install

RUN cd /opt/src/AviSynthPlus-${AVISYNTHPLUS_VERSION} && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr .. && \
Expand Down

0 comments on commit 3547a9a

Please sign in to comment.