# How to optimize custom tensorrt plugin performance

**URL:** <https://forums.developer.nvidia.com/t/how-to-optimize-custom-tensorrt-plugin-performance/284596>\
**Category:** DeepStream SDK\
**Tags:** jetson, tensorrt\
**Created:** [March 1, 2024, 5:44am UTC](https://forums.developer.nvidia.com/t/how-to-optimize-custom-tensorrt-plugin-performance/284596 "2024-03-01T05:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sameerk.spn](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sameerk.spn](https://forums.developer.nvidia.com/u/sameerk.spn)\
**Post date:** [March 1, 2024, 5:44am UTC](https://forums.developer.nvidia.com/t/how-to-optimize-custom-tensorrt-plugin-performance/284596/1 "2024-03-01T05:44:30Z")

</div>

I created a custom deepstream plugin with tensorrt inference , i am not getting performance anywhere close to nvinfer, the same detection model is giving 50 fps on nvinfer but 6 fps on custom tensorrt plugin, precison for both is fp32.  
Although nvinfer is also using tensorrt inside it for inference, i cannot find the exact inference code part(enqueueV2 or execute V2 API) in nvinfer source code.

**• Jetson Xavier**  
**• DeepStream 6.0.1**  
**• JetPack Version (valid for Jetson only)**  
**• TensorRT Version**  
**• NVIDIA GPU Driver Version (valid for GPU only)**

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [March 1, 2024, 6:33am UTC](https://forums.developer.nvidia.com/t/how-to-optimize-custom-tensorrt-plugin-performance/284596/3 "2024-03-01T06:33:13Z")

</div>

**There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks**

> [@sameerk.spn](#):
>
> i cannot find the exact inference code part(enqueueV2 or execute V2 API) in nvinfer source code.

The enqueueV2 API is evoked in function _FullDimTrtBackendContext::enqueueBuffer()_ and _DlaFullDimTrtBackendContext::enqueueBuffer()_ in /opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer/nvdsinfer\_backend.cpp

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [March 19, 2024, 2:22am UTC](https://forums.developer.nvidia.com/t/how-to-optimize-custom-tensorrt-plugin-performance/284596/4 "2024-03-19T02:22:13Z")

</div>

Closed on March 19, 2024, 2:22am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
