High cpu load Gstreamer on TK1

Dear Community,

I have been playing a little with some Jetson platforms during the past month and I have been able to build some nice VisionWorks programs; I have though realized that there might be something wrong with the basic decoding of the videos through Gstreamer or, at least, something I find really strange.
By playing the “player.cpp” sample I notice that the CPU load hits around 40-50%, which didn’t bother me until today, when I have seen an older board playing 4 video streams at once (through Gstreamer with omx acceleration) with a cpu load of 8%. Is it reasonable to have those numbers on the TK1 while executing only the Player sample?

Furthermore I have noticed that the FrameSource folder contains different classes to process the video, especially I have noticed that there are some GstreamerOMX files which do not use the appsink in the Gstreamer pipeline (who might be responsible for that cpu load). Do you know any idea how I could make the Gstreamer pipeline more efficient by using totally the GPU power and raise down the CPU load I have when playing simple videos?

Or simply how I could save some CPU?

Sorry for my actual english, I have been trying to figure this out during the previous 13 hours :(

Thank you a lot for your time.

Best Regards,

Alessandro

Hi Allessandro,
Please share path of player.cpp. Are you on r21.6?

Dear DaneLLL,

here follows the result of:

cat /etc/nv_tegra_release
# R21 (release), REVISION: 5.0, GCID: 7273100, BOARD: ardbeg, EABI: hard, DATE: Wed Jun  8 04:19:09 UTC 2016

About the path of the player.cpp, I have ran the install-samples.sh by providing the Desktop as destination folder, so I am working on the VisionWorks-1.4-Samples folder on my TK1 desktop.

The full path is:

/home/ubuntu/Desktop/VisionWorks-1.4-Samples/samples/player

what really concerns me is that the CPU load appears to be too high considering I am running just a player; or at least this my thought. This makes me wonder if I am using totally the GPU acceleration. Furthermore, I would like to seek for some workaround in order to drop down the CPU usage. By running more complex samples (like video stabilization) the CPU load starts to be too high and it almost saturates when I process videos with a resolution of 1280x720 at 30fps.

https://imgur.com/a/M5o290U

This is an example of what I get.

Thanks a lot for your time.

Best regards,

Alessandro

Hi Alessandro,
Please share tegrastats for reference.

By enabling all the CPUs this is the result of tegrastats:

(without load)

ubuntu@tegra-ubuntu:~$ ./tegrastats 
RAM 538/1926MB (lfb 191x4MB) cpu [0%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [5%,2%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [4%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [2%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [3%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [2%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [2%,1%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 538/1926MB (lfb 191x4MB) cpu [4%,0%,1%,0%]@-1 VDE 0 EDP limit 0

(with load, executing the sample player in the same conditions of above)

ubuntu@tegra-ubuntu:~$ ./tegrastats 
RAM 652/1926MB (lfb 160x4MB) cpu [0%,0%,0%,0%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 160x4MB) cpu [19%,17%,18%,23%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 160x4MB) cpu [19%,14%,17%,26%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [15%,20%,18%,20%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [26%,12%,23%,14%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [21%,26%,15%,11%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [21%,18%,25%,13%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [17%,20%,9%,29%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [25%,15%,16%,24%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [18%,28%,11%,14%]@-1 VDE 0 EDP limit 0
RAM 652/1926MB (lfb 159x4MB) cpu [23%,17%,12%,19%]@-1 VDE 0 EDP limit 0

and this is the result of top:

PID   USER     PR   NI  VIRT    RES    SHR  S  %CPU  %MEM  TIME+   COMMAND                           
3009 ubuntu    20   0  273324  76012  29108 S  50.4  3.9   0:08.07 nvx_sample_play

I have noticed that in the FrameSource.cpp file there is a note saying this:

# if defined USE_GSTREAMER_OMX && defined USE_GLES // For L4T R23 and R24 only
#  include "FrameSource/GStreamer/GStreamerOpenMAXFrameSourceImpl.hpp"
# endif

Might this be the cause? I mean, should I somehow upgrade to L4T R23/24 in order to take advantage of this particular implementation?

Looks like you don’t run with sudo, so all CPU frequency shows -1.

r23 and r24 are for TX1. r21.5 is a stable revision for TK1.

We would like to double confirm your results are same as us and analyze where CPU resources are consumed. If it is what it is, we don’t have plan to improve it.

Please share sudo tegrastsats first.

Here are the sudo tegrastats:

ubuntu@tegra-ubuntu:~$ sudo ./tegrastats 
RAM 933/1926MB (lfb 1x4MB) cpu [0%,0%,0%,0%]@2065 EMC 12%@924 AVP 0%@204 VDE 120 GR3D 6%@396 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [22%,16%,23%,17%]@2065 EMC 12%@924 AVP 0%@204 VDE 120 GR3D 12%@396 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [27%,16%,25%,11%]@2065 EMC 12%@924 AVP 0%@204 VDE 120 GR3D 57%@72 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [23%,30%,14%,8%]@2065 EMC 12%@924 AVP 0%@204 VDE 120 GR3D 63%@108 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [24%,26%,10%,14%]@2065 EMC 12%@924 AVP 0%@300 VDE 480 GR3D 56%@108 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [20%,26%,15%,13%]@2065 EMC 12%@924 AVP 0%@300 VDE 480 GR3D 39%@108 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [28%,20%,6%,19%]@2065 EMC 12%@924 AVP 0%@300 VDE 480 GR3D 20%@180 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [22%,26%,12%,17%]@2065 EMC 12%@924 AVP 0%@300 VDE 480 GR3D 38%@108 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [21%,22%,11%,23%]@2065 EMC 12%@924 AVP 0%@204 VDE 276 GR3D 65%@108 EDP limit 0
RAM 933/1926MB (lfb 1x4MB) cpu [21%,21%,11%,19%]@2065 EMC 12%@924 AVP 0%@300 VDE 480 GR3D 25%@252 EDP limit 0

We have run nvx_sample_player and also see some CPU load.
Run

$ cd /home/ubuntu/VisionWorks-1.4-Samples/bin/armv7l/linux/release
    $ ./nvx_sample_player

Check tegrastats:

RAM 583/1892MB (lfb 231x4MB) cpu [49%,off,75%,off]@2065 EMC 22%@924 AVP 25%@204 VDE 120 GR3D 54%@180 EDP limit 0
    RAM 583/1892MB (lfb 231x4MB) cpu [70%,off,66%,off]@2065 EMC 35%@600 AVP 25%@204 VDE 120 GR3D 49%@180 EDP limit 0
    RAM 583/1892MB (lfb 231x4MB) cpu [62%,off,70%,off]@2065 EMC 23%@924 AVP 26%@204 VDE 120 GR3D 40%@180 EDP limi
    RAM 583/1892MB (lfb 231x4MB) cpu [60%,off,64%,off]@2065 EMC 23%@924 AVP 25%@204 VDE 120 GR3D 11%@108 EDP limit 0
    RAM 588/1892MB (lfb 231x4MB) cpu [76%,96%,47%,47%]@2065 EMC 24%@924 AVP 25%@204 VDE 120 GR3D 57%@180 EDP limit 0
    RAM 585/1892MB (lfb 231x4MB) cpu [55%,73%,off,off]@2065 EMC 23%@924 AVP 25%@204 VDE 120 GR3D 83%@108 EDP limit 0

It shall be optimized in later release for TX1/TX2, but for TK1, currently we don’t have plan to enhance it.

Thanks a lot for your time :) I will try to manage this!

Best regards,

Alessandro