Skip to content

Commit 6272f19

Browse files
committed
Add conda support
1 parent fddc2b7 commit 6272f19

15 files changed

Lines changed: 99 additions & 63 deletions

dockerfiles/Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ARG PY_VERSION
2+
ARG DOCKER_CUDA_VERSION=12.4.1
3+
FROM nvidia/cuda:${DOCKER_CUDA_VERSION}-cudnn-devel-ubuntu22.04
4+
5+
ARG PY_VERSION
6+
7+
# For A100, RTX4090, H100, and H200
8+
ENV TORCH_CUDA_ARCH_LIST='7.0 7.5 8.0 8.6 8.9 9.0+PTX'
9+
ENV MAX_JOBS=2
10+
ENV NVCC_THREADS=8
11+
12+
ENV DEBIAN_FRONTEND=noninteractive
13+
ENV CUDA_HOME=/usr/local/cuda
14+
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
15+
16+
RUN apt-get update -y
17+
18+
# Utils
19+
RUN apt-get install -y vim git bzip2 tmux wget tar htop unzip
20+
21+
# SSH
22+
RUN apt-get install -y ssh openssh-server
23+
RUN mkdir -p /var/run/sshd
24+
RUN echo "root:root" | chpasswd
25+
RUN echo "Port 22" >> /etc/ssh/sshd_config
26+
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
27+
EXPOSE 22
28+
29+
RUN apt-get update -y && apt-get install -y software-properties-common
30+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
31+
RUN add-apt-repository -y "deb https://developer.download.nvidia.com/devtools/repos/ubuntu22.04/$(dpkg --print-architecture) /"
32+
RUN apt-get install -y nsight-systems-2024.6.2
33+
RUN apt-get install -y mesa-utils x11-apps
34+
RUN apt-get install -y freeglut3-dev libglu1-mesa-dev mesa-common-dev libxkbfile-dev libgl1-mesa-glx
35+
36+
ENV LIBGL_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
37+
ENV LIBGL_ALWAYS_INDIRECT=1
38+
39+
# Build tools
40+
RUN rm /etc/apt/sources.list.d/archive_uri-https_developer_download_nvidia_com_devtools_repos_ubuntu22_04_amd64-jammy.list
41+
RUN apt-get update -y && apt-get install -y gcc-12 g++-12 ninja-build cmake build-essential autoconf libtool automake git
42+
RUN apt-get install -y ffmpeg libsm6 libxext6 libgl1
43+
44+
# Utils
45+
RUN apt-get install -y vim git bzip2 tmux wget tar htop curl
46+
47+
RUN add-apt-repository ppa:deadsnakes/ppa && apt-get install -y python${PY_VERSION} python${PY_VERSION}-dev python${PY_VERSION}-venv
48+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VERSION} 1
49+
RUN update-alternatives --set python3 /usr/bin/python${PY_VERSION}
50+
RUN ln -sf /usr/bin/python${PY_VERSION}-config /usr/bin/python3-config
51+
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VERSION}
52+
53+
RUN apt-get install -y python3-setuptools python3-dev libpython${PY_VERSION}-dev
File renamed without changes.

dockerfiles/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PY_VERSION=$1
2+
TAG=junwha/ddiff-base-common:cu12.4.1-py${PY_VERSION}
3+
4+
docker build -t $TAG --build-arg PY_VERSION=${PY_VERSION} ./ && \
5+
./test.sh $TAG && docker push $TAG

dockerfiles/conda/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG PY_VERSION
2+
ARG DOCKER_CUDA_VERSION=12.4.1
3+
FROM junwha/ddiff-base-common:cu${DOCKER_CUDA_VERSION}-py${PY_VERSION}
4+
ARG PY_VERSION
5+
ARG DOCKER_CUDA_VERSION
6+
7+
# Conda
8+
RUN wget https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh && \
9+
chmod +x ./Anaconda3-2024.10-1-Linux-x86_64.sh && \
10+
./Anaconda3-2024.10-1-Linux-x86_64.sh -b && \
11+
rm ./Anaconda3-2024.10-1-Linux-x86_64.sh
12+
ENV PATH /root/anaconda3/bin:$PATH
13+
14+
RUN conda init && \
15+
conda install python=$PY_VERSION -y && \
16+
conda install -c "nvidia/label/cuda-$DOCKER_CUDA_VERSION" cuda -y
17+
18+
# RUN conda init && \
19+
# pip install torch==$TORCH_VERSION torchvision==$TORCH_VISION_VERSION torchaudio==$TORCH_VERSION --index-url https://download.pytorch.org/whl/cu$(cat /CUDA_VERSION | awk -F. '{print $1$2}')

dockerfiles/conda/Dockerfile.torch

Lines changed: 0 additions & 12 deletions
This file was deleted.

dockerfiles/conda/build_conda.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PY_VERSION=$1
2+
DATE=251214 # $(date +"%y%m%d")
3+
TAG=junwha/ddiff-base:cu12.4.1-py${PY_VERSION}-conda-$DATE
4+
5+
docker build -t $TAG --build-arg PY_VERSION=${PY_VERSION} ./ && \
6+
./test.sh $TAG && docker push $TAG
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ARG DOCKER_CUDA_VERSION
2+
ARG TORCH_VERSION
3+
ARG TORCH_VISION_VERSION
4+
ARG BASE_TAG
5+
6+
# ${DOCKER_CUDA_VERSION}-
7+
FROM junwha/dslice-base-py:${BASE_TAG}
8+
9+
ARG TORCH_VERSION
10+
ARG TORCH_VISION_VERSION
11+
12+
# RUN conda init && \
13+
# pip install torch==$TORCH_VERSION torchvision==$TORCH_VISION_VERSION torchaudio==$TORCH_VERSION --index-url https://download.pytorch.org/whl/cu$(cat /CUDA_VERSION | awk -F. '{print $1$2}')

0 commit comments

Comments
 (0)