Skip to content

Commit c52fef3

Browse files
authored
Merge pull request #141 from mliradelc/rockylinux-8
Add Rocky linux 8 support with cuda 11.6
2 parents c27872f + de3053d commit c52fef3

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,30 @@ jobs:
103103
run: |
104104
docker run --rm ffmpeg:cuda-ubuntu -buildconf
105105
106+
build-cuda-rocky-docker:
107+
name: build in Rockylinux docker with cuda
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Checkout code
111+
uses: actions/checkout@v2
112+
113+
- name: pull base image
114+
id: cuda_centos_pull
115+
run: |
116+
docker pull nvidia/cuda:11.6.0-devel-centos8
117+
docker pull rockylinux:8
118+
- name: run if cuda_centos_pull failed
119+
if: failure() && steps.cuda_centos_pull.outcome == 'failure'
120+
run: |
121+
docker pull nvidia/cuda:11.6.0-devel-centos8
122+
docker pull rockylinux:8
123+
- name: build ffmpeg
124+
run: |
125+
docker build -t ffmpeg:cuda-rocky -f cuda-rocky.dockerfile .
126+
- name: test run ffmepg
127+
run: |
128+
docker run --rm ffmpeg:cuda-rocky -buildconf
129+
106130
build-full-static:
107131
name: full static build in docker
108132
runs-on: ubuntu-20.04

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ with https://github.com/markus-perl/ffmpeg-build-script/actions to make sure eve
122122
### Linux
123123

124124
* Debian >= Buster, Ubuntu => Focal Fossa, other Distributions might work too
125+
* Rocky Linux 8
125126
* A development environment and curl is required
126127

127128
```bash
@@ -151,7 +152,7 @@ These builds are always built with the --enable-gpl-and-non-free switch, as CUDA
151152
```bash
152153
export DOCKER_BUILDKIT=1
153154

154-
## Set the DIST (`ubuntu` or `centos`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or centos: `7`, `8`) environment variables to select the preferred Docker base image.
155+
## Set the DIST (`ubuntu` or `rocky`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or rocky: `8`) environment variables to select the preferred Docker base image.
155156
$ export DIST=centos
156157
$ export VER=8
157158

cuda-rocky.dockerfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
ARG VER=8
2+
3+
FROM nvidia/cuda:11.6.0-devel-centos${VER} AS build
4+
5+
ENV NVIDIA_VISIBLE_DEVICES all
6+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
7+
8+
9+
# Fix EOL Mirror issue
10+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
11+
# Pick one of these mirrors that works. vault.centos.org was giving me timeout issues
12+
# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
13+
# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://linuxsoft.cern.ch/centos-vault/|g' /etc/yum.repos.d/CentOS-Linux-*
14+
# RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://archive.kernel.org/centos-vault/|g' /etc/yum.repos.d/CentOS-Linux-*
15+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://mirror.nsc.liu.se/centos-store|g' /etc/yum.repos.d/CentOS-Linux-*
16+
17+
# upgrade to Rocky Linux 8
18+
RUN dnf install -y ncurses \
19+
&& dnf clean all \
20+
&& rm -rf /var/cache/dnf \
21+
&& rm -rf /var/cache/yum \
22+
&& dnf install -y dnf-plugins-core \
23+
&& dnf -y update
24+
25+
WORKDIR /opt/conversion_to_rocky
26+
RUN curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh && \
27+
chmod +x migrate2rocky.sh && \
28+
bash migrate2rocky.sh -r
29+
30+
31+
RUN yum group install -y "Development Tools" \
32+
&& yum install -y curl libva-devel python3 \
33+
&& yum install -y meson ninja-build --enablerepo=powertools \
34+
&& rm -rf /var/cache/yum/* /var/cache/dnf/* \
35+
&& yum clean all \
36+
&& alternatives --set python /usr/bin/python3
37+
38+
WORKDIR /app
39+
COPY ./build-ffmpeg /app/build-ffmpeg
40+
41+
RUN SKIPINSTALL=yes /app/build-ffmpeg --build --enable-gpl-and-non-free
42+
43+
44+
FROM rockylinux:${VER}
45+
46+
ENV NVIDIA_VISIBLE_DEVICES all
47+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
48+
49+
# install va-driver
50+
RUN yum install -y libva \
51+
&& rm -rf /var/cache/yum/* \
52+
&& yum clean all
53+
54+
# Copy libnpp
55+
COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppc.so.11 /lib64/libnppc.so.11
56+
COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppig.so.11 /lib64/libnppig.so.11
57+
COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppicc.so.11 /lib64/libnppicc.so.11
58+
COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppidei.so.11 /lib64/libnppidei.so.11
59+
COPY --from=build /usr/local/cuda-11.6/targets/x86_64-linux/lib/libnppif.so.11 /lib64/libnppif.so.11
60+
61+
# Copy ffmpeg
62+
COPY --from=build /app/workspace/bin/ffmpeg /usr/bin/ffmpeg
63+
COPY --from=build /app/workspace/bin/ffprobe /usr/bin/ffprobe
64+
COPY --from=build /app/workspace/bin/ffplay /usr/bin/ffplay
65+
66+
# Check shared library
67+
RUN ldd /usr/bin/ffmpeg
68+
RUN ldd /usr/bin/ffprobe
69+
RUN ldd /usr/bin/ffplay
70+
71+
CMD ["--help"]
72+
ENTRYPOINT ["/usr/bin/ffmpeg"]

0 commit comments

Comments
 (0)