File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
22ARG PYTHON_VERSION=3.8
3+ FROM python:$PYTHON_VERSION-slim AS base
4+
35ARG CUDA_VERSION=11.8
46ARG CUDNN_VERSION=8.9.4.25
57ARG TENSORRT_VERSION=8.6.1.6
6- FROM python:$PYTHON_VERSION-slim AS base
7- ENV CUDA_VERSION=11.8
8- ENV CUDNN_VERSION=8.9.4.25
9- ENV TENSORRT_VERSION=8.6.1.6
8+
109# Install wget.
1110RUN apt-get update && \
1211 apt-get install --yes wget && \
@@ -22,14 +21,20 @@ ENV PATH=/opt/conda/bin:$PATH
2221# Install CUDA.
2322RUN conda install --channel nvidia --yes cuda-runtime="$CUDA_VERSION"
2423
25- # Install cuDNN and TensorRT.
26- RUN wget --quiet https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.1-1_all.deb && \
24+ # Cuda version compatible with tensorRT version
25+ RUN if [ "$CUDA_VERSION" = "12.2" ]; then \
26+ export CUDA_TENSORRT_VERSION=12.0; \
27+ else \
28+ export CUDA_TENSORRT_VERSION=$CUDA_VERSION; \
29+ fi \
30+ && \
31+ # Now use $CUDA_TENSORRT_VERSION in the same RUN command
32+ wget --quiet https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb && \
2733 dpkg -i cuda-keyring_1.1-1_all.deb && \
2834 rm cuda-keyring_1.1-1_all.deb && \
2935 apt-get update && \
3036 apt-get install --yes \
3137 libcudnn8=$CUDNN_VERSION-1+cuda$CUDA_VERSION \
32- libnvinfer-lean8=$TENSORRT_VERSION-1+cuda$CUDA_VERSION && \
38+ libnvinfer-lean8=$TENSORRT_VERSION-1+cuda$CUDA_TENSORRT_VERSION && \
3339 apt-get clean && \
3440 rm -rf /var/lib/apt/lists/*
35-
You can’t perform that action at this time.
0 commit comments