Running Jetson inference completely on either GPU / single CPU core

Hi,

We have 2 timers - one for running CAN signals and the other for detectnet.
We want the code to run on a single GPU /single CPU without interfering with other cores.
Is that possible?
Kindly help.

Thanks,
Pratosha

Hi Pratosha, have you begun by separating the CAN signals and detectNet code into different threads?

You may also be interested in this relevant, recent thread: https://devtalk.nvidia.com/default/topic/1031221/tx2-allocate-different-threads-on-different-cpus-possible-/

Hi dusty,

Our CAN signals are dependent on the output of detectnet.(depending on the position of the pedestrian - signals for horn brake accelerate is passed)
Yes I am following the thread shared. Thank you .

Is there a way we can access tegra186_timer0 , tegra186_timer1 for setting up 2 timers to work on CAN and detect-net part?
We have used 2 timers of this format [std::clock_t start]- one for CAN and one for detectnet . Initially the CAN timer sends messages and it does work but once the code enters into detectnet - the CAN signals stop getting sent.

Thanks,
Pratosha

Hi Pratosha, have you tried separating the CAN code and the detectNet code into two threads, using pthreads API or similar?

Hi Dusty,

Our CAN signals are dependent on detect-net output. Hence they can’t be separated.
We want CAN signals to be sent every 10ms and Detect-net to happen every 50ms.
For instance :
If no pedestrian - every 10ms accelerate
If pedestrian detected in danger region - brake;
If pedestrian is in the warning region - horn;

We have tried using pthreads- but facing a lot of issues with it.
We want our code to function this way -
while(1)
{
if (timer ==10ms)
{

//perform CAN functions.

}

if (timer ==30ms)
{

//perform detectnet functions
NOTE: CAN AND DETECT-NET are dependent
}
}

Kindly help,
Thanks

@Pratosha

I’m not familiar with DetectNet, but I am guessing your DetectNet functions/API calls are running inside a C++ application (?).

If so, there’s no reason why you can’t have both in separate threads (in fact, it’s recommended, as long as you’re correctly managing the threads and shared data), you could even separate the applications if you wanted to go that far! If you’re currently having issues I would guess it’s because of the way your application is structured, or you’re not using pthreads correctly, If you want to explain your issue we can try to help…

If I was doing what you are trying to do, I would have your DetectNet functionality in one thread, your CAN messaging functionality in another thread and an additional thread checking both the DetectNet and CAN threads for errors or failures.

Alternatively, as I don’t imagine there is a lot of data determining which CAN messages you send, you could split both DetectNet functionality and CAN functionality into two separate applications/programs and pass your messaging from DetectNet application (e.g. VALUE_PEDESTRIAN_DETECTED) to your CAN application via some kind of IPC like DBus. This allows you to keep both DetectNet and CAN applications separated if you wanted to specify which core(s) you wanted it to run on (I’m assuming this is possible to do, I haven’t tried it myself).