mmsegmentation/docker/Dockerfile

36 lines
1.2 KiB
Docker
Raw Normal View History

ARG PYTORCH="1.11.0"
ARG CUDA="11.3"
ARG CUDNN="8"
2022-11-02 16:48:28 +08:00
ARG MMCV="2.0.0rc1"
2020-07-07 20:52:19 +08:00
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
# To fix GPG key error when running apt-get update
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2020-07-07 20:52:19 +08:00
RUN conda clean --all
# Install MMCV
ARG PYTORCH
ARG CUDA
ARG MMCV
2022-11-02 16:48:28 +08:00
RUN ["/bin/bash", "-c", "pip install openmim"]
RUN ["/bin/bash", "-c", "mim install mmengine"]
RUN ["/bin/bash", "-c", "mim install mmcv==${MMCV}"]
# Install MMSegmentation
2022-11-02 16:48:28 +08:00
RUN git clone -b dev-1.x https://github.com/open-mmlab/mmsegmentation.git /mmsegmentation
2020-07-07 20:52:19 +08:00
WORKDIR /mmsegmentation
ENV FORCE_CUDA="1"
2021-06-19 23:31:19 +08:00
RUN pip install -r requirements.txt
2020-07-07 20:52:19 +08:00
RUN pip install --no-cache-dir -e .