# Running Multiple TensorRT Engines On Jetson AGX

**URL:** <https://forums.developer.nvidia.com/t/running-multiple-tensorrt-engines-on-jetson-agx/181654>\
**Category:** Jetson AGX Xavier\
**Tags:** yolo, tensorrt\
**Created:** [June 23, 2021, 1:42pm UTC](https://forums.developer.nvidia.com/t/running-multiple-tensorrt-engines-on-jetson-agx/181654 "2021-06-23T13:42:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [June 24, 2021, 2:35am UTC](https://forums.developer.nvidia.com/t/running-multiple-tensorrt-engines-on-jetson-agx/181654/3 "2021-06-24T02:35:50Z")

</div>

Hi,

You will need to handle the CUDA context push/pop when running TensorRT in thread.  
Please find below comment for an example:

> [@How to use TensorRT by the multi-threading package of python](https://forums.developer.nvidia.com/t/how-to-use-tensorrt-by-the-multi-threading-package-of-python/123085/8):
>
> Hi, The sample is ready. The workflow looks like this: Master: create TensorRT engine and buffer, store the created CUDA context. Thread1: restore master’s CUDA context, run inference, destroy its CUDA context. Master: destroy the stored CUDA context. The sample is created with TensorRT default MNIST model. 1. Prepare data $ /usr/src/tensorrt/bin/trtexec --onnx=/usr/src/tensorrt/data/mnist/mnist.onnx --saveEngine=mnist.trt $ cd /usr/src/tensorrt/data/mnist/ $ sudo pip3 install pillow $ pyt…

Thanks.

---

_[View the full topic](https://forums.developer.nvidia.com/t/running-multiple-tensorrt-engines-on-jetson-agx/181654)._
