I’m testing the zero 3W with imx219 and NPU using ffmpeg and sdl2.
In this experiment, i used the ff-rknn with pure ffmpeg to capture the frames from imx219 and tried to detect the objects in real-time using YOLOv5s.
While i can grab the frames using ffplay and display it at 30 FPS i had some latency on inference, resulting in a very low FPS.
This is my first attempt to use NPU on this board, so i need to figure out what is wrong with my setup.
Good news it worked, bad news it was really slow.
I checked the npu health during the experiment, and it looks like this (1920x1080):
root@rzero-3w:/home/rock# cat /sys/kernel/debug/rknpu/freq
198000000
root@rzero-3w:/home/rock# cat /sys/kernel/debug/rknpu/load
NPU load: 63%
root@rzero-3w:/home/rock# cat /sys/kernel/debug/rknpu/version
RKNPU driver: v0.8.8
root@rzero-3w:/home/rock# cat /sys/devices/virtual/thermal/thermal_zone1/temp
70000
root@rzero-3w:/home/rock# cat /sys/devices/virtual/thermal/thermal_zone0/temp
71666
Frame size of 640x480 i get FPS: 5.1
Frame size of 1920x1080:
./ff-rknn-v4l2 -f v4l2 -p nv12 -s 1920x1080 -i /dev/video0 -x 1920 -y 1080 -b 28 -a 40 -m ./model/RK356X/yolov5s-640-640.rknn
Model: ./model/RK356X/yolov5s-640-640.rknn - size: 8073664.
sdk version: 1.4.0 (a10f100eb@2022-09-09T09:07:14) driver version: 0.8.8
model input num: 1, output num: 3
model: 640x640x3
[video4linux2,v4l2 @ 0xaaaaf8b5ea60] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0xaaaaf8b5ea60] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0xaaaaf8b5ea60] Time per frame unknown
[video4linux2,v4l2 @ 0xaaaaf8b5ea60] Stream #0: not enough frames to estimate rate; consider increasing probesize
INFO: SDL: compiled with=2.30.0 linked against=2.30.0
arm_release_ver of this libmali is 'g2p0-01eac0', rk_so_ver is '10'.
rga_api version 1.3.2_[0] (RGA is compiling with meson base: $PRODUCT_BASE)
loadLabelName ./model/coco_80_labels_list.txt
^[INFO: Program quit after 27939 ticks
Avg FPS: 3.6
This was not running with “performance” governor, to mitigate “throttle” or Temp issues…
Maybe someone got better results, which means something is wrong with my setup.
Note 1:
I was able to run rknpu at 396000000 which got 5 FPS (1920x1080)
Note 2:
Running “performance” governor
get 5.5 ~ 6 FPS (1920x1080)
Note 3:
No improvement yet.
cat /sys/class/devfreq/fde40000.npu/cur_freq
900000000
cat /sys/class/devfreq/fde60000.gpu/cur_freq
400000000