Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 2 additions & 31 deletions dockers/base-conda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu18.04

ARG PYTHON_VERSION=3.7
ARG PYTORCH_VERSION=1.6
# "pytorch" | "pytorch-nightly"
ARG PYTORCH_CHANNEL=pytorch
ARG CONDA_VERSION=4.7.12

Expand Down Expand Up @@ -96,34 +97,4 @@ ENV LD_LIBRARY_PATH="/root/miniconda3/envs/${CONDA_ENV}/lib:$LD_LIBRARY_PATH"
ENV CONDA_DEFAULT_ENV=${CONDA_ENV}

COPY ./requirements/extra.txt requirements-extra.txt
COPY ./requirements/test.txt requirements-test.txt

RUN \
# Disable cache
pip config set global.cache-dir false && \
# Drop fairscale for PT <= 1.4
if [[ $PYTORCH_VERSION < 1.4 ]] ; then \
python -c "fname = 'requirements-extra.txt' ; lines = [line for line in open(fname).readlines() if 'fairscale' not in line] ; open(fname, 'w').writelines(lines)" ; \
fi && \
# Install remaining requirements
pip install -r requirements-extra.txt --upgrade-strategy only-if-needed && \
pip install -r requirements-test.txt --upgrade-strategy only-if-needed && \
rm requirements*

RUN \
# install DALI, needed for examples
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda${CUDA_VERSION%%.*}0

RUN \
# install NVIDIA AMP
git clone https://github.com/NVIDIA/apex && \
pip install --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./apex && \
rm -rf apex

RUN \
# Show what we have
pip --version && \
conda info && \
pip list && \
python -c "import sys; assert sys.version[:3] == '$PYTHON_VERSION', sys.version" && \
python -c "import torch; assert torch.__version__[:3] == '$PYTORCH_VERSION', torch.__version__"
COPY ./requirements/test.txt requirements-test.txt