How to install onnx-tensorrt and how to solve can not find "dirver_types.h" error

There is a example at /usr/sre/tensorrt/sample/python/yolov3_onnx
And you can find the step to test it. But the step 1 is a huge challenge.
You need build onnx-tensorrt.
Problem 1: I meet can not find protobuf problem.

solution: find protobuf link https://github.com/protocolbuffers/protobuf/blob/master/src/README.md and clone/build/install it.

Problem 2: how to build and install onnx-tensorrt https://github.com/onnx/onnx-tensorrt

1 clone: git clone --recursive GitHub - onnx/onnx-tensorrt: ONNX-TensorRT: TensorRT backend for ONNX
2

cd onnx-tensorrt 
mkdir build
cd build
cmake .. -DTENSORRT_ROOT=<tensorrt_install_dir>
OR
cmake .. -DCUDA_INCLUDE_DIRS=/usr/local/cuda/include -DTENSORRT_ROOT=/ust/src/tensorrt -DGPU_ARCHS="53"
make -j4
sudo make install

At the official project make command didn’t have -DCUDA_INCLUDE_DIRS=…
If you didn’t add it, you will meet fatal error problem.

1 Like

Hi,

Thanks for your feedback.

The building steps shared in the GitHub is not specific for Jetson platform.
It is helpful to see your experience sharing.

Hi,

I follow the above steps. still not work. error is below

– Protobuf libraries : /usr/lib/aarch64-linux-gnu/libprotobuf.so;-lpthread
– BUILD_ONNX_PYTHON : OFF
– Found TensorRT headers at /usr/include/aarch64-linux-gnu
– Find TensorRT libs at /usr/lib/aarch64-linux-gnu/libnvinfer.so;/usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so;TENSORRT_LIBRARY_MYELIN-NOTFOUND
– Could NOT find TENSORRT (missing: TENSORRT_LIBRARY)
ERRORCannot find TensorRT library.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
TENSORRT_LIBRARY_MYELIN
linked by target “nvonnxparser_static” in directory /home/michael/onnx-tensorrt
linked by target “nvonnxparser” in directory /home/michael/onnx-tensorrt

– Configuring incomplete, errors occurred!
See also “/home/michael/onnx-tensorrt/build/CMakeFiles/CMakeOutput.log”.
See also “/home/michael/onnx-tensorrt/build/CMakeFiles/CMakeError.log”.

Hi guo.feng,

Please open a new topic for your issue, thanks.

Quick question, where should i clone onnx-tensorrt?