About using multi-process to execute two engine models in one program

Problem description:
Hello, I can run my detection engine model or super-resolution engine model in Jetson Orin Nano separately and it works fine. But when I run the program with two models together, there will be problems, and the picture will become torn and rippled. I hope I can find and solve the problem here.I have uploaded the effect picture and related test code.


code.zip (28.5 MB)

Do you boost the system to try.

sudo nvpmodel -m 2 //[MaxN]
sudo jetson_clocks
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

No, I don’t know where this problem occurs, and what does this command mean? I can try it now.

I ran this command, but there is no mode2. Through the sudo nvpmodel -q --verbose command, it is now maxN, NVPM VERB: Current mode: NV Power Mode: 15W. This is the maxN of the jetson development board.

You can ignore the nvpmode to try.

sudo jetson_clocks
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

Thank you for your reply, but these commands did not work. Just like before, I ran these commands first, then ran my test program, but it didn’t work. Then I restarted and ran these commands again, but it still didn’t work. You can try running the test demo I attached in your jetson orin nano (it should be able to run directly). Is it possible that the internal scheduling will be confused or the data will be interfered when running the two engine model inferences using multithreading? Looking forward to your reply

Does cameras relative?

The camera is read using USB. OpenCV is used to obtain data from a camera. Two models are used for different processing (one model detects the collected images, and the other performs super resolution). The compressed package I provided contains the video saved by our camera.

What’s the camera output size? Have try lower resolution?

The camera output size is 256*192

We think this problem is a problem with the engine’s internal reasoning, but we can’t locate and solve this problem. After all, there is no problem when running alone. So I want to ask for help here

Is there any expert who can look into this issue? Thanks

Maybe check if v4l2src without problem then break down the pipeline to narrow down the cause.

Thanks for your reply. I understand that v4l2src is used for video acquisition tasks in Linux. However, there is no problem in outputting the acquired images through opencv.imshow() in my test code. The problem only occurs when the images are super-resolved by the model (but there is no problem running the super-resolved program alone. The problem only occurs when two engine models are used for inference in multiple processes). The following is the result of the runtime, which proves that there is no problem with the images collected from the camera. The problem only occurs after the super-resolved model. Are you willing to execute the test code I provided to see if it can be reproduced? Looking forward to your answer

Hello experts, my latest experimental problem is located in multi-threading. I tested serial operation, locked parallel operation, and unlocked parallel operation, and found that only unlocked parallel operation would have problems. It may be that multiple processes will compete for some invisible resources. Is there any way to solve this problem between multi-process reasoning? After all, the frame rate of parallel operation is 8 more than that of serial operation, which is very important to us.

At the same time, in the gpu displayed by jtop, we observed that the overall gpu utilization is not high. Is there any way to improve the gpu utilization?

Hi,

Have you tried Deepstream SDK?
It can support multiple models and has been optimized for the Jetson system.

Thanks.

1 Like

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