Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 7a83d76

Browse files
author
Orti Bazar
authored
Add new docker file with updated ubuntu version (#538)
1 parent 039fa95 commit 7a83d76

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Ubuntu 20.04 Python3 with CUDA 11 and the following:
2+
# - Installs tf-nightly-gpu (this is TF 2.3)
3+
# - Installs requirements.txt for tensorflow/models
4+
5+
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 as base
6+
ARG tensorflow_pip_spec="tf-nightly"
7+
ARG local_tensorflow_pip_spec=""
8+
ARG extra_pip_specs=""
9+
ENV PIP_CMD="python3.9 -m pip"
10+
11+
# setup.py passes the base path of local .whl file is chosen for the docker image.
12+
# Otherwise passes an empty existing file from the context.
13+
COPY ${local_tensorflow_pip_spec} /${local_tensorflow_pip_spec}
14+
15+
# Pick up some TF dependencies
16+
# cublas-dev and libcudnn7-dev only needed because of libnvinfer-dev which may not
17+
# really be needed.
18+
# In the future, add the following lines in a shell script running on the
19+
# benchmark vm to get the available dependent versions when updating cuda
20+
# version (e.g to 10.2 or something later):
21+
# sudo apt-cache search cuda-command-line-tool
22+
# sudo apt-cache search cuda-cublas
23+
# sudo apt-cache search cuda-cufft
24+
# sudo apt-cache search cuda-curand
25+
# sudo apt-cache search cuda-cusolver
26+
# sudo apt-cache search cuda-cusparse
27+
28+
# Needed to disable prompts during installation.
29+
ENV DEBIAN_FRONTEND noninteractive
30+
31+
32+
RUN apt-get update && apt-get install -y --no-install-recommends \
33+
libfreetype6-dev \
34+
libhdf5-serial-dev \
35+
libzmq3-dev \
36+
libpng-dev \
37+
pkg-config \
38+
software-properties-common \
39+
unzip \
40+
lsb-core \
41+
curl
42+
43+
# Python 3.9 related deps in this ppa.
44+
RUN add-apt-repository ppa:deadsnakes/ppa
45+
46+
47+
# Install / update Python and Python3
48+
RUN apt-get install -y --no-install-recommends \
49+
python3.9 \
50+
python3-pip \
51+
python3.9-dev \
52+
python3-setuptools \
53+
python3.9-venv \
54+
python3.9-distutils \
55+
python3.9-lib2to3
56+
57+
# Upgrade pip, need to use pip3 and then pip after this or an error
58+
# is thrown for no main found.
59+
RUN ${PIP_CMD} install --upgrade pip
60+
RUN ${PIP_CMD} install --upgrade distlib
61+
# setuptools upgraded to fix install requirements from model garden.
62+
RUN ${PIP_CMD} install --upgrade setuptools
63+
64+
# For CUDA profiling, TensorFlow requires CUPTI.
65+
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.2/lib64:$LD_LIBRARY_PATH
66+
67+
# See http://bugs.python.org/issue19846
68+
ENV LANG C.UTF-8
69+
70+
# Add google-cloud-sdk to the source list
71+
# Note: use "cloud-sdk" instead of "cloud-sdk-$(lsb_release -c -s)" to resolve "'http://packages.cloud.google.com/apt cloud-sdk-focal Release' does not have a Release file
72+
RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
73+
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
74+
75+
# Install extras needed by most models
76+
RUN apt-get update && apt-get install -y --no-install-recommends \
77+
git \
78+
ca-certificates \
79+
wget \
80+
htop \
81+
zip \
82+
google-cloud-sdk
83+
84+
RUN ${PIP_CMD} install --upgrade pyyaml
85+
RUN ${PIP_CMD} install --upgrade google-api-python-client==1.8.0
86+
RUN ${PIP_CMD} install --upgrade google-cloud google-cloud-bigquery google-cloud-datastore mock
87+
88+
89+
RUN ${PIP_CMD} install wheel
90+
RUN ${PIP_CMD} install absl-py
91+
RUN ${PIP_CMD} install --upgrade --force-reinstall ${tensorflow_pip_spec} ${extra_pip_specs}
92+
93+
RUN ${PIP_CMD} install tfds-nightly
94+
RUN ${PIP_CMD} install -U scikit-learn
95+
96+
# Install dependnecies needed for tf.distribute test utils
97+
RUN ${PIP_CMD} install dill tblib portpicker
98+
99+
RUN curl https://raw.githubusercontent.com/tensorflow/models/master/official/nightly_requirements.txt > /tmp/requirements.txt
100+
RUN ${PIP_CMD} install -r /tmp/requirements.txt
101+
102+
RUN ${PIP_CMD} install tf-estimator-nightly
103+
RUN ${PIP_CMD} install tensorflow-text-nightly
104+
105+
# RUN nvidia-smi
106+
107+
RUN nvcc --version
108+
109+
110+
RUN pip freeze

0 commit comments

Comments
 (0)