STT-tensorflow/tensorflow/tools/ci_build/Dockerfile.cuda-clang
A. Unique TensorFlower ab81f099bf Add Dockerfile to build TensorFlow with cuda-clang.
Install a recent and well-tested clang release in our manylinux docker image,
and provide a example Dockerfile on how to use that image to build TensorFlow
with cuda-clang.

PiperOrigin-RevId: 276302595
Change-Id: I4513dfe580a808a9e44d58e7a2e021bbb7ca234b
2019-10-23 10:38:35 -07:00

34 lines
1.0 KiB
Docker

# Dockerfile to build a manylinux 2010 compliant TensorFlow pip package with
# cuda-clang.
#
# To build, first build the manylinux2010 toolchain docker image and tag it,
# then build the TensorFlow docker image using the tagged image as base.
#
# $ docker build -f Dockerfile.rbe.cuda10.0-cudnn7-ubuntu16.04-manylinux2010 \
# --tag "local-manylinux-toolchain" .
# $ docker build -f Dockerfile.cuda-clang .
FROM local-manylinux-toolchain
WORKDIR /
RUN git clone https://github.com/tensorflow/tensorflow
WORKDIR /tensorflow
ENV TF_NEED_GCP=1 \
TF_NEED_HDFS=1 \
TF_NEED_CUDA=1 \
TF_CUDA_CLANG=1 \
PATH=/dt7/usr/bin:$PATH \
PYTHON_BIN_PATH=/usr/bin/python3.6 \
CLANG_CUDA_COMPILER_PATH=/clang_${CLANG_VERSION}/bin/clang
ADD cuda-clang.patch cuda-clang.patch
RUN patch -p1 < cuda-clang.patch
RUN yes "" | ./configure
RUN bazel build --config=opt tensorflow/tools/pip_package:build_pip_package \
--nodistinct_host_configuration
RUN ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tf-wheel