MarcA711 / Rockchip-FFmpeg-Builds

MIT License
7 stars 4 forks source link

Get load of vpu #3

Closed MarcA711 closed 2 months ago

MarcA711 commented 2 months ago

Hi,

for rknpu one can get the load and other statistics using:

# cat /sys/kernel/debug/rknpu/load 
NPU load:  Core0:  4%, Core1:  0%, Core2:  0%,
# cat /sys/kernel/debug/rknpu/freq 
1000000000
# cat /sys/kernel/debug/rknpu/volt 
800000

For rkrga this prints the load:

# cat /sys/kernel/debug/rkrga/load
num of scheduler = 3
================= load ==================
scheduler[0]: rga3_core0
     load = 0%
-----------------------------------
scheduler[1]: rga3_core1
     load = 0%
-----------------------------------
scheduler[2]: rga2
     load = 59%
-----------------------------------
     process 14405: pid = 1265761, name: ...

Does anybody know if there are similar statistics for the other hardware de-/encoders? Maybe @nyanmisaka can help?

Thanks

nyanmisaka commented 2 months ago

According to MPP dev there is no direct way here. https://github.com/rockchip-linux/mpp/issues/129 But it can be roughly estimated by the hardware time spent per frame and chip specs (e.g. up to 8k60).

# 0x100 debug on; 0x0 debug off
sudo sh -c "echo 0x100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug"

# dmesg
[37651.636118] rk_vcodec: fdc48100.rkvdec-core:1 session 34096:5 time: 1170 us hw 1158 us
[37651.636723] rk_vcodec: fdc38100.rkvdec-core:0 session 34096:5 time: 1166 us hw 1158 us

I would also recommend using the FPS given by ffmpeg for estimation.

MarcA711 commented 2 months ago

Thank you very much!