Skip to content

Commit

Permalink
Merge pull request #2023 from rtg0795/r2.6
Browse files Browse the repository at this point in the history
Fix Docker Configs in r2.6 Release Branch
  • Loading branch information
netfs authored Jul 1, 2022
2 parents df85ef7 + d606dd0 commit 7a9209a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
34 changes: 17 additions & 17 deletions tensorflow_serving/tools/docker/Dockerfile.devel-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ ENV CUDNN_VERSION=8.1.0.77
ENV TF_TENSORRT_VERSION=7.2.2
ENV CUDA=11.2

RUN apt-get update && apt-get install -y --no-install-recommends \
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 \
Expand Down Expand Up @@ -59,26 +60,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \
zlib1g-dev \
python3-distutils \
python-distutils-extra \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
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

# NOTE: libnvinfer uses cuda11.1 versions
RUN apt-get update && \
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.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/*;
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 \
# 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 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*;

# Install python 3.7.
RUN add-apt-repository ppa:deadsnakes/ppa && \
Expand Down
25 changes: 16 additions & 9 deletions tensorflow_serving/tools/docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ ENV TF_TENSORRT_VERSION=7.2.2
ENV CUDA=11.2
ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH

RUN apt-get update && apt-get install -y --no-install-recommends \
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 \
Expand All @@ -41,16 +43,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libcusparse-11-2 \
libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA} \
libgomp1 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
build-essential \
curl \
libfreetype6-dev \
pkg-config \
software-properties-common \
unzip

# We don't install libnvinfer-dev since we don't need to build against TensorRT
RUN apt-get update && \
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/*;
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 clean && \
rm -rf /var/lib/apt/lists/*;

# Install TF Serving GPU pkg
COPY --from=build_image /usr/local/bin/tensorflow_model_server /usr/bin/tensorflow_model_server
Expand Down

0 comments on commit 7a9209a

Please sign in to comment.