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
0 commit comments