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 1
1
# syntax=docker/dockerfile:1
2
2
ARG PYTHON_VERSION=3.8
3
+ FROM python:$PYTHON_VERSION-slim AS base
4
+
3
5
ARG CUDA_VERSION=11.8
4
6
ARG CUDNN_VERSION=8.9.4.25
5
7
ARG 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
+
10
9
# Install wget.
11
10
RUN apt-get update && \
12
11
apt-get install --yes wget && \
@@ -22,14 +21,20 @@ ENV PATH=/opt/conda/bin:$PATH
22
21
# Install CUDA.
23
22
RUN conda install --channel nvidia --yes cuda-runtime="$CUDA_VERSION"
24
23
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 && \
27
33
dpkg -i cuda-keyring_1.1-1_all.deb && \
28
34
rm cuda-keyring_1.1-1_all.deb && \
29
35
apt-get update && \
30
36
apt-get install --yes \
31
37
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 && \
33
39
apt-get clean && \
34
40
rm -rf /var/lib/apt/lists/*
35
-
You can’t perform that action at this time.
0 commit comments