diff --git a/components/cuda/docker-compose.cuda.yml b/components/cuda/docker-compose.cuda.yml index 66445f12437c..6c1076bd83dc 100644 --- a/components/cuda/docker-compose.cuda.yml +++ b/components/cuda/docker-compose.cuda.yml @@ -15,4 +15,4 @@ services: environment: NVIDIA_VISIBLE_DEVICES: all NVIDIA_DRIVER_CAPABILITIES: compute,utility - NVIDIA_REQUIRE_CUDA: "cuda>=9.0" + NVIDIA_REQUIRE_CUDA: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411" diff --git a/components/cuda/install.sh b/components/cuda/install.sh index 2cda99fcb769..a56bf9648493 100755 --- a/components/cuda/install.sh +++ b/components/cuda/install.sh @@ -1,37 +1,43 @@ -#!/bin/bash +#!/usr/bin/env bash # -# Copyright (C) 2018 Intel Corporation +# cuda 10.0 base - https://gitlab.com/nvidia/cuda/blob/ubuntu16.04/10.0/base/Dockerfile +# cuda 10.0 runtime - https://gitlab.com/nvidia/cuda/blob/ubuntu16.04/10.0/runtime/Dockerfile +# cudnn7 - https://gitlab.com/nvidia/cuda/blob/ubuntu16.04/10.0/runtime/cudnn7/Dockerfile # -# SPDX-License-Identifier: MIT # set -e -NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \ -NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \ -apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub && \ -apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +5 > cudasign.pub && \ -echo "$NVIDIA_GPGKEY_SUM cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \ -echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \ -echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list +apt-get update && apt-get install -y --no-install-recommends ca-certificates apt-transport-https gnupg-curl && \ + rm -rf /var/lib/apt/lists/* && \ + NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \ + NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \ + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub && \ + apt-key adv --export --no-emit-version -a ${NVIDIA_GPGKEY_FPR} | tail -n +5 > cudasign.pub && \ + echo "${NVIDIA_GPGKEY_SUM} cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \ + echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \ + echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list -CUDA_VERSION=9.0.176 -NCCL_VERSION=2.1.15 -CUDNN_VERSION=7.6.2.24 -CUDA_PKG_VERSION="9-0=${CUDA_VERSION}-1" +CUDA_VERSION=10.0.130 +NCCL_VERSION=2.4.2 +CUDNN_VERSION=7.6.0.64 +CUDA_PKG_VERSION="10-0=${CUDA_VERSION}-1" +echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf +echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf echo 'export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}' >> ${HOME}/.bashrc echo 'export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}' >> ${HOME}/.bashrc -apt-get update && apt-get install -y --no-install-recommends --allow-unauthenticated \ - libprotobuf-dev \ - libprotoc-dev \ - protobuf-compiler \ - cuda-cudart-$CUDA_PKG_VERSION \ - cuda-libraries-$CUDA_PKG_VERSION \ - libnccl2=$NCCL_VERSION-1+cuda9.0 \ - libcudnn7=$CUDNN_VERSION-1+cuda9.0 && \ - ln -s cuda-9.0 /usr/local/cuda && \ -rm -rf /var/lib/apt/lists/* \ - /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/cuda.list +# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a +apt-get update && apt-get install -y --no-install-recommends \ + cuda-cudart-${CUDA_PKG_VERSION} \ + cuda-compat-10-0 \ + cuda-libraries-${CUDA_PKG_VERSION} \ + cuda-nvtx-${CUDA_PKG_VERSION} \ + libnccl2=${NCCL_VERSION}-1+cuda10.0 \ + libcudnn7=${CUDNN_VERSION}-1+cuda10.0 && \ + apt-mark hold libnccl2 libcudnn7 && \ + ln -s cuda-10.0 /usr/local/cuda && \ + rm -rf /var/lib/apt/lists/* \ + /etc/apt/sources.list.d/cuda.list /etc/apt/sources.list.d/nvidia-ml.list pip3 uninstall -y tensorflow -pip3 install --no-cache-dir tensorflow-gpu==1.12.3 +pip3 install --no-cache-dir tensorflow-gpu==1.14.0