From 57826bf39de534860fe7aa8316fccaecacd5aba0 Mon Sep 17 00:00:00 2001 From: Austin Anderson Date: Thu, 19 Dec 2019 12:44:39 -0800 Subject: [PATCH] Fix images and tests for Cuda 10.1 and TensorRT 6 This change makes the dockerfile build tests pass. They have been broken ever since CUDA 10.1, and I fixed them by removing dependency on the old ci_build configure scripts and by updating TensorRT to version 6. Unfortunately, TensorRT builds seem to be broken at head (see https://github.com/tensorflow/tensorflow/issues/35115), so I've had to disable TensorRT for the build tests. However, this should make the devel images able to build regularly again. --- .../dockerfiles/devel-cpu-jupyter.Dockerfile | 2 +- .../dockerfiles/devel-cpu.Dockerfile | 3 +- .../dockerfiles/devel-gpu-jupyter.Dockerfile | 20 ++++++----- .../dockerfiles/devel-gpu.Dockerfile | 20 ++++++----- .../devel-cpu-ppc64le-jupyter.Dockerfile | 2 +- .../ppc64le/devel-cpu-ppc64le.Dockerfile | 2 +- .../devel-gpu-ppc64le-jupyter.Dockerfile | 20 ++++++----- .../ppc64le/devel-gpu-ppc64le.Dockerfile | 20 ++++++----- .../ubuntu/devel-cpu.partial.Dockerfile | 2 +- .../ubuntu/devel-nvidia.partial.Dockerfile | 20 ++++++----- .../tools/dockerfiles/tests/build-cpu.sh | 35 ++++++++++--------- .../tools/dockerfiles/tests/build-gpu.sh | 34 ++++++++++-------- 12 files changed, 104 insertions(+), 76 deletions(-) diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile index 69301026861..874ea50313d 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ rsync \ software-properties-common \ - sudo \ + sudo \ unzip \ zip \ zlib1g-dev \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile index 25961432011..94320d83be3 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ rsync \ software-properties-common \ - sudo \ + sudo \ unzip \ zip \ zlib1g-dev \ @@ -109,3 +109,4 @@ RUN mkdir /bazel && \ rm -f /bazel/installer.sh COPY bashrc /etc/bash.bashrc +RUN chmod a+rwx /etc/bash.bashrc diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile index 1ba94edae90..106af73ccfc 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile @@ -22,22 +22,25 @@ ARG UBUNTU_VERSION=18.04 ARG ARCH= -ARG CUDA=10.0 +ARG CUDA=10.1 FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base # ARCH and CUDA are specified again because the FROM directive resets ARGs # (but their default value is retained if set previously) ARG ARCH ARG CUDA -ARG CUDNN=7.6.2.24-1 +ARG CUDNN=7.6.4.38-1 ARG CUDNN_MAJOR_VERSION=7 ARG LIB_DIR_PREFIX=x86_64 +ARG LIBNVINFER=6.0.1-1 +ARG LIBNVINFER_MAJOR_VERSION=6 # Needed for string substitution SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cuda-command-line-tools-${CUDA/./-} \ - cuda-cublas-dev-${CUDA/./-} \ + libcublas10 \ + libcublas-dev \ cuda-cudart-dev-${CUDA/./-} \ cuda-cufft-dev-${CUDA/./-} \ cuda-curand-dev-${CUDA/./-} \ @@ -61,18 +64,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ rm /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libcudnn_static_v7.a +# Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ - apt-get install -y --no-install-recommends libnvinfer5=5.1.5-1+cuda${CUDA} \ - libnvinfer-dev=5.1.5-1+cuda${CUDA} \ + apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; } # Configure the build for our CUDA configuration. -ENV CI_BUILD_PYTHON python -ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu:$LD_LIBRARY_PATH ENV TF_NEED_CUDA 1 ENV TF_NEED_TENSORRT 1 -ENV TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2,6.0,6.1,7.0 ENV TF_CUDA_VERSION=${CUDA} ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION} # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile index aaf119da580..6d52a75eb5c 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile @@ -22,22 +22,25 @@ ARG UBUNTU_VERSION=18.04 ARG ARCH= -ARG CUDA=10.0 +ARG CUDA=10.1 FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base # ARCH and CUDA are specified again because the FROM directive resets ARGs # (but their default value is retained if set previously) ARG ARCH ARG CUDA -ARG CUDNN=7.6.2.24-1 +ARG CUDNN=7.6.4.38-1 ARG CUDNN_MAJOR_VERSION=7 ARG LIB_DIR_PREFIX=x86_64 +ARG LIBNVINFER=6.0.1-1 +ARG LIBNVINFER_MAJOR_VERSION=6 # Needed for string substitution SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cuda-command-line-tools-${CUDA/./-} \ - cuda-cublas-dev-${CUDA/./-} \ + libcublas10 \ + libcublas-dev \ cuda-cudart-dev-${CUDA/./-} \ cuda-cufft-dev-${CUDA/./-} \ cuda-curand-dev-${CUDA/./-} \ @@ -61,18 +64,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ rm /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libcudnn_static_v7.a +# Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ - apt-get install -y --no-install-recommends libnvinfer5=5.1.5-1+cuda${CUDA} \ - libnvinfer-dev=5.1.5-1+cuda${CUDA} \ + apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; } # Configure the build for our CUDA configuration. -ENV CI_BUILD_PYTHON python -ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu:$LD_LIBRARY_PATH ENV TF_NEED_CUDA 1 ENV TF_NEED_TENSORRT 1 -ENV TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2,6.0,6.1,7.0 ENV TF_CUDA_VERSION=${CUDA} ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION} # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version diff --git a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le-jupyter.Dockerfile index b85f157e5e4..846a0eab053 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le-jupyter.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ rsync \ software-properties-common \ - sudo \ + sudo \ unzip \ zip \ zlib1g-dev \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le.Dockerfile index e33fa789edf..0bf4969c6b4 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-cpu-ppc64le.Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ rsync \ software-properties-common \ - sudo \ + sudo \ unzip \ zip \ zlib1g-dev \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le-jupyter.Dockerfile index 49110036a1a..376f56dd861 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le-jupyter.Dockerfile @@ -22,22 +22,25 @@ ARG UBUNTU_VERSION=18.04 ARG ARCH= -ARG CUDA=10.0 +ARG CUDA=10.1 FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base # ARCH and CUDA are specified again because the FROM directive resets ARGs # (but their default value is retained if set previously) ARG ARCH ARG CUDA -ARG CUDNN=7.6.2.24-1 +ARG CUDNN=7.6.4.38-1 ARG CUDNN_MAJOR_VERSION=7 ARG LIB_DIR_PREFIX=x86_64 +ARG LIBNVINFER=6.0.1-1 +ARG LIBNVINFER_MAJOR_VERSION=6 # Needed for string substitution SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cuda-command-line-tools-${CUDA/./-} \ - cuda-cublas-dev-${CUDA/./-} \ + libcublas10 \ + libcublas-dev \ cuda-cudart-dev-${CUDA/./-} \ cuda-cufft-dev-${CUDA/./-} \ cuda-curand-dev-${CUDA/./-} \ @@ -61,18 +64,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ rm /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libcudnn_static_v7.a +# Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ - apt-get install -y --no-install-recommends libnvinfer5=5.1.5-1+cuda${CUDA} \ - libnvinfer-dev=5.1.5-1+cuda${CUDA} \ + apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; } # Configure the build for our CUDA configuration. -ENV CI_BUILD_PYTHON python -ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu:$LD_LIBRARY_PATH ENV TF_NEED_CUDA 1 ENV TF_NEED_TENSORRT 1 -ENV TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2,6.0,6.1,7.0 ENV TF_CUDA_VERSION=${CUDA} ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION} # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version diff --git a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le.Dockerfile index 733404a5ce1..461748e2101 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/ppc64le/devel-gpu-ppc64le.Dockerfile @@ -22,22 +22,25 @@ ARG UBUNTU_VERSION=18.04 ARG ARCH= -ARG CUDA=10.0 +ARG CUDA=10.1 FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base # ARCH and CUDA are specified again because the FROM directive resets ARGs # (but their default value is retained if set previously) ARG ARCH ARG CUDA -ARG CUDNN=7.6.2.24-1 +ARG CUDNN=7.6.4.38-1 ARG CUDNN_MAJOR_VERSION=7 ARG LIB_DIR_PREFIX=x86_64 +ARG LIBNVINFER=6.0.1-1 +ARG LIBNVINFER_MAJOR_VERSION=6 # Needed for string substitution SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cuda-command-line-tools-${CUDA/./-} \ - cuda-cublas-dev-${CUDA/./-} \ + libcublas10 \ + libcublas-dev \ cuda-cudart-dev-${CUDA/./-} \ cuda-cufft-dev-${CUDA/./-} \ cuda-curand-dev-${CUDA/./-} \ @@ -61,18 +64,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ rm /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libcudnn_static_v7.a +# Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ - apt-get install -y --no-install-recommends libnvinfer5=5.1.5-1+cuda${CUDA} \ - libnvinfer-dev=5.1.5-1+cuda${CUDA} \ + apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; } # Configure the build for our CUDA configuration. -ENV CI_BUILD_PYTHON python -ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu:$LD_LIBRARY_PATH ENV TF_NEED_CUDA 1 ENV TF_NEED_TENSORRT 1 -ENV TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2,6.0,6.1,7.0 ENV TF_CUDA_VERSION=${CUDA} ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION} # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version diff --git a/tensorflow/tools/dockerfiles/partials/ubuntu/devel-cpu.partial.Dockerfile b/tensorflow/tools/dockerfiles/partials/ubuntu/devel-cpu.partial.Dockerfile index 8b4f1a756d0..5f6caa6e96c 100644 --- a/tensorflow/tools/dockerfiles/partials/ubuntu/devel-cpu.partial.Dockerfile +++ b/tensorflow/tools/dockerfiles/partials/ubuntu/devel-cpu.partial.Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pkg-config \ rsync \ software-properties-common \ - sudo \ + sudo \ unzip \ zip \ zlib1g-dev \ diff --git a/tensorflow/tools/dockerfiles/partials/ubuntu/devel-nvidia.partial.Dockerfile b/tensorflow/tools/dockerfiles/partials/ubuntu/devel-nvidia.partial.Dockerfile index 496b3ac9e49..6774b0c392a 100644 --- a/tensorflow/tools/dockerfiles/partials/ubuntu/devel-nvidia.partial.Dockerfile +++ b/tensorflow/tools/dockerfiles/partials/ubuntu/devel-nvidia.partial.Dockerfile @@ -1,20 +1,23 @@ ARG ARCH= -ARG CUDA=10.0 +ARG CUDA=10.1 FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base # ARCH and CUDA are specified again because the FROM directive resets ARGs # (but their default value is retained if set previously) ARG ARCH ARG CUDA -ARG CUDNN=7.6.2.24-1 +ARG CUDNN=7.6.4.38-1 ARG CUDNN_MAJOR_VERSION=7 ARG LIB_DIR_PREFIX=x86_64 +ARG LIBNVINFER=6.0.1-1 +ARG LIBNVINFER_MAJOR_VERSION=6 # Needed for string substitution SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cuda-command-line-tools-${CUDA/./-} \ - cuda-cublas-dev-${CUDA/./-} \ + libcublas10 \ + libcublas-dev \ cuda-cudart-dev-${CUDA/./-} \ cuda-cufft-dev-${CUDA/./-} \ cuda-curand-dev-${CUDA/./-} \ @@ -38,18 +41,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \ rm /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libcudnn_static_v7.a +# Install TensorRT if not building for PowerPC RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \ - apt-get install -y --no-install-recommends libnvinfer5=5.1.5-1+cuda${CUDA} \ - libnvinfer-dev=5.1.5-1+cuda${CUDA} \ + apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin-dev=${LIBNVINFER}+cuda${CUDA} \ + libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; } # Configure the build for our CUDA configuration. -ENV CI_BUILD_PYTHON python -ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/lib64/stubs:/usr/include/x64_64-linux-gnu:$LD_LIBRARY_PATH ENV TF_NEED_CUDA 1 ENV TF_NEED_TENSORRT 1 -ENV TF_CUDA_COMPUTE_CAPABILITIES=3.5,5.2,6.0,6.1,7.0 ENV TF_CUDA_VERSION=${CUDA} ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION} # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version diff --git a/tensorflow/tools/dockerfiles/tests/build-cpu.sh b/tensorflow/tools/dockerfiles/tests/build-cpu.sh index bcdc4c2139c..6b3c23fcbda 100755 --- a/tensorflow/tools/dockerfiles/tests/build-cpu.sh +++ b/tensorflow/tools/dockerfiles/tests/build-cpu.sh @@ -15,23 +15,24 @@ # limitations under the License. # ============================================================================ -# Download and build TensorFlow. -set -euxo pipefail -git clone --branch=master --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow +set -ex +git clone --branch=master --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow || true cd /tensorflow +ln -snf $(which ${PYTHON}) /usr/local/bin/python +# Run configure. +export TF_NEED_GCP=1 +export TF_NEED_HDFS=1 +export TF_NEED_S3=1 +export TF_NEED_CUDA=0 +# TensorRT build failing as of 2019-12-18, see +# https://github.com/tensorflow/tensorflow/issues/35115 +export CC_OPT_FLAGS='-mavx' +export PYTHON_BIN_PATH=$(which python3.7) +export TMP=/tmp +yes "" | /usr/local/bin/python configure.py -ln -s $(which ${PYTHON}) /usr/local/bin/python - -# For optimized builds appropriate for the hardware platform of your choosing, uncomment below... -# For ivy-bridge or sandy-bridge -# --copt=-march="ivybridge" \ -# for haswell, broadwell, or skylake -# --copt=-march="haswell" \ -tensorflow/tools/ci_build/builds/configured CPU \ - bazel build -c opt --copt=-mavx --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" \ - tensorflow/tools/pip_package:build_pip_package && \ - bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/pip && \ - pip --no-cache-dir install --upgrade /tmp/pip/tensorflow-*.whl && \ - rm -rf /tmp/pip && \ - rm -rf /root/.cache +# Build the pip package and import +bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --config=v2 tensorflow/tools/pip_package:build_pip_package +./bazel-bin/tensorflow/tools/pip_package/build_pip_package pip_pkg --gpu --nightly_flag +pip --no-cache-dir install --upgrade /tmp/pip/tensorflow-*.whl diff --git a/tensorflow/tools/dockerfiles/tests/build-gpu.sh b/tensorflow/tools/dockerfiles/tests/build-gpu.sh index 0e107e3f85b..2edef56363e 100755 --- a/tensorflow/tools/dockerfiles/tests/build-gpu.sh +++ b/tensorflow/tools/dockerfiles/tests/build-gpu.sh @@ -16,19 +16,25 @@ # ============================================================================ # Download and build TensorFlow. -set -euxo pipefail -git clone --branch=master --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow + +set -ex +git clone --branch=master --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow || true cd /tensorflow +ln -snf $(which ${PYTHON}) /usr/local/bin/python +# Run configure. +export TF_NEED_GCP=1 +export TF_NEED_HDFS=1 +export TF_NEED_S3=1 +export TF_NEED_CUDA=1 +# TensorRT build failing as of 2019-12-18, see +# https://github.com/tensorflow/tensorflow/issues/35115 +export TF_NEED_TENSORRT=0 +export CC_OPT_FLAGS='-mavx' +export PYTHON_BIN_PATH=$(which python3.7) +export TMP=/tmp +yes "" | /usr/local/bin/python configure.py -ln -s $(which ${PYTHON}) /usr/local/bin/python - -LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH} \ -tensorflow/tools/ci_build/builds/configured GPU \ -bazel build -c opt --copt=-mavx --config=cuda \ - --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" \ - tensorflow/tools/pip_package:build_pip_package && \ -rm /usr/local/cuda/lib64/stubs/libcuda.so.1 && \ -bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/pip && \ -pip --no-cache-dir install --upgrade /tmp/pip/tensorflow-*.whl && \ -rm -rf /tmp/pip && \ -rm -rf /root/.cache +# Build the pip package and import +bazel build --config=cuda --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --config=v2 tensorflow/tools/pip_package:build_pip_package +./bazel-bin/tensorflow/tools/pip_package/build_pip_package pip_pkg --gpu --nightly_flag +pip --no-cache-dir install --upgrade /tmp/pip/tensorflow-*.whl