Lshw 显示cpu4 disable 是NPU吗?

lshw 显示cpu 4 disable ,请问这颗cpu指的是哪颗,是NPU吗?

 *-cpu:4 DISABLED
      description: CPU
      product: idle-states
      physical id: 5
      bus info: cpu@4

在demesg中显示 NPU不能 request resgion for resource
root@rock-3a:/home/rock/rknn_ssd_demo_Linux# dmesg |grep RKNPU
[ 4.518416] RKNPU fde40000.npu: Linked as a consumer to fde4b000.iommu
[ 4.523758] RKNPU fde40000.npu: RKNPU: rknpu iommu is enabled, using iommu mode
[ 4.528651] RKNPU fde40000.npu: Looking up rknpu-supply from device tree
[ 4.528738] RKNPU fde40000.npu: Linked as a consumer to regulator.15
[ 4.533541] RKNPU fde40000.npu: can’t request region for resource [mem 0xfde40000-0xfde4ffff]
[ 4.543752] RKNPU fde40000.npu: leakage=3
[ 4.549072] RKNPU fde40000.npu: avs=0
[ 4.554605] RKNPU fde40000.npu: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[ 2391.545719] RKNPU: soft reset
root@rock-3a:/home/rock/rknn_ssd_demo_Linux#

运行npu demo 返回E RKNN: [16:39:54.041] failed to submit!, op id: 1
小白请问一下这三者之间有关联吗?
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
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

Linux rock-3a 4.19.193-26-rockchip-gfc6004006609 #rockchip SMP Fri Dec 31 11:49:20 UTC 2021 aarch64 GNU/Linux
debian10

我今天也遇到了这个问题,wiki提供的rknn example已经不能用了,我用rockchip最新的1.2版本编译后可以使用

1,安装编译所需依赖
sudo apt install git cmake build-essential

2,下载rockchip最新的rknpu2代码
git clone https://github.com/rockchip-linux/rknpu2

3,进入代码目录,创建build目录
cd rknpu2/examples/rknn_ssd_demo
mkdir build && cd build

4,修改CMakeLists.txt,防止编译出错
vim …/CMakeLists.txt
将23行的armhf改为aarch64

5,编译
cmake -DCMAKE_SYSTEM_NAME=Linux -DTARGET_SOC=rk356x …
make -j3

6,将model目录复制到build目录
cp -r …/model/ .

7,运行
./rknn_ssd_demo ./model/RK356X/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=NHWC, type=UINT8, qnt_type=AFFINE, 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=NHWC, type=FP32, qnt_type=AFFINE, 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=NHWC, type=FP32, qnt_type=AFFINE, zp=53, scale=0.143593
rknn_run
loadLabelName
ssd - loadLabelName ./model/coco_labels_list.txt
loadBoxPriors
person @ (13 125 59 212) 0.984696
person @ (110 119 152 197) 0.969119
bicycle @ (171 165 278 234) 0.969119
person @ (206 113 256 216) 0.964519
car @ (146 133 216 170) 0.959264
person @ (49 133 58 156) 0.606060
person @ (83 134 92 158) 0.606060
person @ (96 135 106 162) 0.464163

1 Like

谢谢啊 写的非常详细 我也找时间试一下 npu demo test应该是在官方的ubuntu debian上都可以跑的吧 好像从卖家还是哪里我记不清楚了 说是debian比较好支持,我debian不太熟 上午琢磨着是不是刷个ubuntu 呢

Thanks, following your guide ,it is finally working in my Rock 3A, Thanks

root@rock-3a:/home/rock/rknpu2/examples/rknn_ssd_demo/build# …/rknn_ssd_demo ./model/RK356X/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=NHWC, type=UINT8, qnt_type=AFFINE, 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=NHWC, type=FP32, qnt_type=AFFINE, 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=NHWC, type=FP32, qnt_type=AFFINE, zp=53, scale=0.143593
rknn_run
loadLabelName
ssd - loadLabelName ./model/coco_labels_list.txt
loadBoxPriors
person @ (13 125 59 212) 0.984696
person @ (110 119 152 197) 0.969119
bicycle @ (171 165 278 234) 0.969119
person @ (206 113 256 216) 0.964519
car @ (146 133 216 170) 0.959264
person @ (49 133 58 156) 0.606060
person @ (83 134 92 158) 0.606060
person @ (96 135 106 162) 0.464163