• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# To push a new version, run:
2# $ docker build -f Dockerfile.rbe.cuda9.0-cudnn7-ubuntu14.04 \
3#       --tag "gcr.io/tensorflow-testing/nosla-cuda9.0-cudnn7-ubuntu14.04" .
4# $ docker push gcr.io/tensorflow-testing/nosla-cuda9.0-cudnn7-ubuntu14.04
5#
6# TODO(klimek): Include clang in this image so we can also target clang
7# builds.
8
9FROM gcr.io/clang-docker-builder/clang-ubuntu14_04
10LABEL maintainer="Manuel Klimek <klimek@google.com>"
11
12RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates apt-transport-https gnupg-curl && \
13    rm -rf /var/lib/apt/lists/* && \
14    NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
15    NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \
16    apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub && \
17    apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +2 > cudasign.pub && \
18    echo "$NVIDIA_GPGKEY_SUM  cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \
19    echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
20    echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
21
22ENV CUDA_VERSION 9.0.176
23ENV CUDA_PKG_VERSION 9-0=$CUDA_VERSION-1
24ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
25ENV NVIDIA_VISIBLE_DEVICES all
26ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
27ENV NVIDIA_REQUIRE_CUDA "cuda>=9.0"
28ENV TENSORRT_VERSION 5.0.2
29ENV CUDNN_VERSION 7.1.4.18
30
31# TODO(b/110903506): /usr/loca/cuda/lib64/stubs should not be needed in
32# LD_LIBRARY_PATH. The stubs/libcuda.so is not meant to used at runtime. The
33# correct way to pass the path to bfd-ld is to pass
34# -Wl,-rpath-link=/usr/local/cuda/lib64/stubs to all binaries transitively
35# depending on libcuda. Optimally, builds targeting cuda would do that
36# internally.
37ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64/stubs
38
39LABEL com.nvidia.volumes.needed="nvidia_driver"
40LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
41LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
42
43RUN apt-get update && apt-get install -y --no-install-recommends \
44        cuda-cudart-$CUDA_PKG_VERSION \
45        cuda-libraries-$CUDA_PKG_VERSION \
46        cuda-cublas-9-0=9.0.176.4-1 \
47        cuda-libraries-dev-$CUDA_PKG_VERSION \
48        cuda-nvml-dev-$CUDA_PKG_VERSION \
49        cuda-minimal-build-$CUDA_PKG_VERSION \
50        cuda-command-line-tools-$CUDA_PKG_VERSION \
51        cuda-core-9-0=9.0.176.3-1 \
52        cuda-cublas-dev-9-0=9.0.176.4-1 \
53        libcudnn7-dev=$CUDNN_VERSION-1+cuda9.0 \
54        libcudnn7=$CUDNN_VERSION-1+cuda9.0 \
55        nvinfer-runtime-trt-repo-ubuntu1604-$TENSORRT_VERSION-ga-cuda9.0 && \
56    apt-get update && apt-get install -y --no-install-recommends \
57        libnvinfer5=$TENSORRT_VERSION-1+cuda9.0 \
58        libnvinfer-dev=$TENSORRT_VERSION-1+cuda9.0 && \
59    ln -s cuda-9.0 /usr/local/cuda && \
60    apt-mark hold libcudnn7 libcudnn7-dev && \
61    rm -rf /var/lib/apt/lists/*
62
63RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
64    echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
65
66# TODO(b/110903506): Provide a link to the SONAME of libcuda.so.
67# https://github.com/NVIDIA/nvidia-docker/issues/775
68RUN ln -s libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
69
70# Install a newer version of libstdc++, as new clang versions do not work
71# with the stock ubuntu 14.04 libstdc++.
72RUN apt-get update && \
73    apt-get install -y software-properties-common && \
74    add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
75    apt-get update && \
76    apt-get install -y libstdc++-7-dev && \
77    rm -rf /var/lib/apt/lists/*
78
79# Copy and run the install scripts.
80COPY install/*.sh /install/
81ARG DEBIAN_FRONTEND=noninteractive
82RUN /install/install_bootstrap_deb_packages.sh
83RUN add-apt-repository -y ppa:openjdk-r/ppa && \
84    add-apt-repository -y ppa:george-edison55/cmake-3.x
85RUN /install/install_deb_packages.sh
86RUN /install/install_pip_packages.sh
87RUN /install/install_golang.sh
88
89