VPU decoder / encoder benchmark

Several questions…

  1. Is there a way to see the current VPU utilization?
  2. Is there a way to see the current VPU performance as in frames per second?
  3. Is there a performance governor for VPU or does the CPU governor control the VPU?
  1. Nope. Currently there’s no such feature in the kernel driver.
    But you can make an estimate based on the chip specs. For example, the max capability of RK3588’s hevc decoder is 8k60/4k240/1080p960.

  2. Enable MPP debugging and check the output in dmesg. For reference only. Because it’s not as accurate as timing yourself.

    // on
    sudo sh -c “echo 0x100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug”
    // off
    sudo sh -c “echo 0 > /sys/module/rk_vcodec/parameters/mpp_dev_debug”

[275449.195492] rk_vcodec: fdc48100.rkvdec-core:1 session 208737:518 time: 1892 us hw 1877 us
[275449.196142] rk_vcodec: fdc38100.rkvdec-core:0 session 208737:518 time: 1936 us hw 1921 us
[275449.197464] rk_vcodec: fdc48100.rkvdec-core:1 session 208737:518 time: 1945 us hw 1874 us
[275449.197926] rk_vcodec: fdc38100.rkvdec-core:0 session 208737:518 time: 1759 us hw 1744 us

  1. The VPU exists independently of the CPU and has its own frequency.

unable to set the parameters. even with sudo, permission denied

How about echo "your text" | sudo tee /path/to/file? Does this work for you?

Yes. Thank you it does. why does it work like that but not with sudo echo “” > blahblah?

do these timings look ok to you?

[24856.805888] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 5280 us
[24856.812601] rk_vcodec: fdc38100.rkvdec-core:0 session 52342:231 time: 11603 us
[24856.815744] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 9821 us
[24856.833615] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 3319 us
[24856.834094] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 3495 us
[24856.837181] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 3518 us
[24856.886055] rk_vcodec: fdc48100.rkvdec-core:1 session 52333:233 time: 1374 us
[24856.886086] rk_vcodec: fdc38100.rkvdec-core:0 session 52333:233 time: 1404 us
[24856.887615] rk_vcodec: fdc48100.rkvdec-core:1 session 52333:233 time: 1492 us
[24856.927892] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1585 us
[24856.927971] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1527 us
[24856.928156] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14437 us
[24856.929472] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1534 us
[24856.944004] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14581 us
[24856.959809] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14561 us
[24857.002438] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 6410 us
[24857.004238] rk_vcodec: fdc38100.rkvdec-core:0 session 52342:231 time: 7733 us
[24857.008180] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 5680 us
[24857.065544] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1933 us
[24857.065566] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1812 us
[24857.067200] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1611 us
[24857.093227] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14432 us
[24857.108616] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14427 us
[24857.123925] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14430 us
[24857.130633] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 2237 us
[24857.130717] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 2184 us
[24857.132287] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1604 us
[24857.140680] rk_vcodec: fdc38100.rkvdec-core:0 session 52333:233 time: 1468 us
[24857.142978] rk_vcodec: fdc48100.rkvdec-core:1 session 52333:233 time: 3142 us
[24857.143008] rk_vcodec: fdc38100.rkvdec-core:0 session 52333:233 time: 2298 us
[24857.245686] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 6228 us
[24857.247382] rk_vcodec: fdc38100.rkvdec-core:0 session 52342:231 time: 7486 us
[24857.251207] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 5496 us
[24857.261230] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14507 us
[24857.268841] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1958 us
[24857.269110] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 2038 us
[24857.270672] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1777 us
[24857.276649] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14274 us
[24857.291491] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14379 us
[24857.306737] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14570 us
[24857.329558] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1881 us
[24857.329842] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1932 us
[24857.331293] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1708 us
[24857.413542] rk_vcodec: fdc38100.rkvdec-core:0 session 52342:231 time: 6240 us
[24857.415281] rk_vcodec: fdc48100.rkvdec-core:1 session 52342:231 time: 7795 us
[24857.419173] rk_vcodec: fdc38100.rkvdec-core:0 session 52342:231 time: 5609 us
[24857.429317] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14582 us
[24857.444753] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14502 us
[24857.445557] rk_vcodec: fdc48100.rkvdec-core:1 session 52333:233 time: 1847 us
[24857.445576] rk_vcodec: fdc38100.rkvdec-core:0 session 52333:233 time: 1818 us
[24857.447019] rk_vcodec: fdc48100.rkvdec-core:1 session 52333:233 time: 1415 us
[24857.460377] rk_vcodec: fdbd0000.rkvenc-core:0 session 52342:154 time: 14513 us
[24857.470002] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 2100 us
[24857.470561] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 2159 us
[24857.472000] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1937 us
[24857.542826] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1966 us
[24857.542942] rk_vcodec: fdc38100.rkvdec-core:0 session 52338:229 time: 1989 us
[24857.544418] rk_vcodec: fdc48100.rkvdec-core:1 session 52338:229 time: 1567 us

That is because you don’t really have root privileges if you just echo stuff (not sure why, probably it has something to do with stdout not being “sudo”)

Here is the explanation: https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr

Because the output of the sudo command is being redirected to blahblah. sudo is run with the users credentials. Only the command run by sudo is run with higher privileges, but that output is going back to the sudo command executable and not being redirected to blahblah.

1 Like