How to do tensorRT inference for multi-thread (c++)?

Hello everyone,

I want to have two rtsp channels to do tensorRT inference.
My code is as below:
rtspLoop()
{
pthread_create(rtsp_entry0);
pthread_create(rtsp_entry1);
}
rtsp_entry0()
{
while(1) {
//do tensorRT inference
}
}
rtsp_entry1()
{
while(1) {
//do tensorRT inference
}
}
How do I add cuda code to make the multi threading work?
I am using C++/NX/jetson-inference/jetpack4.4.

Thank you very much!

1 Like