gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/images/gpu/pytorch/Dockerfile.x86_64 (about)

     1  FROM nvidia/cuda:12.2.0-devel-ubuntu20.04
     2  
     3  RUN apt-get update && apt-get install --yes \
     4        python3 \
     5        python3-distutils \
     6        python3-pip \
     7        clang \
     8        wget \
     9        vim \
    10        git
    11  
    12  RUN python3 -m pip install --ignore-installed \
    13        "clang~=$(clang --version | grep -oP '10\.[^-]+')" \
    14        torch \
    15        torchvision \
    16        lightning \
    17        numpy \
    18        memory_profiler
    19  
    20  ENV PYTORCH_DATASETS_DIR=/pytorch-data
    21  ENV TORCH_HOME=/pytorch-home
    22  COPY download_pytorch_datasets.py /tmp/
    23  # Some PyTorch examples hardcode the data directory to "data", so
    24  # make a symlink for that too.
    25  RUN mkdir "$PYTORCH_DATASETS_DIR" && \
    26      python3 /tmp/download_pytorch_datasets.py && \
    27      rm /tmp/download_pytorch_datasets.py
    28  
    29  RUN PYTORCH_EXAMPLES_COMMIT=30b310a977a82dbfc3d8e4a820f3b14d876d3bd2 && \
    30      mkdir /pytorch-examples && \
    31      cd /pytorch-examples && \
    32      git init && \
    33      git remote add origin https://github.com/pytorch/examples && \
    34      git fetch --depth 1 origin "$PYTORCH_EXAMPLES_COMMIT" && \
    35      git checkout FETCH_HEAD && \
    36      sed -ri "s~(datasets.*)\\(['\"](../)?data['\"],~\\1('$PYTORCH_DATASETS_DIR',~g" **/*.py && \
    37      sed -ri 's/download=True/download=False/' **/*.py
    38  
    39  COPY *.py /
    40  RUN rm /download_pytorch_datasets.py