Page 1 of 1

在进行rv1106开发遇到的RKNN推理问题

Posted: 2026-01-29 14:25
by lomus0003
我使用了两块板卡进行了分别验证,分别是Luckfox Pico Ultra W和Luckfox Pico Zero。按理来说除了板卡pcb和摄像头不同之外,其他硬件均相同配置,但使用Luckfox Pico Ultra W配合MIS5001 5MP Camera广角镜头时能够正常复现 luckfox_pico_rtsp_yolov5_demo非常流畅、检测速度快、帧率也比较高,奇怪的是使用Luckfox Pico Zero配合IMX415镜头同样复现 luckfox_pico_rtsp_yolov5_demo却出现卡顿报错情况,具体报错内容如下:
---------
[root@luckfox luckfox_pico_rtsp_yolov5_demo]# ./luckfox_pico_rtsp_yolov5
Stop Application ...
killall: rkipc: no process killed
killall: udhcpc: no process killed
rkipc exit
ls: /oem/usr/etc/init.d/S??*: No such file or directory
index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
index=0, name=output0, n_dims=4, dims=[1, 80, 80, 255], n_elems=1632000, size=1632000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
index=1, name=286, n_dims=4, dims=[1, 40, 40, 255], n_elems=408000, size=408000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
index=2, name=288, n_dims=4, dims=[1, 20, 20, 255], n_elems=102000, size=102000, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
model is NHWC input fmt
model input height=640, width=640, channel=3
init rknn model success!
load lable ./model/coco_80_labels_list.txt
Create Pool success !
rkaiq log level ff1
XCORE:K:rk_aiq_init_lib, ISP HW ver: 32
XCORE:K:
************************** VERSION INFOS **************************
version release date: 2024-2-18
AIQ: AIQ v5.0x5.0

git logs:
25bd14e RV1106: smart_door: release rga/isp/mpp for V1.3.0
99d080a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.2
6458e2a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.1
e8dab39 RV1106: CVR: release rga/isp/mpp for V1.1.0
a021b32 RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.0

************************ VERSION INFOS END ************************

ID: 0, sensor_name is m00_b_imx415 4-0037, iqfiles is /etc/iqfiles
XCORE:K:rk_aiq_uapi_sysctl_preInit_devBufCnt: dev_ent:rkraw_rx, buf_cnt:2
XCORE:E:invalid main scene len!

IPCSERVER:K:cid[0] Process path:/tmp/UNIX.domain0, sockfd:23
XCORE:K:cid[0] rk_aiq_uapi_sysctl_init success. iq:/etc/iqfiles/imx415_CMK-OT2022-PX1_IR0147-36IRC-8M-F20.json
XCORE:K:cid[0] rk_aiq_uapi_sysctl_prepare success. mode:0
rk_aiq_uapi2_sysctl_init/prepare succeed
CAMHW:K:cid[0] start success. isGroup:0, isOnline:0, isMultiIsp:1, init_ens:0x1bfc8ffe472b
XCORE:K:cid[0] rk_aiq_uapi_sysctl_start success.
rk_aiq_uapi2_sysctl_start succeed
rockit log path (null), log_size = 0, can use export rt_log_path=, export rt_log_size= change
log_file = (nil)
RTVersion 22:18:12-328 {dump :064} ---------------------------------------------------------
RTVersion 22:18:12-329 {dump :065} rockit version: git-4720dc10a Tue Apr 30 15:47:55 2024 +0800
RTVersion 22:18:12-329 {dump :066} rockit building: built- 2024-04-30 15:53:43
RTVersion 22:18:12-330 {dump :067} ---------------------------------------------------------
(null) 22:18:12-330 {log_level_init :207}

please use echo name=level > /tmp/rt_log_level set log level
name: all cmpi mb sys vdec venc rgn vpss vgs tde avs wbc vo vi ai ao aenc adec
log_level: 0 1 2 3 4 5 6

rockit default level 4, can use export rt_log_level=x, x=0,1,2,3,4,5,6 change
(null) 22:18:12-331 {read_log_level :098} text is all=4
(null) 22:18:12-331 {read_log_level :100} module is all, log_level is 4
[INFO rtsp_demo.c:280:rtsp_new_demo] rtsp server demo starting on port 554
(null) 22:18:12-336 {monitor_log_level :149} #Start monitor_log_level thread, arg:(nil)
[DEBUG rtsp_demo.c:480:rtsp_new_session] add session path: /live/0
rtsp streamq_alloc size is 1753484
vi_dev_init
RKViDev 22:18:12-338 {vi_set_dev_attr :612} VI_DEV_ATTR_S all parameter reserved
RTIsp3x 22:18:12-341 {ispInitDevice :591} sensor name = m00_b_imx415 4-0037
RTDeviceSensorV4 22:18:12-343 {ispOpenDevice :502} v4l2_open(/dev/video0), handler=58
RTDeviceSensorV4 22:18:12-343 {ispOpenDevice :502} v4l2_open(/dev/v4l-subdev2), handler=60
RTDeviceSensorV4 22:18:12-344 {close :112} do RTDeviceSensorV4L2 close
RTDeviceSensorV4 22:18:12-345 {close :112} do RTDeviceSensorV4L2 close
RKViChn 22:18:12-346 {prepareRuntime :354} ---------------------------------------------------------
RKViChn 22:18:12-346 {prepareRuntime :356} vi version: 1.22, name:vvi
RKViChn 22:18:12-346 {prepareRuntime :357} rockit-ko version: vmpi:28ee389dbc33
RKViChn 22:18:12-347 {prepareRuntime :358} rockit-ko building: -2024-05-24-18:15:06
RKViChn 22:18:12-347 {prepareRuntime :359} ---------------------------------------------------------
cmpi 22:18:12-347 {prepareRuntime :378} mb pool create success, MBCnt= 2
RTIsp3x 22:18:12-349 {ispInitDevice :591} sensor name = m00_b_imx415 4-0037
cmpi 22:18:12-351 {createRuntime :634} >>>>>>>>> Sensor link info dump: <<<<<<<<<
cmpi 22:18:12-351 {createRuntime :636} vicap media name : /dev/media0
cmpi 22:18:12-351 {createRuntime :637} vicap model name : rkcif-mipi-lvds
cmpi 22:18:12-351 {createRuntime :638} camera id : 0
cmpi 22:18:12-351 {createRuntime :639} sensor name : m00_b_imx415 4-0037
cmpi 22:18:12-352 {createRuntime :641} stream_cif_mipi_id0 video name: /dev/video0
cmpi 22:18:12-352 {createRuntime :642} stream_cif_mipi_id1 video name: /dev/video1
cmpi 22:18:12-352 {createRuntime :643} stream_cif_mipi_id2 video name: /dev/video2
cmpi 22:18:12-352 {createRuntime :644} stream_cif_mipi_id3 video name: /dev/video3
cmpi 22:18:12-352 {createRuntime :646} sensor raw width : 3864
cmpi 22:18:12-352 {createRuntime :647} sensor raw height : 2192
cmpi 22:18:12-353 {createRuntime :648} ---------------------------------------------------------
cmpi 22:18:12-353 {createRuntime :654} isp media name : /dev/media1
cmpi 22:18:12-353 {createRuntime :655} isp model name : rkisp0
cmpi 22:18:12-353 {createRuntime :656} isp driver name : rkisp-unite0
cmpi 22:18:12-354 {createRuntime :657} isp dev name : /dev/v4l-subdev4
cmpi 22:18:12-354 {createRuntime :659} isp rawrd0_m_path : /dev/video17
cmpi 22:18:12-354 {createRuntime :660} isp rawrd1_l_path :
cmpi 22:18:12-355 {createRuntime :661} isp rawrd2_s_path : /dev/video18
cmpi 22:18:12-355 {createRuntime :664} mainpath video name : /dev/video11
cmpi 22:18:12-355 {createRuntime :665} selfpath video name : /dev/video12
cmpi 22:18:12-355 {createRuntime :666} bypasspath video name : /dev/video13
cmpi 22:18:12-356 {createRuntime :667} sensor link type : 2
cmpi 22:18:12-356 {createRuntime :668} sensor is united : 1
cmpi 22:18:12-356 {createRuntime :672} ---------------------------------------------------------
cmpi 22:18:12-356 {createRuntime :711} [non-WRAP MODE]: buff size = 518400
RTIsp3x 22:18:12-359 {ispInitDevice :591} sensor name = m00_b_imx415 4-0037
RTDeviceV4L2 22:18:12-361 {open :137} cameraIndex:0, entityName:rkisp_mainpath
RTDeviceV4L2 22:18:12-361 {open :143} open video name(/dev/video11)
RKViChn 22:18:12-361 {setFrameRate :1469} [vi] dev(0) ch(0) illegal param s32SrcFrameRate(0) s32DstFrameRate(0)
RTDeviceV4L2 22:18:12-362 {ispCameraInfo :567} current device:/dev/video11 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
RTDeviceV4L2 22:18:12-362 {ispInitFormat :767} ioctl VIDIOC_S_FMT OK
cmpi 22:18:12-363 {start :1093} =========== vi Start startRuntime ===========
RTDeviceV4L2 22:18:12-363 {ispStreamOn :458} do ispStreamOn start
CAMHW:K:camId:0, notify_isp_stream_status on
RTDeviceV4L2 22:18:12-367 {ispStreamOn :511} do ispStreamOn done
venc_init
MpiAdapterEncode 22:18:12-368 {ma_encode_create :1743} ringbuf buf_size 520192
MpiAdapterEncode 22:18:12-372 {ma_encode_create :1782} mem_fd = 64
venc init success
=== 0 ===
=== 1 ===
cmpi 22:18:12-567 {mb_get_buffer_by_i:433} allocated buffer(this=0x54f428, data=(nil), size=0, id=-1)
cmpi 22:18:12-568 {getFrameRuntime :1347} -------------------------------vviBuf->buf_size: 520192
person @ (310 -2 716 482) 0.471
MpiAdapterEncode 22:18:12-766 {ma_encode_get_pack:2079} map ptr: 0xa2409000, fd 70
[DEBUG utils.c:134:rtsp_codec_data_parse_from_user_h264] sps 29
[DEBUG utils.c:142:rtsp_codec_data_parse_from_user_h264] pps 4
cmpi 22:18:12-770 {mb_get_buffer_by_i:433} allocated buffer(this=0x550dd0, data=(nil), size=0, id=-1)
cmpi 22:18:12-771 {getFrameRuntime :1347} -------------------------------vviBuf->buf_size: 520192
AF:E:the time to wait motor move is too long, force stable
E RKNN: failed to submit!, op id: 29, op name: Conv:/model.6/cv3/conv/Conv, task start: 0, task number: 273, run task counter: 119, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (PWD: rknn)
rknn_run fail! ret=-1
person @ (310 -2 716 482) 0.471
person @ (315 0 718 473) 0.663
person @ (490 3 720 477) 0.715
person @ (230 7 720 477) 0.338
person @ (24 -6 718 474) 0.537
person @ (18 4 720 472) 0.292
person @ (370 -6 720 339) 0.444
person @ (363 2 720 470) 0.511
E RKNN: failed to submit!, op id: 45, op name: Conv:/model.9/cv2/conv/Conv, task start: 0, task number: 273, run task counter: 148, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (PWD: rknn)
rknn_run fail! ret=-1
person @ (363 2 720 470) 0.511
person @ (256 -3 713 471) 0.283
person @ (22 0 720 468) 0.373
E RKNN: failed to submit!, op id: 29, op name: Conv:/model.6/cv3/conv/Conv, task start: 0, task number: 273, run task counter: 120, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (PWD: rknn)
rknn_run fail! ret=-1
person @ (22 0 720 468) 0.373
E RKNN: failed to submit!, op id: 29, op name: Conv:/model.6/cv3/conv/Conv, task start: 0, task number: 273, run task counter: 119, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (PWD: rknn)
rknn_run fail! ret=-1
person @ (22 0 720 468) 0.373
E RKNN: failed to submit!, op id: 10, op name: Conv:/model.3/conv/Conv, task start: 0, task number: 273, run task counter: 72, int status: 0, please try updating to the latest version of the toolkit2 and runtime from: https://console.zbox.filez.com/l/I00fc3 (PWD: rknn)
rknn_run fail! ret=-1
person @ (22 0 720 468) 0.373
person @ (256 5 718 474) 0.261
person @ (266 9 716 470) 0.439
person @ (200 21 720 465) 0.342
person @ (313 1 720 470) 0.833

---------
我尝试了/etc/iqfiles/imx415....json文件中进行分辨率更改,模型大小从640*640降到320*320以及DISP_WIDTH/DISP_LENGTH缩小都无法根除问题,只能降低问题出现的频率,且基本上问题出现成周期性、每次移动摄像头视野中出现新物体也会出现上述报错,温度过高似乎也会出现类似问题。
使用dmesg | grep -i rknpu可以输出如下日志:
---------
[root@luckfox luckfox_pico_rtsp_yolov5_demo]# dmesg | grep -i rknpu
[ 411.485395] RKNPU: core 0 irq status: 0x0, raw status: 0xc0000, require mask: 0x300, task counter: 0x94, elapsed time: 6144191us
[ 411.605349] RKNPU: soft reset
[ 418.405395] RKNPU: job: 3967034d, wait_count: 1, continue_wait: 0, commit time: 6376526us, wait time: 6376533us, timeout time: 6000000us
[ 418.405424] RKNPU: failed to wait job, task counter: 120, flags: 0x1, ret = 0, elapsed time: 6376587us
[ 418.525377] RKNPU: job timeout, flags: 0x0:
[ 418.525416] RKNPU: core 0 irq status: 0x0, raw status: 0xc0000, require mask: 0x300, task counter: 0x78, elapsed time: 6496576us
[ 418.645361] RKNPU: soft reset
[ 424.805377] RKNPU: job: 3967034d, wait_count: 1, continue_wait: 0, commit time: 6086002us, wait time: 6086008us, timeout time: 6000000us
[ 424.805414] RKNPU: failed to wait job, task counter: 119, flags: 0x1, ret = 0, elapsed time: 6086079us
[ 424.925365] RKNPU: job timeout, flags: 0x0:
[ 424.925414] RKNPU: core 0 irq status: 0x0, raw status: 0xc0000, require mask: 0x300, task counter: 0x77, elapsed time: 6206075us
[ 425.045400] RKNPU: soft reset
[ 431.205409] RKNPU: job: 3967034d, wait_count: 1, continue_wait: 0, commit time: 6092794us, wait time: 6092801us, timeout time: 6000000us
[ 431.205445] RKNPU: failed to wait job, task counter: 72, flags: 0x1, ret = 0, elapsed time: 6092869us
[ 431.325375] RKNPU: job timeout, flags: 0x0:
[ 431.325420] RKNPU: core 0 irq status: 0x0, raw status: 0x0, require mask: 0x300, task counter: 0x48, elapsed time: 6212840us
[ 431.446578] RKNPU: soft reset
[ 438.885350] RKNPU: job: fea1b997, wait_count: 1, continue_wait: 0, commit time: 6618192us, wait time: 6618197us, timeout time: 6000000us
[ 438.885378] RKNPU: failed to wait job, task counter: 68, flags: 0x1, ret = 0, elapsed time: 6618248us
[ 439.005332] RKNPU: job timeout, flags: 0x0:
[ 439.005356] RKNPU: core 0 irq status: 0x0, raw status: 0xc0000, require mask: 0x300, task counter: 0x44, elapsed time: 6738225us
[ 439.125326] RKNPU: soft reset
[root@luckfox luckfox_pico_rtsp_yolov5_demo]#
---------

奇怪的就在这里,为什么Ultra运行的很好,Zero却不行呢(分别按照手册进行的编译【SDK】)

PS: 我发现Zero的CMA在烧录时配置的是100M,而Ultra W是66M,是否与这个有关系呢?

比较着急,麻烦尽快技术支持一下!

Re: 在进行rv1106开发遇到的RKNN推理问题

Posted: 2026-01-30 1:21
by Crocodile
您好,这两款摄像头分辨率不一样,RV1106合并两个VI组件跑满ISP上加CPU升频才勉强能够使用IMX415跑15fps, 再跑yolov5 这种后处理有较大CPU占用的场景CPU和DDR都吃不消,想要解决卡顿流畅性问题是没有办法了,要解决报错频繁可以考虑修改设备树降频NPU,减少NPU处理时出现的内存问题误报算子运行错误,修改$/SDK/sysdrv/source/kernel/arch/arm/boot/dts/rv1106g-luckfox-pico-zero.dts

Code: Select all

&npu {
        assigned-clock-rates = <700000000>;
};
可以直接注释用默认配置或者改低数值

Re: 在进行rv1106开发遇到的RKNN推理问题

Posted: 2026-01-30 2:44
by pointer
不清楚你使用 zero 板时,是否将 NPU 频率设置到了 700Mhz?我之前也入手过 zero 板,当时把这款板子的 NPU 频率拉到 700Mhz 后,就出现了和你类似的问题。
这个问题的出现大概率有两种可能:
1.芯片体质差异。我实际测试过,不管是 RV1106G2 还是 RV1106G3,都有能把 NPU 频率拉到 700Mhz 且稳定运行的情况;但同时也遇到过 RV1106G3 拉高频率后无法正常使用的情况。
2.PCB 设计问题。我自己绘制过两版 PCB,核心区别就在各路电源的走线设计上。第一版是严格按照官方硬件设计指南的要求绘制的,NPU 频率在 420Mhz 时使用完全无问题,可一旦拉到 700Mhz,就会出现你遇到的这类问题。之后我做了第二版 PCB,直接将所有电源走线的规格翻倍,把第一版上的同一颗芯片拆下来焊接到第二版上后,NPU 拉高频就能正常使用了。目前我还不确定具体是哪一路电源走线带来的影响,也有可能是第一版的电源回路本身存在问题,不过能确定的是,PCB 设计会直接影响 NPU 拉高频率后的使用效果。
至于你的 zero 板具体是哪种原因导致的问题,我因为只买过一块,没法给出确定结论,但按常理来说,将 NPU 频率保持在基础的 420Mhz,使用上应该是不会有问题的。

Re: 在进行rv1106开发遇到的RKNN推理问题

Posted: 2026-02-02 0:34
by lomus0003
Crocodile wrote: 2026-01-30 1:21 您好,这两款摄像头分辨率不一样,RV1106合并两个VI组件跑满ISP上加CPU升频才勉强能够使用IMX415跑15fps, 再跑yolov5 这种后处理有较大CPU占用的场景CPU和DDR都吃不消,想要解决卡顿流畅性问题是没有办法了,要解决报错频繁可以考虑修改设备树降频NPU,减少NPU处理时出现的内存问题误报算子运行错误,修改$/SDK/sysdrv/source/kernel/arch/arm/boot/dts/rv1106g-luckfox-pico-zero.dts

Code: Select all

&npu {
        assigned-clock-rates = <700000000>;
};
可以直接注释用默认配置或者改低数值
好的谢谢改420MHz可以用了

Re: 在进行rv1106开发遇到的RKNN推理问题

Posted: 2026-02-02 0:40
by lomus0003
pointer wrote: 2026-01-30 2:44 不清楚你使用 zero 板时,是否将 NPU 频率设置到了 700Mhz?我之前也入手过 zero 板,当时把这款板子的 NPU 频率拉到 700Mhz 后,就出现了和你类似的问题。
这个问题的出现大概率有两种可能:
1.芯片体质差异。我实际测试过,不管是 RV1106G2 还是 RV1106G3,都有能把 NPU 频率拉到 700Mhz 且稳定运行的情况;但同时也遇到过 RV1106G3 拉高频率后无法正常使用的情况。
2.PCB 设计问题。我自己绘制过两版 PCB,核心区别就在各路电源的走线设计上。第一版是严格按照官方硬件设计指南的要求绘制的,NPU 频率在 420Mhz 时使用完全无问题,可一旦拉到 700Mhz,就会出现你遇到的这类问题。之后我做了第二版 PCB,直接将所有电源走线的规格翻倍,把第一版上的同一颗芯片拆下来焊接到第二版上后,NPU 拉高频就能正常使用了。目前我还不确定具体是哪一路电源走线带来的影响,也有可能是第一版的电源回路本身存在问题,不过能确定的是,PCB 设计会直接影响 NPU 拉高频率后的使用效果。
至于你的 zero 板具体是哪种原因导致的问题,我因为只买过一块,没法给出确定结论,但按常理来说,将 NPU 频率保持在基础的 420Mhz,使用上应该是不会有问题的。
收到谢谢,感觉的确跟pcb设计有关系,Ultra也是同样的RV1106G3仍然能够700MHz稳定运行,而Zero却不行