forked from NVIDIA/nvvl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.interactive
61 lines (56 loc) · 2.5 KB
/
Dockerfile.interactive
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ARG CUDA_VERSION=9.1
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu16.04
ARG FFMPEG_VERSION=3.4.2
ARG CMAKE_VERSION=3.10.2
# nvcuvid deps
RUN apt-get update --fix-missing && \
apt-get install -y libx11-6 libxext6
ENV NVIDIA_DRIVER_CAPABILITIES=video,compute,utility
# small ffmpeg from source
RUN apt-get install -y \
yasm wget \
libx264-148 libx264-dev \
libx265-79 libx265-dev \
pkg-config && \
cd /tmp && wget -q http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
tar xf ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
rm ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
cd ffmpeg-$FFMPEG_VERSION && \
./configure \
--prefix=/usr/local \
--disable-static --enable-shared \
--disable-all --disable-autodetect --disable-iconv \
--enable-avformat --enable-avcodec --enable-avfilter \
--enable-protocol=file \
--enable-demuxer=mov,matroska \
--enable-bsf=h264_mp4toannexb,hevc_mp4toannexb \
--enable-gpl --enable-libx264 --enable-libx265 \
--enable-swresample --enable-ffmpeg \
--enable-swscale --enable-filter=scale \
--enable-muxer=mp4,matroska \
--enable-cuvid --enable-nvenc --enable-cuda \
--enable-decoder=h264,h264_cuvid,hevc,hevc_cuvid \
--enable-encoder=h264_nvenc,hevc_nvenc,libx264,libx265 \
--enable-hwaccel=h264_cuvid,hevc_cuvid \
--enable-parser=h264,hevc && \
make -j8 && make install && \
cd /tmp && rm -rf ffmpeg-$FFMPEG_VERSION && \
apt-get remove -y yasm wget libx264-dev libx265-dev pkg-config && \
apt-get auto-remove -y
# video_reader build deps (pkg-config, Doxygen, recent cmake)
RUN apt-get install -y pkg-config doxygen wget && \
cd /tmp && \
export dir=$(echo $CMAKE_VERSION | sed "s/^\([0-9]*\.[0-9]*\).*/v\1/") && \
wget -q https://cmake.org/files/${dir}/cmake-$CMAKE_VERSION-Linux-x86_64.sh && \
/bin/sh cmake-$CMAKE_VERSION-Linux-x86_64.sh --skip-license --prefix=/usr/local && \
rm cmake-$CMAKE_VERSION-Linux-x86_64.sh && \
apt-get purge -y wget && \
apt-get autoremove -y
# nvidia-docker only provides libraries for runtime use, not for
# development, to hack it so we can develop inside a container (not a
# normal or supported practice), we need to make an unversioned
# symlink so gcc can find the library. Additional, different
# nvidia-docker versions put the lib in different places, so we make
# symlinks for both places.
RUN ln -s /usr/local/nvidia/lib64/libnvcuvid.so.1 /usr/local/lib/libnvcuvid.so && \
ln -s libnvcuvid.so.1 /usr/lib/x86_64-linux-gnu/libnvcuvid.so