Skip to content

Commit

Permalink
Add docker file for custom op for cuda10.1 (release 2.1+).
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 285871263
Change-Id: I10b5eacb8861ffc07384ea76e4e4597283f69fcb
  • Loading branch information
yifeif authored and tensorflower-gardener committed Dec 17, 2019
1 parent d7fac80 commit b125fe2
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
77 changes: 77 additions & 0 deletions tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.1
@@ -0,0 +1,77 @@
# Dockerfile for Ubuntu 16.04 manylinux2010 custom ops with GPU.

FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 as devtoolset

LABEL maintainer="Amit Patankar <amitpatankar@google.com>"

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
cpio \
file \
flex \
g++ \
make \
rpm2cpio \
unar \
wget \
&& \
rm -rf /var/lib/apt/lists/*

ADD devtoolset/fixlinks.sh fixlinks.sh
ADD devtoolset/build_devtoolset.sh build_devtoolset.sh
ADD devtoolset/rpm-patch.sh rpm-patch.sh

# Set up a sysroot for glibc 2.12 / libstdc++ 4.4 / devtoolset-7 in /dt7.
RUN /build_devtoolset.sh devtoolset-7 /dt7
# Set up a sysroot for glibc 2.12 / libstdc++ 4.4 / devtoolset-8 in /dt8.
RUN /build_devtoolset.sh devtoolset-8 /dt8

# TODO(klimek): Split up into two different docker images.
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04

LABEL maintainer="Amit Patankar <amitpatankar@google.com>"

COPY --from=devtoolset /dt7 /dt7
COPY --from=devtoolset /dt8 /dt8

# Install TensorRT.
RUN apt-get update && apt-get install -y \
libnvinfer-dev=6.0.1-1+cuda10.1 \
libnvinfer6=6.0.1-1+cuda10.1 \
libnvinfer-plugin-dev=6.0.1-1+cuda10.1 \
libnvinfer-plugin6=6.0.1-1+cuda10.1 \
&& \
rm -rf /var/lib/apt/lists/*

# Copy and run the install scripts.
COPY install/*.sh /install/
ARG DEBIAN_FRONTEND=noninteractive
RUN /install/install_bootstrap_deb_packages.sh
RUN /install/install_deb_packages.sh
RUN /install/install_clang.sh
RUN /install/install_bazel.sh
RUN /install/install_buildifier.sh

ENV TF_NEED_CUDA=1

# Install python 3.6.
RUN add-apt-repository ppa:jonathonf/python-3.6 && \
apt-get update && apt-get install -y \
python3.6 python3.6-dev python3-pip python3.6-venv && \
rm -rf /var/lib/apt/lists/* && \
python3.6 -m pip install pip --upgrade && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 0

# Install python 3.7
RUN /install/install_python37.sh

# Install pip3.5
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.5 get-pip.py && rm get-pip.py

RUN /install/install_pip_packages.sh
RUN /install/install_auditwheel.sh

# TODO(klimek): Figure out a better way to get the right include paths
# forwarded when we install new packages.
RUN ln -s "/usr/include/x86_64-linux-gnu/python3.6m" "/dt7/usr/include/x86_64-linux-gnu/python3.6m"
RUN ln -s "/usr/include/x86_64-linux-gnu/python3.6m" "/dt8/usr/include/x86_64-linux-gnu/python3.6m"
Expand Up @@ -17,17 +17,20 @@ set -e

# 1. Build the test server
UBUNTU16_CPU_IMAGE="tensorflow/tensorflow:nightly-custom-op-ubuntu16"
UBUNTU16_GPU_CUDA10P0_IMAGE="tensorflow/tensorflow:nightly-custom-op-gpu-ubuntu16-cuda10.0"
UBUNTU16_GPU_IMAGE="tensorflow/tensorflow:nightly-custom-op-gpu-ubuntu16"

# Build the docker image
cd tensorflow/tools/ci_build
docker build --no-cache -t "${UBUNTU16_CPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16 .
docker build --no-cache -t "${UBUNTU16_GPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_gpu .
docker build --no-cache -t "${UBUNTU16_GPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.1 .
docker build --no-cache -t "${UBUNTU16_GPU_CUDA10P0_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.0 .

# Log into docker hub, push the image and log out
docker login -u "${TF_DOCKER_USERNAME}" -p "${TF_DOCKER_PASSWORD}"

docker push "${UBUNTU16_CPU_IMAGE}"
docker push "${UBUNTU16_GPU_IMAGE}"
docker push "${UBUNTU16_GPU_CUDA10P0_IMAGE}"

docker logout#!/bin/bash

0 comments on commit b125fe2

Please sign in to comment.