-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathDockerfile
77 lines (67 loc) · 2.66 KB
/
Dockerfile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update &&\
apt-get -y install build-essential yasm nasm unzip git wget \
sysstat libtcmalloc-minimal4 pkgconf autoconf libtool flex bison libx264-dev \
python3 python3-pip python3-dev python3-setuptools &&\
ln -s /usr/bin/python3 /usr/bin/python &&\
apt-get clean &&\
apt-get autoremove &&\
rm -rf /var/lib/apt/lists/* &&\
rm -rf /var/cache/apt/archives/*
RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.0/cmake-3.26.0-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /usr/bin/cmake \
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake \
&& rm /tmp/cmake-install.sh
ENV PATH="/usr/bin/cmake/bin:${PATH}"
# Build nvidia codec headers
RUN git clone -b sdk/11.1 --single-branch https://git.videolan.org/git/ffmpeg/nv-codec-headers.git &&\
cd nv-codec-headers && make install &&\
cd .. && rm -rf nv-codec-headers
# Build ffmpeg with nvenc support
RUN git clone --depth 1 -b release/6.0 --single-branch https://github.com/FFmpeg/FFmpeg.git &&\
cd FFmpeg &&\
mkdir ffmpeg_build && cd ffmpeg_build &&\
../configure \
--enable-cuda \
--enable-cuvid \
--enable-shared \
--disable-static \
--disable-doc \
--extra-cflags=-I/usr/local/cuda/include \
--extra-ldflags=-L/usr/local/cuda/lib64 \
--extra-libs=-lpthread \
--nvccflags="-arch=sm_60 \
-gencode=arch=compute_60,code=sm_60 \
-gencode=arch=compute_61,code=sm_61 \
-gencode=arch=compute_70,code=sm_70 \
-gencode=arch=compute_75,code=sm_75 \
-gencode=arch=compute_80,code=sm_80 \
-gencode=arch=compute_86,code=sm_86 \
-gencode=arch=compute_89,code=sm_89 \
-gencode=arch=compute_89,code=compute_89" &&\
make -j$(nproc) && make install && ldconfig &&\
cd ../.. && rm -rf FFmpeg
RUN pip3 install --no-cache-dir \
twine \
awscli \
numpy \
packaging
ARG TORCH_VERSION
# Install PyTorch
RUN pip3 install --no-cache-dir torch==$TORCH_VERSION --extra-index-url https://download.pytorch.org/whl/cu118
RUN git clone https://github.com/doxygen/doxygen.git &&\
cd doxygen &&\
git checkout dc89ac0 &&\
mkdir build &&\
cd build &&\
cmake -G "Unix Makefiles" .. &&\
make install &&\
cd ../.. && rm -rf doxygen
COPY . /app
WORKDIR /app
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES video,compute,utility