-
-
Notifications
You must be signed in to change notification settings - Fork 230
/
Dockerfile.gpulibs
40 lines (31 loc) · 1.41 KB
/
Dockerfile.gpulibs
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
34
35
36
37
38
39
40
LABEL maintainer="Christoph Schranz <christoph.schranz@salzburgresearch.at>"
# Install Tensorflow, check compatibility here:
# https://www.tensorflow.org/install/source#gpu
# installation via conda leads to errors in version 4.8.2
RUN pip install --upgrade pip && \
pip install --no-cache-dir "tensorflow==2.3.2" && \
pip install --no-cache-dir keras
# Install PyTorch with dependencies
RUN conda install --quiet --yes \
pyyaml mkl mkl-include setuptools cmake cffi typing
# Check compatibility here:
# https://pytorch.org/get-started/locally/
# Installation via conda leads to errors installing cudatoolkit=10.1
RUN pip install torch torchvision torchaudio torchviz
# Clean installation
RUN conda clean --all -f -y && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
USER root
# Install nvtop to monitor the gpu tasks
RUN apt-get update && \
apt-get install -y cmake libncurses5-dev libncursesw5-dev git && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/Syllo/nvtop.git /run/nvtop && \
mkdir -p /run/nvtop/build && cd /run/nvtop/build && \
(cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True 2> /dev/null || echo "cmake was not successful") && \
(make 2> /dev/null || echo "make was not successful") && \
(make install 2> /dev/null || echo "make install was not successful") && \
cd /tmp && rm -rf /tmp/nvtop
RUN fix-permissions /home/$NB_USER
USER $NB_UID