I have some weird codec installation issues with the following docker image.
ARG PYTORCH="1.8.0"
ARG CUDA="11.1"
ARG CUDNN="8"
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 8.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
# https://github.com/NVIDIA/nvidia-docker/issues/1632
RUN apt-key del 7fa2af80
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
RUN apt-get update && apt-get install -y \
git nano ninja-build p7zip-full imagemagick wget unzip \
libglib2.0-0 libsm6 libxrender-dev libxext6 libturbojpeg \
libxrender1 libfontconfig1 freeglut3-dev llvm-6.0-tools curl \
amqp-tools ffmpeg libx264-dev \
&& apt --fix-broken install \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# for visualizing
&& wget https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb \
&& dpkg -i ./mesa_18.3.3-0.deb || true \
&& apt install -f \
&& git clone https://github.com/mmatl/pyopengl.git \
&& pip install ./pyopengl
First of all, libx264 is supposed to be installed by a simple apt-get install ffmpeg
in ubuntu 18.04.5. Indeed I see that it is being installed in the installation instructions but for some reason, it's not enabled. This is confirmed when running ffmpeg -codecs | grep 264
, which doesn't show libx264
(only h264, libopenh264 are there).
In addition, I also compiled from source, explicitly enabling libx264 during installation. It didn't make a difference.
The problem was that I also had ffmpeg
installed with conda
. So:
conda remove --force ffmpeg -y
apt-get update && apt-get install -y ffmpeg