Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cuda #2075

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions tensorflow_serving/tools/docker/Dockerfile.devel-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM nvidia/cuda:11.2.1-base-ubuntu18.04 as base_build
FROM nvidia/cuda:11.8.0-base-ubuntu18.04 as base_build

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
Expand All @@ -20,26 +20,28 @@ LABEL [email protected]
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}

ENV CUDNN_VERSION=8.1.0.77
ENV TF_TENSORRT_VERSION=7.2.2
ENV CUDA=11.2
ENV CUDA=11.8
# CUDA_FOR_PKGNAME is expected to be same as CUDA with hypens instead of dots.
ENV CUDA_FOR_PKGNAME=11-8
ENV CUDNN_VERSION=8.6.0.163
ENV TF_TENSORRT_VERSION=7.2.3

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-get update && apt-get install -y --no-install-recommends \
automake \
build-essential \
ca-certificates \
cuda-command-line-tools-11-2 \
libcublas-11-2 \
libcublas-dev-11-2 \
cuda-nvrtc-11-2 \
cuda-nvrtc-dev-11-2 \
cuda-nvprune-11-2 \
cuda-cudart-dev-11-2 \
libcufft-dev-11-2 \
libcurand-dev-11-2 \
libcusolver-dev-11-2 \
libcusparse-dev-11-2 \
cuda-command-line-tools-${CUDA_FOR_PKGNAME} \
libcublas-${CUDA_FOR_PKGNAME} \
libcublas-dev-${CUDA_FOR_PKGNAME} \
cuda-nvrtc-${CUDA_FOR_PKGNAME} \
cuda-nvrtc-dev-${CUDA_FOR_PKGNAME} \
cuda-nvprune-${CUDA_FOR_PKGNAME} \
cuda-cudart-dev-${CUDA_FOR_PKGNAME} \
libcufft-dev-${CUDA_FOR_PKGNAME} \
libcurand-dev-${CUDA_FOR_PKGNAME} \
libcusolver-dev-${CUDA_FOR_PKGNAME} \
libcusparse-dev-${CUDA_FOR_PKGNAME} \
curl \
git \
libfreetype6-dev \
Expand All @@ -61,22 +63,22 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
zlib1g-dev \
python3-distutils \
python-distutils-extra && \
find /usr/local/cuda-11.2/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \
rm /usr/lib/x86_64-linux-gnu/libcudnn_static_v8.a
find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete && \
rm -f /usr/lib/x86_64-linux-gnu/libcudnn_static_v*.a

# NOTE: libnvinfer uses cuda11.1 versions
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub && \
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
apt-get update && \
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvinfer-dev=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvinfer-plugin-dev=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvinfer-dev=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvinfer-plugin-dev=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.1 \
# TODO: need to verify
libnvonnxparsers7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvparsers7=${TF_TENSORRT_VERSION}-1+cuda11.0\
libnvonnxparsers-dev=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvparsers-dev=${TF_TENSORRT_VERSION}-1+cuda11.0 && \
libnvonnxparsers7=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvparsers7=${TF_TENSORRT_VERSION}-1+cuda11.1\
libnvonnxparsers-dev=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvparsers-dev=${TF_TENSORRT_VERSION}-1+cuda11.1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*;

Expand Down Expand Up @@ -126,15 +128,15 @@ ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/us
ENV TF_NEED_CUDA 1
ENV TF_NEED_TENSORRT 1
ENV TENSORRT_INSTALL_PATH=/usr/lib/x86_64-linux-gnu
ENV TF_CUDA_VERSION=11.2
ENV TF_CUDA_VERSION=11
ENV TF_CUDNN_VERSION=8

# Fix paths so that CUDNN can be found: https://github.com/tensorflow/tensorflow/issues/8264
WORKDIR /
RUN mkdir /usr/lib/x86_64-linux-gnu/include/ && \
ln -s /usr/include/cudnn.h /usr/local/cuda/include/cudnn.h && \
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/local/cuda/lib64/libcudnn.so && \
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.${TF_CUDNN_VERSION} /usr/local/cuda/lib64/libcudnn.so.${TF_CUDNN_VERSION}
#RUN mkdir /usr/lib/x86_64-linux-gnu/include/ && \
# ln -s /usr/include/cudnn.h /usr/local/cuda/include/cudnn.h && \
# ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so /usr/local/cuda/lib64/libcudnn.so && \
# ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.${TF_CUDNN_VERSION} /usr/local/cuda/lib64/libcudnn.so.${TF_CUDNN_VERSION}

# For backward compatibility we need this line. After 1.13 we can safely remove
# it.
Expand Down
30 changes: 16 additions & 14 deletions tensorflow_serving/tools/docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG TF_SERVING_VERSION=latest
ARG TF_SERVING_BUILD_IMAGE=tensorflow/serving:${TF_SERVING_VERSION}-devel-gpu

FROM ${TF_SERVING_BUILD_IMAGE} as build_image
FROM nvidia/cuda:11.2.1-base-ubuntu18.04
FROM nvidia/cuda:11.8.0-base-ubuntu18.04

ARG TF_SERVING_VERSION_GIT_BRANCH=master
ARG TF_SERVING_VERSION_GIT_COMMIT=head
Expand All @@ -25,22 +25,24 @@ LABEL maintainer="[email protected]"
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}

ENV CUDNN_VERSION=8.1.0.77
ENV TF_TENSORRT_VERSION=7.2.2
ENV CUDA=11.2
ENV CUDA=11.8
# CUDA_FOR_PKGNAME is expected to be same as CUDA with hypens instead of dots.
ENV CUDA_FOR_PKGNAME=11-8
ENV CUDNN_VERSION=8.6.0.163
ENV TF_TENSORRT_VERSION=7.2.3
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH

RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cuda-command-line-tools-11-2 \
cuda-nvrtc-11-2 \
libcublas-11-2 \
libcublas-dev-11-2 \
libcufft-11-2 \
libcurand-11-2 \
libcusolver-11-2 \
libcusparse-11-2 \
cuda-command-line-tools-${CUDA_FOR_PKGNAME} \
cuda-nvrtc-${CUDA_FOR_PKGNAME} \
libcublas-${CUDA_FOR_PKGNAME} \
libcublas-dev-${CUDA_FOR_PKGNAME} \
libcufft-${CUDA_FOR_PKGNAME} \
libcurand-${CUDA_FOR_PKGNAME} \
libcusolver-${CUDA_FOR_PKGNAME} \
libcusparse-${CUDA_FOR_PKGNAME} \
libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA} \
libgomp1 \
build-essential \
Expand All @@ -54,8 +56,8 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub && \
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
apt-get update && \
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.0 \
apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.1 \
libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.1 \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*;

Expand Down