Failure in installing TensorRT in Docker Image

Description

With a local TensorRT debian package, I get the “compressed data is corrupt” error during install (sometimes)

Environment

Trying to create a docker image with
TensorRT 5.1.5.0
Ubuntu 18.04
Docker 19.03
GPU Quadro M1200
Driver Version: 440.82

Relevant Files

nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb

Steps To Reproduce

Here is my Dockerfile:

FROM nvidia/cuda:10.2-base-ubuntu18.04

Update Ubuntu Software repository

RUN apt update

Disable Prompt During Packages Installation

ARG DEBIAN_FRONTEND=noninteractive

ARG TENSORRT=nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb
ARG TENSORRT_KEY=/var/nv-tensorrt-repo-cuda10.0-trt5.1.5.0-ga-20190427/7fa2af80.pub

WORKDIR /project

COPY $TENSORRT .

Rename the ML repo to something else so apt doesn’t see it

RUN apt clean
RUN mv /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/nvidia-ml.list.bkp &&
dpkg -i ./$TENSORRT &&
apt-key add $TENSORRT_KEY &&
apt-get update &&
apt-get install -y tensorrt

On the last step, I get the following errors. These do not occur always. Sometimes they work and sometimes they fail:

Step 10/14 : RUN mv /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/nvidia-ml.list.bkp && dpkg -i ./$TENSORRT && apt-key add $TENSORRT_KEY && apt-ge
t update && apt-get install -y tensorrt
—> Running in 5008442ed626
Selecting previously unselected package nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427.
(Reading database … 4714 files and directories currently installed.)
Preparing to unpack …/nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb …
Unpacking nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427 (1-1) …
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: subprocess returned error exit status 2
dpkg: error processing archive ./nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb (–install):
cannot copy extracted data for ‘./var/nv-tensorrt-repo-cuda10.0-trt5.1.5.0-ga-20190427/libcudnn7_7.5.0.56-1+cuda10.0_amd64.deb’ to ‘/var/nv-tensorrt-repo-cuda10.0-trt5.1.5.0-
ga-20190427/libcudnn7_7.5.0.56-1+cuda10.0_amd64.deb.dpkg-new’: unexpected end of file or stream
Errors were encountered while processing:
./nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb
The command ‘/bin/sh -c mv /etc/apt/sources.list.d/nvidia-ml.list /etc/apt/sources.list.d/nvidia-ml.list.bkp && dpkg -i ./$TENSORRT && apt-key add $TENSORRT_KEY &&
apt-get update && apt-get install -y tensorrt’ returned a non-zero code: 1

Thanks
Sanjeev

Hi @sjain1, Kindly do a fresh install using latest TRT version from the link below.

It is suggested to use use TRT NGC containers to avoid system level dependencies.

Thanks!

HI, @AakankshaS
I want to use the UFF tool to convert tensorflow model to uff model, would I use the NGC ?

hi, @AakankshaS
Because some reasons, I must to use this TRT in my local server only, don’t use docker, so any suggest?
Thanks!