1
1
# Base image starts with CUDA
2
- ARG BASE_IMG=nvidia/cuda:11.7.1-devel-ubuntu18 .04
2
+ ARG BASE_IMG=nvidia/cuda:11.7.1-devel-ubuntu20 .04
3
3
FROM ${BASE_IMG} as base
4
4
5
5
# Install basic dependencies
6
6
RUN apt-get update
7
- RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git
7
+ RUN DEBIAN_FRONTEND=noninteractive apt install -y build-essential manpages-dev wget zlib1g software-properties-common git
8
8
RUN add-apt-repository ppa:deadsnakes/ppa
9
9
RUN apt install -y python3.8 python3.8-distutils python3.8-dev
10
10
RUN wget https://bootstrap.pypa.io/get-pip.py
@@ -16,17 +16,17 @@ RUN pip3 install wheel
16
16
RUN pip3 install torch==2.0.0.dev20230103+cu117 torchvision==0.15.0.dev20230103+cu117 --extra-index-url https://download.pytorch.org/whl/nightly/cu117
17
17
18
18
# Install CUDNN + TensorRT
19
- RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/cuda-ubuntu1804 .pin
20
- RUN mv cuda-ubuntu1804 .pin /etc/apt/preferences.d/cuda-repository-pin-600
21
- RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/7fa2af80.pub
19
+ RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/cuda-ubuntu2004 .pin
20
+ RUN mv cuda-ubuntu2004 .pin /etc/apt/preferences.d/cuda-repository-pin-600
21
+ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/7fa2af80.pub
22
22
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
23
23
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
24
- RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/ /"
24
+ RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/ /"
25
25
RUN apt-get update
26
26
RUN apt-get install -y libcudnn8=8.5.0* libcudnn8-dev=8.5.0*
27
27
28
- RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/3bf863cc.pub
29
- RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/ /"
28
+ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/3bf863cc.pub
29
+ RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/ /"
30
30
RUN apt-get update
31
31
32
32
RUN apt-get install -y libnvinfer8=8.5.1* libnvinfer-plugin8=8.5.1* libnvinfer-dev=8.5.1* libnvinfer-plugin-dev=8.5.1* libnvonnxparsers8=8.5.1-1* libnvonnxparsers-dev=8.5.1-1* libnvparsers8=8.5.1-1* libnvparsers-dev=8.5.1-1*
@@ -36,17 +36,14 @@ ARG BAZEL_VERSION=5.2.0
36
36
RUN wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64 -O /usr/bin/bazel \
37
37
&& chmod a+x /usr/bin/bazel
38
38
39
- # Remove cuda symlink to avoid bazel circle symlink errors
40
- RUN rm /usr/local/cuda-11.7/cuda-11.7
41
-
42
39
# Build Torch-TensorRT in an auxillary container
43
40
FROM base as torch-tensorrt-builder-base
44
41
45
42
ARG ARCH="x86_64"
46
43
ARG TARGETARCH="amd64"
47
44
48
45
RUN apt-get install -y python3-setuptools
49
- RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804 /x86_64/3bf863cc.pub
46
+ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004 /x86_64/3bf863cc.pub
50
47
RUN apt-get update
51
48
52
49
RUN apt-get update && apt-get install -y --no-install-recommends locales ninja-build && rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8
@@ -76,4 +73,4 @@ WORKDIR /opt/torch_tensorrt
76
73
ENV LD_LIBRARY_PATH /usr/local/lib/python3.8/dist-packages/torch/lib:/usr/local/lib/python3.8/dist-packages/torch_tensorrt/lib:/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH}
77
74
ENV PATH /usr/local/lib/python3.8/dist-packages/torch_tensorrt/bin:${PATH}
78
75
79
- CMD /bin/bash
76
+ CMD /bin/bash
0 commit comments