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

new docker image cuda 12.1 ubuntu 22.04 #537

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions perfzero/docker/Dockerfile_ubuntu_2204_tf_cuda_12
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Ubuntu 22.04 Python3 with CUDA 12 and the following:
# - Installs tf-nightly (this is TF 2.14)
# - Installs requirements.txt for tensorflow/models

FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04 as base
ARG tensorflow_pip_spec="tf-nightly"
ARG local_tensorflow_pip_spec=""
ARG extra_pip_specs=""
ENV PIP_CMD="python3.10 -m pip"

# setup.py passes the base path of local .whl file is chosen for the docker image.
# Otherwise passes an empty existing file from the context.
COPY ${local_tensorflow_pip_spec} /${local_tensorflow_pip_spec}

# Pick up some TF dependencies
# cublas-dev and libcudnn7-dev only needed because of libnvinfer-dev which may not
# really be needed.
# In the future, add the following lines in a shell script running on the
# benchmark vm to get the available dependent versions when updating cuda
# version (e.g to 10.2 or something later):
# sudo apt-cache search cuda-command-line-tool
# sudo apt-cache search cuda-cublas
# sudo apt-cache search cuda-cufft
# sudo apt-cache search cuda-curand
# sudo apt-cache search cuda-cusolver
# sudo apt-cache search cuda-cusparse

# Needed to disable prompts during installation.
ENV DEBIAN_FRONTEND noninteractive


RUN apt-get -y update && apt-get install -y --no-install-recommends \
libfreetype6-dev \
libhdf5-serial-dev \
libzmq3-dev \
libpng-dev \
pkg-config \
software-properties-common \
unzip \
lsb-core \
curl \
vim

# Python 3.10 related deps in this ppa.
RUN add-apt-repository ppa:deadsnakes/ppa


# Install / update Python and Python3
RUN apt-get -y update && apt-get install -y --no-install-recommends \
python3.10 \
python3-pip \
python3.10-dev \
python3-setuptools \
python3.10-venv \
python3.10-distutils \
python3.10-lib2to3

# Upgrade pip, need to use pip3 and then pip after this or an error
# is thrown for no main found.
RUN ${PIP_CMD} install --upgrade pip
RUN ${PIP_CMD} install --upgrade distlib
# setuptools upgraded to fix install requirements from model garden.
RUN ${PIP_CMD} install --upgrade setuptools

# For CUDA profiling, TensorFlow requires CUPTI.
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH

# See http://bugs.python.org/issue19846
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

# Add google-cloud-sdk to the source list
RUN curl -sSL https://sdk.cloud.google.com | bash

ENV PATH $PATH:/root/google-cloud-sdk/bin
# Install extras needed by most models
RUN apt-get -y update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
wget \
htop \
zip

RUN ${PIP_CMD} install --upgrade pyyaml
RUN ${PIP_CMD} install --upgrade google-api-python-client==2.88.0
RUN ${PIP_CMD} install --upgrade google-cloud google-cloud-bigquery google-cloud-datastore mock


RUN ${PIP_CMD} install wheel
RUN ${PIP_CMD} install absl-py
RUN ${PIP_CMD} install --upgrade --force-reinstall ${tensorflow_pip_spec} ${extra_pip_specs}

RUN ${PIP_CMD} install tfds-nightly
RUN ${PIP_CMD} install -U scikit-learn

# Install dependnecies needed for tf.distribute test utils
RUN ${PIP_CMD} install dill tblib portpicker

RUN curl https://raw.githubusercontent.com/tensorflow/models/master/official/nightly_requirements.txt > /tmp/requirements.txt
RUN ${PIP_CMD} install -r /tmp/requirements.txt

RUN ${PIP_CMD} install tf-estimator-nightly
RUN ${PIP_CMD} install tensorflow-text-nightly

# RUN nvidia-smi

RUN nvcc --version


RUN pip freeze
20 changes: 10 additions & 10 deletions perfzero/dockertest/requirements_temp.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
six
google-api-python-client>=1.6.7
kaggle>=1.3.9
numpy>=1.15.4
google-api-python-client>=2.88.0
kaggle>=1.5.13
numpy>=1.24.3
oauth2client
pandas>=0.22.0
psutil>=5.4.3
py-cpuinfo>=3.3.0
scipy>=0.19.1
pandas>=2.0.2
psutil>=5.9.5
py-cpuinfo>=9.0.0
scipy>=1.10.1
tensorflow-hub>=0.6.0
tensorflow-model-optimization>=0.4.1
tensorflow-model-optimization>=0.7.5
tensorflow-datasets
tensorflow-addons
dataclasses;python_version<"3.7"
dataclasses;python_version<"3.12"
gin-config
tf_slim>=1.1.0
Cython
matplotlib
pyyaml>=5.1
pyyaml>=6.0
# CV related dependencies
opencv-python-headless
Pillow
Expand Down