/
DockerfileGPU
33 lines (26 loc) · 1 KB
/
DockerfileGPU
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
# Set the current timezone
ENV TZ=America/Toronto \
FORCE_CUDA="1" \
TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX" \
TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install python and dependencies
RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository -y ppa:deadsnakes/ppa && apt-get update
RUN apt-get install -y git ninja-build nvidia-cuda-toolkit libjpeg-dev zlib1g-dev libopenblas-dev
RUN apt-get install -y python3 python3-dev python3-venv python3-pip
RUN apt-get update && apt-get install -y \
git \
bash-completion \
htop \
tmux \
neovim
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
WORKDIR /code
# Mamba compilation
RUN pip3 install packaging torch torchvision
COPY requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
ENV PYTHONPATH=/code:$PYTHONPATH
CMD ["bash"]