0

I’m using Jetson Xavier (with maxn config) and I have created python multiprocess application for video analytics, containing the following 2 processes (Entirely Separate with no inter process communication):

  1. Simple process for capture video source with openCV and showing it with openCV imshow .
  2. Process that taking constant tenzor and run it through a pytorch nn model with cuda in an infinite loop. (I started with 2 connected processes for capture the video and then process the frames concurrent but to debug the problem I broke all of the connection and ran it on a constant tensor)

The problem is that when only the video process is running the video is smooth. But when the NN process works concurrently the video become not smooth, that, even though the fps for the video process is 25, like I designed it by waitkey. I suspect that I’m using all my gpu resources for the NN and then the frame show rendering is on hold for a few milliseconds until the gpu is free for render. If it’s indeed the reason for my problem, can I determine priority for gpu usage between the two processes? Do you have another idea how to solve it?

This is the pseudo code (the original is offline and I can’t upload it):

Process1:

Video = cv2.capture (video_source)
While True
    Frame = Video.get()
    Cv2.imshow(frame)
    Waitkey(40)
    # Check fps

Process2:

model = # loading the pytorch NN model
tenzor = # creating zeros pytorch cuda tenzor
while True
    model(tenzor)

Attaching tegrastats from running time: tegra stats from running time

Thanks moti

moti
  • 1
  • 2
  • how expensive is your neural network? What kind of model do you use with which dnn framework? – Micka Dec 15 '19 at 18:33
  • The base model i use (before adaptation) is mfnet for video recognition, this model is quite expensive (processing 16 frames in C3D architecture with multifiber layers architecture for computational cost reduce, it is quite cheap action recognition model but steel expensive), using pytorch. – moti Dec 17 '19 at 09:10

0 Answers0