Skip to content

Commit e266c23

Browse files
authored
Merge pull request #14 from NVIDIA-ISAAC-ROS/release-dp
Isaac ROS 0.10.0 (DP)
2 parents e8aabe3 + 692f116 commit e266c23

File tree

58 files changed

+12916
-1149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+12916
-1149
lines changed

.gitattributes

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@
88
*.gz filter=lfs diff=lfs merge=lfs -text
99
*.tar filter=lfs diff=lfs merge=lfs -text
1010
*.zip filter=lfs diff=lfs merge=lfs -text
11+
1112
# Documents
1213
*.pdf filter=lfs diff=lfs merge=lfs -text
13-
# Numpy data
14-
*.npy filter=lfs diff=lfs merge=lfs -text
15-
# Debian package
16-
*.deb filter=lfs diff=lfs merge=lfs -text
1714

1815
# Shared libraries
1916
*.so filter=lfs diff=lfs merge=lfs -text
2017
*.so.* filter=lfs diff=lfs merge=lfs -text
2118

22-
# PCD files
23-
*.pcd filter=lfs diff=lfs merge=lfs -text
24-
2519
# Model files
2620
*.onnx filter=lfs diff=lfs merge=lfs -text

README.md

Lines changed: 371 additions & 437 deletions
Large diffs are not rendered by default.

docs/model-preparation.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Preparing Deep Learning Models for Isaac ROS
2+
3+
## Obtaining a Pre-trained Model from NGC
4+
The NVIDIA GPU Cloud hosts a [catalog](https://catalog.ngc.nvidia.com/models) of Deep Learning pre-trained models that are available for your development.
5+
6+
1. Use the **Search Bar** to find a pre-trained model that you are interested in working with.
7+
8+
2. Click on the model's card to view an expanded description, and then click on the **File Browser** tab along the navigation bar.
9+
10+
3. Using the **File Browser**, find a deployable `.etlt` file for the model you are interested in.
11+
12+
> **Note:** The `.etlt` file extension indicates that this model has pre-trained but **encrypted** weights, which means one needs to use the `tao-converter` utility to decrypt the model, as described [below](#using-tao-converter-to-decrypt-the-encrypted-tlt-model-etlt-format).
13+
14+
4. Under the **Actions** heading, click on the **...** icon for the file you selected in the previous step, and then click **Copy `wget` command**.
15+
5. **Paste** the copied command into a terminal to download the model in the current working directory.
16+
17+
## Using `tao-converter` to decrypt the Encrypted TLT Model (`.etlt`) Format
18+
As discussed above, models distributed with the `.etlt` file extension are encrypted and must be decrypted before use via NVIDIA's [`tao-converter`](https://developer.nvidia.com/tao-toolkit-get-started).
19+
20+
`tao-converter` is already included in the Docker images available as part of the standard [Isaac ROS Development Environment](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common/docs/dev-env-setup.md).
21+
22+
The per-platform installation paths are described below:
23+
24+
| Platform | Installation Path | Symlink Path |
25+
| --------------- | ------------------------------------------------------------- | ----------------------------------- |
26+
| x86_64 | `/opt/nvidia/tao/tao-converter-x86-tensorrt8.0/tao-converter` | **`/opt/nvidia/tao/tao-converter`** |
27+
| Jetson(aarch64) | `/opt/nvidia/tao/jp5` | **`/opt/nvidia/tao/tao-converter`** |
28+
29+
30+
### Converting `.etlt` to a TensorRT Engine Plan
31+
Here are some examples for generating the TensorRT engine file using `tao-converter`. In this example, we will use the [`PeopleSemSegnet Shuffleseg` model](https://catalog.ngc.nvidia.com/orgs/nvidia/teams/tao/models/peoplesemsegnet/files?version=deployable_shuffleseg_unet_v1.0):
32+
33+
#### Generate an engine file for the `fp16` data type:
34+
```bash
35+
mkdir -p /workspaces/isaac_ros-dev/models && \
36+
/opt/nvidia/tao/tao-converter -k tlt_encode -d 3,544,960 -p input_2:0,1x3x544x960,1x3x544x960,1x3x544x960 -t fp16 -e /workspaces/isaac_ros-dev/models/peoplesemsegnet_shuffleseg.engine -o argmax_1 peoplesemsegnet_shuffleseg_etlt.etlt
37+
```
38+
> **Note:** The specific values used in the command above are retrieved from the **PeopleSemSegnet** page under the **Overview** tab. The model input node name and output node name can be found in `peoplesemsegnet_shuffleseg_cache.txt` from `File Browser`. The output file is specified using the `-e` option. The tool needs write permission to the output directory.
39+
>
40+
> A detailed explanation of the input parameters is available [here](https://docs.nvidia.com/tao/tao-toolkit/text/tensorrt.html#running-the-tao-converter).
41+
42+
#### Generate an engine file for the data type `int8`:
43+
44+
Create the models directory:
45+
```bash
46+
mkdir -p /workspaces/isaac_ros-dev/models
47+
```
48+
49+
Download the calibration cache file:
50+
> **Note:** Check the model's page on NGC for the latest `wget` command.
51+
52+
```bash
53+
wget https://api.ngc.nvidia.com/v2/models/nvidia/tao/peoplesemsegnet/versions/deployable_shuffleseg_unet_v1.0/files/peoplesemsegnet_shuffleseg_cache.txt
54+
```
55+
56+
```bash
57+
/opt/nvidia/tao/tao-converter -k tlt_encode -d 3,544,960 -p input_2:0,1x3x544x960,1x3x544x960,1x3x544x960 -t int8 -c peoplesemsegnet_shuffleseg_cache.txt -e /workspaces/isaac_ros-dev/models/peoplesemsegnet_shuffleseg.engine -o argmax_1 peoplesemsegnet_shuffleseg_etlt.etlt
58+
```
59+
60+
> **Note**: The calibration cache file (specified using the `-c` option) is required to generate the `int8` engine file. This file is provided in the **File Browser** tab of the model's page on NGC.

docs/tensorrt-and-triton-info.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Isaac ROS Triton and TensorRT Nodes for DNN Inference
2+
3+
NVIDIA's Isaac ROS suite of packages provides two separate nodes for performing DNN inference: Triton and TensorRT.
4+
5+
Our benchmarks show comparable performance and inference speed with both nodes, so a decision should be based on other characteristics of the overall model being deployed.
6+
7+
## NVIDIA Triton
8+
The NVIDIA Triton Inference Server is an [open-source inference serving software](https://developer.nvidia.com/nvidia-triton-inference-server) that provides a uniform interface for deploying AI models. Crucially, Triton supports a wide array of compute devices like NVIDIA GPUs and both x86 and ARM CPUs, and also operates with all major frameworks such as TensorFlow, TensorRT, and PyTorch.
9+
10+
Because Triton can take advantage of additional compute devices beyond just the GPU, Triton can be a better choice in situations where there is GPU resource contention from other model inference or processing tasks. However, in order to provide for this flexibility, Triton requires the creation of a model repository and additional configuration files before deployment.
11+
12+
## NVIDIA TensorRT
13+
NVIDIA TensorRT is a specific CUDA-based, on-GPU inference framework that performs a number of optimizations to deliver extremely performant model execution. TensorRT only supports ONNX and TensorRT Engine Plans, providing less flexibility than Triton but also requiring less initial configuration.
14+
15+
## Using either Triton or TensorRT Nodes
16+
Both nodes use the Isaac ROS [Tensor List message](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_common/blob/main/isaac_ros_tensor_list_interfaces/msg/TensorList.msg) for input data and output inference result.
17+
18+
Users can either prepare a custom model or download pre-trained models from NGC as described [here](./model-preparation.md#obtaining-a-pre-trained-model-from-ngc). Models should be converted to the TensorRT Engine File format using the `tao-converter` tool as described [here](./model-preparation.md#using-tao-converter-to-decrypt-the-encrypted-tlt-model-etlt-format).
19+
20+
> **Note:** While the TensorRT node can automatically convert ONNX plans to the TensorRT Engine Plan format if configured to use a `.onnx` file, this conversion step will considerably extend the node's per-launch initial setup time.
21+
>
22+
> As a result, we recommend converting any ONNX models to TensorRT Engine Plans first, and configuring the TensorRT node to use the Engine Plan instead.
23+
24+
25+
## Pre- and Post-Processing Nodes
26+
In order to be a useful component of a ROS graph, both Isaac ROS Triton and TensorRT inference nodes will require application-specific `pre-processor` (`encoder`) and `post-processor` (`decoder`) nodes to handle type conversion and other necessary steps.
27+
28+
A `pre-processor` node should take in a ROS2 message, perform the pre-processing steps dictated by the model, and then convert the data into an Isaac ROS Tensor List message. For example, a `pre-processor` node could resize an image, normalize it, and then convert it into a Tensor List.
29+
30+
A `post-processor` node should be used to convert the Isaac ROS Tensor List output of the model inference into a useful ROS2 message. For example, a `post-processor` node may perform argmax to identify the class label from a classification problem.
31+
32+
<div align="center">
33+
34+
![Using TensorRT or Triton](../resources/pipeline.png "Using TensorRT or Triton")
35+
36+
</div>
37+
38+
## Further Reading
39+
For more documentation on Triton, see [here](https://developer.nvidia.com/nvidia-triton-inference-server).
40+
41+
For more documentation on TensorRT, see [here](https://developer.nvidia.com/tensorrt).

docs/troubleshooting.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# DNN Inference Troubleshooting
2+
## Seeing operation failed followed by the process dying
3+
One cause of this issue is when the GPU being used does not have enough memory to run the model. For example, DOPE may require up to 6GB of VRAM to operate, depending on the application.
4+
5+
### Symptom
6+
```
7+
[component_container_mt-1] 2022-06-27 08:35:37.518 ERROR extensions/tensor_ops/Reshape.cpp@71: reshape tensor failed.
8+
[component_container_mt-1] 2022-06-27 08:35:37.518 ERROR extensions/tensor_ops/TensorOperator.cpp@151: operation failed.
9+
[component_container_mt-1] 2022-06-27 08:35:37.518 ERROR gxf/std/entity_executor.cpp@200: Entity with 102 not found!
10+
[component_container_mt-1] INFO: infer_simple_runtime.cpp:69 TrtISBackend id:164 initialized model: Ketchup
11+
[component_container_mt-1] 2022-06-27 08:35:37.518 WARN gxf/std/greedy_scheduler.cpp@221: Error while executing entity 87 named 'VERAGYEWGZ_reshaper': GXF_FAILURE
12+
[component_container_mt-1] [ERROR] [1656318937.518424053] [dope_encoder]: [NitrosPublisher] Vault ("vault/vault", eid=102) was stopped. The graph may have been terminated due to an error.
13+
[component_container_mt-1] terminate called after throwing an instance of 'std::runtime_error'
14+
[component_container_mt-1] what(): [NitrosPublisher] Vault ("vault/vault", eid=102) was stopped. The graph may have been terminated due to an error.
15+
[ERROR] [component_container_mt-1]: process has died [pid 13378, exit code -6, cmd '/opt/ros/humble/install/lib/rclcpp_components/component_container_mt --ros-args -r __node:=dope_container -r __ns:=/'].
16+
```
17+
### Solution
18+
Try using the Isaac ROS TensorRT node or the Isaac ROS Triton node with the TensorRT backend instead. Otherwise, a discrete GPU with more VRAM may be required.

isaac_ros_dnn_encoders/CMakeLists.txt

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
22
#
33
# NVIDIA CORPORATION and its licensors retain all intellectual property
44
# and proprietary rights in and to this software, related documentation
55
# and any modifications thereto. Any use, reproduction, disclosure or
66
# distribution of this software and related documentation without an express
77
# license agreement from NVIDIA CORPORATION is strictly prohibited.
88

9-
cmake_minimum_required(VERSION 3.5)
10-
project(isaac_ros_dnn_encoders)
9+
cmake_minimum_required(VERSION 3.8)
10+
project(isaac_ros_dnn_encoders LANGUAGES C CXX)
1111

1212
# Default to C++17
1313
if(NOT CMAKE_CXX_STANDARD)
@@ -24,18 +24,31 @@ if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
2424
endif()
2525
message( STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}" )
2626

27+
execute_process(COMMAND uname -m COMMAND tr -d '\n'
28+
OUTPUT_VARIABLE ARCHITECTURE
29+
)
30+
message( STATUS "Architecture: ${ARCHITECTURE}" )
31+
2732
find_package(ament_cmake_auto REQUIRED)
2833
ament_auto_find_build_dependencies()
2934

35+
# Find VPI dependency
36+
find_package(vpi REQUIRED)
37+
3038
# DNN Image Encoder Node
3139
ament_auto_add_library(dnn_image_encoder_node SHARED src/dnn_image_encoder_node.cpp)
3240
target_compile_definitions(dnn_image_encoder_node
3341
PRIVATE "COMPOSITION_BUILDING_DLL"
3442
)
35-
rclcpp_components_register_nodes(dnn_image_encoder_node "isaac_ros::dnn_inference::DnnImageEncoderNode")
36-
set(node_plugins "${node_plugins}isaac_ros::dnn_inference::DnnImageEncoderNode;$<TARGET_FILE:dnn_image_encoder_node>\n")
43+
target_link_libraries(dnn_image_encoder_node)
44+
rclcpp_components_register_nodes(dnn_image_encoder_node "nvidia::isaac_ros::dnn_inference::DnnImageEncoderNode")
45+
set(node_plugins "${node_plugins}nvidia::isaac_ros::dnn_inference::DnnImageEncoderNode;$<TARGET_FILE:dnn_image_encoder_node>\n")
3746

38-
ament_auto_add_executable("dnn_image_encoder" src/dnn_image_encoder_main.cpp)
47+
# Install config directory
48+
install(
49+
DIRECTORY config
50+
DESTINATION share/${PROJECT_NAME}
51+
)
3952

4053
install(TARGETS dnn_image_encoder_node
4154
ARCHIVE DESTINATION lib
@@ -52,6 +65,7 @@ if(BUILD_TESTING)
5265
ament_lint_auto_find_test_dependencies()
5366

5467
find_package(launch_testing_ament_cmake REQUIRED)
68+
add_launch_test(test/isaac_ros_dnn_image_encoder_test.py)
5569
endif()
5670

5771
ament_auto_package(INSTALL_TO_SHARE)

0 commit comments

Comments
 (0)