Description
The situation is that as I have a customized plugin and I wanna add it into my plugin library, so I built the plugins from scratch to get the .so file (libnvinfer_plugin.so). In fact, the building steps were followed by the building TensorRT-OSS of TensorRT github repository, so after I built the plugins, there were a lot of files including libnvonnxparser.so
, libnvcaffeparser.so
, libnvinfer_plugin.so
, and trtexec
tool.
What I did experiments in docker container individually is below:
-
Put those output built library files into
/usr/lib/x86_64-linux-gnu/
to let trtexec find the library location.
This one can successfully correctly convert the onnx model to TRT model and do inference without any error.
Here is the partial output message:[04/19/2021-03:02:08] [I] GPU Compute [04/19/2021-03:02:08] [I] min: 32.7649 ms [04/19/2021-03:02:08] [I] max: 33.9702 ms [04/19/2021-03:02:08] [I] mean: 33.0306 ms [04/19/2021-03:02:08] [I] median: 32.9963 ms [04/19/2021-03:02:08] [I] percentile: 33.9702 ms at 99% [04/19/2021-03:02:08] [I] total compute time: 3.07185 s &&&& PASSED TensorRT.trtexec # trtexec --onnx=model.onnx --saveEngine=test.trt --explicitBatch --fp16
-
I did not put the lib into
/usr/lib/x86_64-linux-gnu/
and I used the plugins option this way to convert the TRT model. It could convert to the TRT model (saved the model in the assigned folder already.) but it encountered the error ofmalloc_consolidate(): invalid chunk size Aborted (core dumped)
during the inference step of trtexec.[04/19/2021-02:29:13] [I] GPU Compute [04/19/2021-02:29:13] [I] min: 32.6328 ms [04/19/2021-02:29:13] [I] max: 33.0833 ms [04/19/2021-02:29:13] [I] mean: 32.795 ms [04/19/2021-02:29:13] [I] median: 32.7783 ms [04/19/2021-02:29:13] [I] percentile: 33.0833 ms at 99% [04/19/2021-02:29:13] [I] total compute time: 3.08273 s &&&& PASSED TensorRT.trtexec # trtexec --onnx=model.onnx --saveEngine=test.trt --explicitBatch --fp16 --plugins=libnvinfer_plugin.so malloc_consolidate(): invalid chunk size Aborted (core dumped)
It was quite inconvenient to put those libraries into /usr/lib/x86_64-linux-gnu/
folder every time.
According to the first experiment, it could prove the plugin which was able to work correctly.
I wonder how can I use the trtexec tool with --plugins
option to convert the model?
Environment
TensorRT Version: 7.2
GPU Type: GeForce RTX 3060
Nvidia Driver Version: 460.56
CUDA Version: 11.2
Baremetal or Container (if container which image + tag): Image was using NVIDIA Release 21.03 (build 20572684)
docker pull nvcr.io/nvidia/tensorrt:21.03-py3
If you request any further information about my description, please let me know~
Thank you!!
Best regards,
Chieh