Skip to content

Commit

Permalink
TensorRT Open Source Release v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeevsrao committed Dec 18, 2019
1 parent daacf15 commit 572d54f
Show file tree
Hide file tree
Showing 68 changed files with 3,558 additions and 1,039 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
docker/jetpack_files/*
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "parsers/onnx"]
path = parsers/onnx
url = https://github.com/onnx/onnx-tensorrt.git
branch = master
branch = 7.0
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf.git
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ endif()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -Wno-deprecated-declarations")

################################### DEPENDENCIES ##########################################
set(DEFAULT_CUDA_VERSION 10.1)
set(DEFAULT_CUDNN_VERSION 7.5)
set(DEFAULT_CUDA_VERSION 10.2)
set(DEFAULT_CUDNN_VERSION 7.6)
set(DEFAULT_PROTOBUF_VERSION 3.0.0)
set(DEFAULT_PROTOBUF_INTERNAL_VERSION 10.0)
set(DEFAULT_CUB_VERSION 1.8.0)
Expand Down
87 changes: 52 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ To build the TensorRT OSS components, ensure you meet the following package requ

* [CUDA](https://developer.nvidia.com/cuda-toolkit)
* Recommended versions:
* [cuda-10.1](https://developer.nvidia.com/cuda-10.1-download-archive-base) + cuDNN-7.6
* [cuda-10.2](https://developer.nvidia.com/cuda-10.2-download-archive-base) + cuDNN-7.6
* [cuda-10.0](https://developer.nvidia.com/cuda-10.0-download-archive) + cuDNN-7.6
* [cuda-9.0](https://developer.nvidia.com/cuda-90-download-archive) + cuDNN 7.6

* [GNU Make](https://ftp.gnu.org/gnu/make/) >= v4.1

Expand All @@ -33,6 +32,9 @@ To build the TensorRT OSS components, ensure you meet the following package requ
* Essential libraries and utilities
* [Git](https://git-scm.com/downloads), [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/), [Wget](https://www.gnu.org/software/wget/faq.html#download), [Zlib](https://zlib.net/)

* Cross compilation for Jetson platforms requires JetPack's host component installation
* [JetPack](https://developer.nvidia.com/embedded/jetpack) >= 4.2

**Optional Packages**

* Containerized builds
Expand All @@ -45,11 +47,12 @@ To build the TensorRT OSS components, ensure you meet the following package requ

**TensorRT Release**

* [TensorRT](https://developer.nvidia.com/nvidia-tensorrt-download) v6.0.1
* [TensorRT](https://developer.nvidia.com/nvidia-tensorrt-download) v7.0


NOTE: Along with the TensorRT OSS components, the following source packages will also be downloaded, and they are not required to be installed on the system.

- [ONNX-TensorRT](https://github.com/onnx/onnx-tensorrt) v6.0
- [ONNX-TensorRT](https://github.com/onnx/onnx-tensorrt) v7.0
- [CUB](http://nvlabs.github.io/cub/) v1.8.0
- [Protobuf](https://github.com/protocolbuffers/protobuf.git) v3.8.x

Expand All @@ -59,38 +62,48 @@ NOTE: Along with the TensorRT OSS components, the following source packages will
1. #### Download TensorRT OSS sources.

```bash
git clone -b master https://github.com/nvidia/TensorRT TensorRT
git clone -b master https://github.com/nvidia/TensorRT TensorRT -b release/7.0
cd TensorRT
git submodule update --init --recursive
export TRT_SOURCE=`pwd`
```

2. #### Download the TensorRT binary release.

To build the TensorRT OSS, obtain the corresponding TensorRT 6.0.1 binary release from [NVidia Developer Zone](https://developer.nvidia.com/nvidia-tensorrt-download). For a list of key features, known and fixed issues, see the [TensorRT 6.0.1 Release Notes](https://docs.nvidia.com/deeplearning/sdk/tensorrt-release-notes/index.html).
To build the TensorRT OSS, obtain the corresponding TensorRT 7.0 binary release from [NVidia Developer Zone](https://developer.nvidia.com/nvidia-tensorrt-7x-download). For a list of key features, known and fixed issues, refer to the [TensorRT 7.0 Release Notes](https://docs.nvidia.com/deeplearning/sdk/tensorrt-release-notes/tensorrt-7.html#tensorrt-7).

**Example: Ubuntu 18.04 with cuda-10.1**
**Example: Ubuntu 18.04 with cuda-10.2**

Download and extract the *TensorRT 6.0.1.5 GA for Ubuntu 18.04 and CUDA 10.1 tar package*
Download and extract the latest *TensorRT 7.0 GA package for Ubuntu 18.04 and CUDA 10.2*
```bash
cd ~/Downloads
# Download TensorRT-6.0.1.5.Ubuntu-18.04.x86_64-gnu.cuda-10.1.cudnn7.6.tar.gz
tar -xvzf TensorRT-6.0.1.5.Ubuntu-18.04.x86_64-gnu.cuda-10.1.cudnn7.6.tar.gz
export TRT_RELEASE=`pwd`/TensorRT-6.0.1.5
# Download TensorRT-7.0.0.11.Ubuntu-18.04.x86_64-gnu.cuda-10.2.cudnn7.6.tar.gz
tar -xvzf TensorRT-7.0.0.11.Ubuntu-18.04.x86_64-gnu.cuda-10.2.cudnn7.6.tar.gz
export TRT_RELEASE=`pwd`/TensorRT-7.0.0.11
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRT_RELEASE/lib
```

**Example: CentOS/RedHat 7 with cuda-9.0**
**Example: CentOS/RedHat 7 with cuda-10.0**

Download and extract the *TensorRT 6.0.1.5 GA for CentOS/RedHat 7 and CUDA 9.0 tar package*
Download and extract the *TensorRT 7.0 GA for CentOS/RedHat 7 and CUDA 10.0 tar package*
```bash
cd ~/Downloads
# Download TensorRT-6.0.1.5.Red-Hat.x86_64-gnu.cuda-9.0.cudnn7.6.tar.gz
tar -xvzf TensorRT-6.0.1.5.Red-Hat.x86_64-gnu.cuda-9.0.cudnn7.6.tar.gz
export TRT_RELEASE=`pwd`/TensorRT-6.0.1.5
# Download TensorRT-7.0.0.11.CentOS-7.6.x86_64-gnu.cuda-10.0.cudnn7.6.tar.gz
tar -xvzf TensorRT-7.0.0.11.CentOS-7.6.x86_64-gnu.cuda-10.0.cudnn7.6.tar.gz
export TRT_RELEASE=`pwd`/TensorRT-7.0.0.11
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TRT_RELEASE/lib
```

3. #### Download JetPack packages for cross-compilation.[OPTIONAL]

Using the SDK manager, download the host componets of the PDK version or Jetpack specified in the name of the Dockerfile. To do this:

1. [**SDK Manager Step 01**] Log into the SDK manager
2. [**SDK Manager Step 01**] Select the correct platform and Target OS System (should be corresponding to the name of the Dockerfile you are building (e.g. Jetson AGX Xavier, `Linux Jetpack 4.2.1`), then click `Continue`
3. [**SDK Manager Step 02**] Under `Download & Install Options` make note of or change the download folder **and Select Download now. Install later.** then agree to the license terms and click `Continue`

You should now have all expected files to build the container. Move these into the `docker/jetpack_files` folder.

## Setting Up The Build Environment

* Install the *System Packages* list of components in the *Prerequisites* section.
Expand All @@ -99,24 +112,30 @@ NOTE: Along with the TensorRT OSS components, the following source packages will

1. #### Generate the TensorRT build container.

The docker container can be built using the included Dockerfile. The build container is configured with the environment and packages required for building TensorRT OSS.
The docker container can be built using the included Dockerfile. The build container is configured with the environment and packages required for building TensorRT OSS.

**Example: Ubuntu 18.04 with cuda-10.1**
**Example: Ubuntu 18.04 with cuda-10.2**

```bash
docker build -f docker/ubuntu-18.04.Dockerfile --build-arg CUDA_VERSION=10.1 --tag=tensorrt .
```
```bash
docker build -f docker/ubuntu.Dockerfile --build-arg UBUNTU_VERSION=18.04 --build-arg CUDA_VERSION=10.2 --tag=tensorrt-ubuntu .
```

**Example: CentOS/RedHat 7 with cuda-9.0**
**Example: CentOS/RedHat 7 with cuda-10.0**

```bash
docker build -f docker/centos-7.Dockerfile --build-arg CUDA_VERSION=9.0 --tag=tensorrt .
```
```bash
docker build -f docker/centos.Dockerfile --build-arg CENTOS_VERSION=7 --build-arg CUDA_VERSION=10.0 --tag=tensorrt-centos .
```

**Example: Cross compile for JetPack 4.2.1 with cuda-10.0**
```bash
docker build -f docker/ubuntu-cross-aarch64.Dockerfile --build-arg UBUNTU_VERSION=18.04 --build-arg CUDA_VERSION=10.0 --tag tensorrt-ubuntu-aarch64 .
`
```

2. #### Launch the TensorRT build container.

```bash
docker run -v $TRT_RELEASE:/tensorrt -v $TRT_SOURCE:/workspace/TensorRT -it tensorrt:latest
docker run -v $TRT_RELEASE:/tensorrt -v $TRT_SOURCE:/workspace/TensorRT -it tensorrt-ubuntu:latest
```

> NOTE: To run TensorRT/CUDA programs within the build container, install [nvidia-docker](#prerequisites). Replace the `docker run` command with `nvidia-docker run` or `docker run --runtime=nvidia`.
Expand All @@ -128,17 +147,15 @@ NOTE: Along with the TensorRT OSS components, the following source packages will

```bash
cd $TRT_SOURCE
mkdir -p build && cd build
mkdir -p build && cd build
cmake .. -DTRT_LIB_DIR=$TRT_RELEASE/lib -DTRT_BIN_DIR=`pwd`/out
make -j$(nproc)
```

> NOTE:
> 1. The default CUDA version used by CMake is 10.1. To override this, for example to 9.0, append `-DCUDA_VERSION=9.0` to the cmake command.
> 1. The default CUDA version used by CMake is 10.2. To override this, for example to 10.0, append `-DCUDA_VERSION=10.0` to the cmake command.
> 2. Samples may fail to link on CentOS7. To work around this create the following symbolic link:
> ```bash
> ln -s $TRT_BIN_DIR/libnvinfer_plugin.so $TRT_BIN_DIR/libnvinfer_plugin.so.6
> ```
> `ln -s $TRT_BIN_DIR/libnvinfer_plugin.so $TRT_BIN_DIR/libnvinfer_plugin.so.7`

The required CMake arguments are:

Expand All @@ -150,9 +167,9 @@ NOTE: Along with the TensorRT OSS components, the following source packages will

- `CMAKE_BUILD_TYPE`: Specify if binaries generated are for release or debug (contain debug symbols). Values consists of [`Release`] | `Debug`

- `CUDA_VERISON`: The version of CUDA to target, for example [`10.1`].
- `CUDA_VERISON`: The version of CUDA to target, for example [`10.2`].

- `CUDNN_VERSION`: The version of cuDNN to target, for example [`7.5`].
- `CUDNN_VERSION`: The version of cuDNN to target, for example [`7.6`].

- `PROTOBUF_VERSION`: The version of Protobuf to use, for example [`3.8.x`]. Note: Changing this will not configure CMake to use a system version of Protobuf, it will configure CMake to download and try building that version.

Expand Down Expand Up @@ -222,5 +239,5 @@ NOTE: Along with the TensorRT OSS components, the following source packages will

## Known Issues

#### TensorRT 6.0.1
* See [Release Notes](https://docs.nvidia.com/deeplearning/sdk/tensorrt-release-notes/index.html).
#### TensorRT 7.0
* See [Release Notes](https://docs.nvidia.com/deeplearning/sdk/tensorrt-release-notes/tensorrt-7.html#tensorrt-7).
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.1.5
7.0.0.11
26 changes: 18 additions & 8 deletions docker/centos-7.Dockerfile → docker/centos.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG CUDA_VERSION=10.1
FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-cudnn7-devel-centos7
ARG CUDA_VERSION=10.2
ARG CENTOS_VERSION=7
FROM nvidia/cuda:${CUDA_VERSION}-cudnn7-devel-centos${CENTOS_VERSION}

LABEL maintainer="NVIDIA CORPORATION"

ARG uid=1000
ARG gid=1000
RUN groupadd -r -f -g ${gid} trtuser && useradd -r -u ${uid} -g ${gid} -ms /bin/bash trtuser
RUN usermod -aG wheel trtuser
RUN echo 'trtuser:nvidia' | chpasswd
RUN mkdir -p /workspace && chown trtuser /workspace
# Install requried libraries
RUN yum -y install \
libcurl4-openssl-dev \
Expand All @@ -26,24 +33,27 @@ RUN yum -y install \
pkg-config \
python3 \
python3-pip \
python3-dev \
python3-setuptools \
python3-wheel \
sudo \
make

RUN cd /usr/local/bin &&\
ln -s /usr/bin/python3 python &&\
ln -s /usr/bin/pip3 pip

# Install Cmake
RUN cd /tmp &&\
wget https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.sh &&\
chmod +x cmake-3.14.4-Linux-x86_64.sh &&\
./cmake-3.14.4-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license &&\
RUN cd /tmp && \
wget https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.sh && \
chmod +x cmake-3.14.4-Linux-x86_64.sh && \
./cmake-3.14.4-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license && \
rm ./cmake-3.14.4-Linux-x86_64.sh

# Set environment and working directory
ENV TRT_RELEASE /tensorrt
ENV TRT_LIB_DIR $TRT_RELEASE/lib
ENV TRT_SOURCE /workspace/TensorRT
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:$TRT_LIB_DIR
WORKDIR /workspace

USER trtuser
RUN ["/bin/bash"]
Empty file added docker/jetpack_files/.gitkeep
Empty file.
48 changes: 0 additions & 48 deletions docker/ubuntu-18.04.Dockerfile

This file was deleted.

Loading

0 comments on commit 572d54f

Please sign in to comment.