Failed to execute "NPU Run Test"

Hi, Team,
I failed to execute the following test for Rock3A,
NPU Run Test
.

Please help me on this error of “Connection timed out”.

root@rock3a:/home/rock/rknn2_ssd_demo_Linux# ./rknn_ssd_demo model/ssd_inception_v2.rknn model/road.bmp
Loading model …
rknn_init …
I RKNN: set log level to 0
model input num: 1, output num: 2
input tensors:
index=0 name=Preprocessor/sub:0 n_dims=4 dims=[1 300 300 3] n_elems=270000 size=270000 fmt=0 type=3 qnt_type=2 fl=0 zp=0 scale=0.007812
output tensors:
index=0 name=concat:0 n_dims=4 dims=[1 1917 1 4] n_elems=7668 size=30672 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.089455
index=1 name=concat_1:0 n_dims=4 dims=[1 1917 91 1] n_elems=174447 size=697788 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.143593
rknn_run
E RKNN: [23:18:04.111] failed to submit!, op id: 1, op name: Conv, int status: 0, errno: Connection timed out
rknn_run fail! ret=-1

Thanks.

npu probem is a known issue, you can wait for next version image and then check again

Thank you for your quick reply. Good to know that.

It requires some changes in the u-boot to power on the NPU, we are working on the fix right now.

How is it going,seems i use the latest version debian 10 got the same issue

【system information】
root@rock-3a:/home/rock/rknn_ssd_demo_Linux# uname -a
Linux rock-3a 4.19.193-26-rockchip-gfc6004006609 #rockchip SMP Fri Dec 31 11:49:20 UTC 2021 aarch64 GNU/Linux
root@rock-3a:/home/rock/rknn_ssd_demo_Linux#

【isse details】
root@rock-3a:/home/rock/rknn_ssd_demo_Linux# ./rknn_ssd_demo model/ssd_inception_v2.rknn model/road.bmp
Loading model …
rknn_init …
model input num: 1, output num: 2
input tensors:
index=0 name=Preprocessor/sub:0 n_dims=4 dims=[1 300 300 3] n_elems=270000 size=270000 fmt=0 type=3 qnt_type=2 fl=0 zp=0 scale=0.007812
output tensors:
index=0 name=concat:0 n_dims=4 dims=[1 1917 1 4] n_elems=7668 size=30672 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.089455
index=1 name=concat_1:0 n_dims=4 dims=[1 1917 91 1] n_elems=174447 size=697788 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.143593
rknn_run
E RKNN: [16:06:52.095] failed to submit!, op id: 1, op name: Conv:FeatureExtractor/InceptionV2/InceptionV2/Conv2d_1a_7x7/separable_conv2d/depthwise, flags: 0x5, task start: 0, task number: 15, run task counter: 0, int status: 0
rknn_run fail! ret=-1

Try again with these two commands? https://wiki.radxa.com/Rock3/dev/npu-run-test

# cd /home/rock/rknn_ssd_demo_Linux
# export LD_LIBRARY_PATH=./lib/
# ./rknn_ssd_demo model/ssd_inception_v2.rknn model/road.bmp
1 Like

Thanks for quick response ,I remember first time I already used this" export LD_LIBRARY_PATH=./lib/" command ,while investigating this issue , I found in the dmesg, got list information
RKNPU fde40000.npu: can’t request region for resource [mem 0xfde40000-0xfde4ffff]
in lshw I found cpu4 is disabled , I’m a new beginner for Rock3a and NPU related knowledge, I want to know if those 2 can cause NPU test failed in my case
in lshw ---- is this CPU 4 means NPU? or GPU?
-cpu:4 DISABLED
description: CPU
product: idle-states
physical id: 5
bus info: cpu@4
in dmesg— finally is RKNPU got memory allocated ?
98217] iommu: Adding device fde40000.npu to group 0
[ 4.603200] RKNPU fde40000.npu: Linked as a consumer to fde4b000.iommu
[ 4.608580] RKNPU fde40000.npu: RKNPU: rknpu iommu is enabled, using iommu mode
[ 4.613425] RKNPU fde40000.npu: Looking up rknpu-supply from device tree
[ 4.613512] RKNPU fde40000.npu: Linked as a consumer to regulator.15
[ 4.618213] RKNPU fde40000.npu: can’t request region for resource [mem 0xfde40000-0xfde4ffff]
[ 4.623499] [drm] Initialized rknpu 0.4.2 20210701 for fde40000.npu on minor 1
[ 4.628328] RKNPU fde40000.npu: leakage=3
[ 4.633544] RKNPU fde40000.npu: avs=0
[ 4.638899] RKNPU fde40000.npu: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0

seems not LD PATH issue ,I got the same error,
it is finally working follow the threads Lshw 显示cpu4 disable 是NPU吗?

root@rock-3a:/home/rock/rknn_ssd_demo_Linux# export LD_LIBRARY_PATH=./lib/
root@rock-3a:/home/rock/rknn_ssd_demo_Linux# ./rknn_ssd_demo model/ssd_inception_v2.rknn model/road.bmp
Loading model …
rknn_init …
model input num: 1, output num: 2
input tensors:
index=0 name=Preprocessor/sub:0 n_dims=4 dims=[1 300 300 3] n_elems=270000 size=270000 fmt=0 type=3 qnt_type=2 fl=0 zp=0 scale=0.007812
output tensors:
index=0 name=concat:0 n_dims=4 dims=[1 1917 1 4] n_elems=7668 size=30672 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.089455
index=1 name=concat_1:0 n_dims=4 dims=[1 1917 91 1] n_elems=174447 size=697788 fmt=0 type=0 qnt_type=2 fl=0 zp=53 scale=0.143593
rknn_run
E RKNN: [11:49:35.468] failed to submit!, op id: 1, op name: Conv:FeatureExtractor/InceptionV2/InceptionV2/Conv2d_1a_7x7/separable_conv2d/depthwise, flags: 0x5, task start: 0, task number: 15, run task counter: 0, int status: 0
rknn_run fail! ret=-1
root@rock-3a:/home/rock/rknn_ssd_demo_Linux#

I’ve did more test, seems the root cause is the dtb file

it is not a uboot fix

it is just the dtb

kernel 4.19.219 2022-01-18

the solution is

what is ?
dts
rknpu_reserved ?!
config
nocp ?!

RKNPU fde40000.npu: RKNPU: rknpu iommu is enabled, using iommu mode

[drm] Initialized rknpu 0.4.2 20210701 for fde40000.npu on minor 1

and you get

/rockchip_test/npu2/rknn_mobilenet_demo /rockchip_test/npu2/model/RK356X/mobilenet_v1.rknn /rockchip_test/npu2/model/dog_224x224.jpg

model input num: 1, output num: 1
input tensors:
index=0, name=data, n_dims=4, dims=[1, 224, 224, 3], n_elems=150528, size=150528, fmt=NHWC, type=UINT8, qnt_type=AFFINE, zp=-13, scale=0.018317
output tensors:
index=0, name=prob, n_dims=4, dims=[1, 1000, 1, 1], n_elems=1000, size=4000, fmt=NCHW, type=FP32, qnt_type=AFFINE, zp=0, scale=1.000000
rknn_run
— Top5 —
155: 0.820312
154: 0.084473
204: 0.084473
252: 0.001647
283: 0.001409

have fun :slight_smile: