Skip to content

Commit 68d58fb

Browse files
authored
Merge pull request Kaggle#517 from Kaggle/upgrade-tf-cuda-ci
Upgrade to cuda 10.0 and Tensorflow 1.13
2 parents e17e8a0 + 0411f8f commit 68d58fb

File tree

4 files changed

+35
-33
lines changed

4 files changed

+35
-33
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BASE_TAG=5.2.0
22

3-
FROM gcr.io/kaggle-images/python-tensorflow-whl:1.12.0-py36 as tensorflow_whl
3+
FROM gcr.io/kaggle-images/python-tensorflow-whl:1.13.1-py36 as tensorflow_whl
44
FROM continuumio/anaconda3:${BASE_TAG}
55

66
ADD clean-layer.sh /tmp/clean-layer.sh
@@ -21,7 +21,7 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list &
2121
apt-get -y install cmake && \
2222
/tmp/clean-layer.sh
2323

24-
# Tensorflow doesn't support python 3.7 yet. See https://github.com/tensorflow/tensorflow/issues/20517
24+
# Tensorflow doesn't support python 3.7 yet. See https://github.com/tensorflow/tensorflow/issues/20517
2525
# Fix to install Tensorflow: Downgrade python 3.7->3.6.6.
2626
RUN conda install -y python=3.6.6 && \
2727
/tmp/clean-layer.sh

gpu.Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG BASE_TAG=staging
22

33
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04 AS nvidia
4-
FROM gcr.io/kaggle-images/python-tensorflow-whl:1.12.0-py36 as tensorflow_whl
4+
FROM gcr.io/kaggle-images/python-tensorflow-whl:1.13.1-py36 as tensorflow_whl
55
FROM gcr.io/kaggle-images/python:${BASE_TAG}
66

77
ADD clean-layer.sh /tmp/clean-layer.sh
@@ -13,8 +13,8 @@ COPY --from=nvidia /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/cuda.gpg
1313

1414
# Ensure the cuda libraries are compatible with the custom Tensorflow wheels.
1515
# TODO(b/120050292): Use templating to keep in sync or COPY installed binaries from it.
16-
ENV CUDA_VERSION=9.2.148
17-
ENV CUDA_PKG_VERSION=9-2=$CUDA_VERSION-1
16+
ENV CUDA_VERSION=10.0.130
17+
ENV CUDA_PKG_VERSION=10-0=$CUDA_VERSION-1
1818
LABEL com.nvidia.volumes.needed="nvidia_driver"
1919
LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
2020
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
@@ -26,7 +26,7 @@ ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
2626
ENV LD_LIBRARY_PATH="/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs"
2727
ENV NVIDIA_VISIBLE_DEVICES=all
2828
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
29-
ENV NVIDIA_REQUIRE_CUDA="cuda>=9.2"
29+
ENV NVIDIA_REQUIRE_CUDA="cuda>=10.0"
3030
RUN apt-get update && apt-get install -y --no-install-recommends \
3131
cuda-cupti-$CUDA_PKG_VERSION \
3232
cuda-cudart-$CUDA_PKG_VERSION \
@@ -36,11 +36,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3636
cuda-nvml-dev-$CUDA_PKG_VERSION \
3737
cuda-minimal-build-$CUDA_PKG_VERSION \
3838
cuda-command-line-tools-$CUDA_PKG_VERSION \
39-
libcudnn7=7.4.1.5-1+cuda9.2 \
40-
libcudnn7-dev=7.4.1.5-1+cuda9.2 \
41-
libnccl2=2.3.7-1+cuda9.2 \
42-
libnccl-dev=2.3.7-1+cuda9.2 && \
43-
ln -s /usr/local/cuda-9.2 /usr/local/cuda && \
39+
libcudnn7=7.4.2.24-1+cuda10.0 \
40+
libcudnn7-dev=7.4.2.24-1+cuda10.0 \
41+
libnccl2=2.4.2-1+cuda10.0 \
42+
libnccl-dev=2.4.2-1+cuda10.0 && \
43+
ln -s /usr/local/cuda-10.0 /usr/local/cuda && \
4444
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
4545
/tmp/clean-layer.sh
4646

@@ -51,15 +51,15 @@ RUN pip uninstall -y tensorflow && \
5151
pip install /tmp/tensorflow_gpu/tensorflow*.whl && \
5252
rm -rf /tmp/tensorflow_gpu && \
5353
conda uninstall -y pytorch-cpu torchvision-cpu && \
54-
conda install -y pytorch torchvision cudatoolkit=9.2 -c pytorch && \
54+
conda install -y pytorch torchvision cudatoolkit=10.0 -c pytorch && \
5555
pip uninstall -y mxnet && \
5656
# b/126259508 --no-deps prevents numpy from being downgraded.
57-
pip install --no-deps mxnet-cu92 && \
57+
pip install --no-deps mxnet-cu100 && \
5858
/tmp/clean-layer.sh
5959

6060
# Install GPU-only packages
6161
RUN pip install pycuda && \
62-
pip install cupy-cuda92 && \
62+
pip install cupy-cuda100 && \
6363
pip install pynvrtc && \
6464
/tmp/clean-layer.sh
6565

tensorflow-whl/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
1.11.0-py36: Tensorflow 1.11.0 wheels built with python 3.6
22
1.12.0-py36: Tensorflow 1.12.0 wheels with Cuda 9.2
3+
1.13.1-py36: Tensorflow 1.13.1 wheels with Cuda 10.0

tensorflow-whl/Dockerfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04 AS nvidia
1+
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 AS nvidia
22
FROM continuumio/anaconda3:5.2.0
33

44
# Avoid interactive configuration prompts/dialogs during apt-get.
@@ -15,8 +15,8 @@ COPY --from=nvidia /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/cuda.gpg
1515

1616
# Ensure the cuda libraries are compatible with the GPU image.
1717
# TODO(b/120050292): Use templating to keep in sync.
18-
ENV CUDA_VERSION=9.2.148
19-
ENV CUDA_PKG_VERSION=9-2=$CUDA_VERSION-1
18+
ENV CUDA_VERSION=10.0.130
19+
ENV CUDA_PKG_VERSION=10-0=$CUDA_VERSION-1
2020
LABEL com.nvidia.volumes.needed="nvidia_driver"
2121
LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
2222
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
@@ -28,7 +28,7 @@ ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
2828
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs"
2929
ENV NVIDIA_VISIBLE_DEVICES=all
3030
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
31-
ENV NVIDIA_REQUIRE_CUDA="cuda>=9.0"
31+
ENV NVIDIA_REQUIRE_CUDA="cuda>=10.0"
3232
RUN apt-get update && apt-get install -y --no-install-recommends \
3333
cuda-cupti-$CUDA_PKG_VERSION \
3434
cuda-cudart-$CUDA_PKG_VERSION \
@@ -38,18 +38,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3838
cuda-nvml-dev-$CUDA_PKG_VERSION \
3939
cuda-minimal-build-$CUDA_PKG_VERSION \
4040
cuda-command-line-tools-$CUDA_PKG_VERSION \
41-
libcudnn7=7.4.1.5-1+cuda9.2 \
42-
libcudnn7-dev=7.4.1.5-1+cuda9.2 \
43-
libnccl2=2.3.7-1+cuda9.2 \
44-
libnccl-dev=2.3.7-1+cuda9.2 && \
45-
ln -s /usr/local/cuda-9.2 /usr/local/cuda && \
46-
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 && \
47-
rm -rf /var/lib/apt/lists/*
41+
libcudnn7=7.5.0.56-1+cuda10.0 \
42+
libcudnn7-dev=7.5.0.56-1+cuda10.0 \
43+
libnccl2=2.4.2-1+cuda10.0 \
44+
libnccl-dev=2.4.2-1+cuda10.0 && \
45+
ln -s /usr/local/cuda-10.0 /usr/local/cuda && \
46+
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
4847

4948
# Install bazel
50-
# Tensorflow 1.11 requires the Bazel 0.15: https://www.tensorflow.org/install/source
51-
ENV BAZEL_VERSION=0.15.0
52-
RUN apt-get update && apt-get install -y gnupg zip && \
49+
# Tensorflow 1.13 requires the Bazel 0.19.2: https://www.tensorflow.org/install/source
50+
ENV BAZEL_VERSION=0.19.2
51+
RUN apt-get install -y gnupg zip && \
5352
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
5453
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
5554
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys --no-tty EEA14886 C857C906 2B90D010 && \
@@ -68,11 +67,13 @@ RUN apt-get update && apt-get install -y gnupg zip && \
6867
# Tensorflow doesn't support python 3.7 yet. See https://github.com/tensorflow/tensorflow/issues/20517
6968
RUN conda install -y python=3.6.6
7069

71-
# Fetch tensorflow
70+
# Fetch tensorflow & install dependencies.
7271
RUN cd /usr/local/src && \
7372
git clone https://github.com/tensorflow/tensorflow && \
7473
cd tensorflow && \
75-
git checkout r1.12
74+
git checkout r1.13 && \
75+
pip install keras_applications --no-deps && \
76+
pip install keras_preprocessing --no-deps
7677

7778
# Create a tensorflow wheel for CPU
7879
RUN cd /usr/local/src/tensorflow && \
@@ -83,9 +84,9 @@ RUN cd /usr/local/src/tensorflow && \
8384

8485
# Create a tensorflow wheel for GPU/cuda
8586
ENV TF_NEED_CUDA=1
86-
ENV TF_CUDA_VERSION=9.2
87-
# 3.7 is for the K80 and 6.0 is for the P100: https://developer.nvidia.com/cuda-gpus
88-
ENV TF_CUDA_COMPUTE_CAPABILITIES=3.7,6.0
87+
ENV TF_CUDA_VERSION=10.0
88+
# 3.7 is for the K80 and 6.0 is for the P100, 7.5 is for the T4: https://developer.nvidia.com/cuda-gpus
89+
ENV TF_CUDA_COMPUTE_CAPABILITIES=3.7,6.0,7.5
8990
ENV TF_CUDNN_VERSION=7
9091
ENV TF_NCCL_VERSION=2
9192
ENV NCCL_INSTALL_PATH=/usr/

0 commit comments

Comments
 (0)