I didn’t need to recompile the kernel to get the NPU running, my method is as follows;
Flashed Debian CLI B39 image from here
Updated APT repository
apt update
Download the RKNN libraries built here
wget https://github.com/radxa-pkg/rknn2/releases/download/1.6.0-2/rknpu2-rk3588_1.6.0-2_arm64.deb
wget https://github.com/radxa-pkg/rknn2/releases/download/1.6.0-2/python3-rknnlite2_1.6.0-2_arm64.deb
wget https://github.com/radxa-pkg/rknn2/releases/download/1.6.0-2/python3-rknnlite2-example_1.6.0-2_all.deb
Install the packages downloaded
apt install ./rknpu2-rk3588_1.6.0-2_arm64.deb ./python3-rknnlite2_1.6.0-2_arm64.deb ./python3-rknnlite2-example_1.6.0-2_all.deb
Rebooted.
Then ran the inference test script;
cd /usr/share/python3-rknnlite2/resnet18/
python test.py
Which gives the output;
--> Load RKNN model
done
--> Init runtime environment
I RKNN: [02:31:33.412] RKNN Runtime Information, librknnrt version: 1.6.0 (9a7b5d24c@2023-12-13T17:31:11)
I RKNN: [02:31:33.413] RKNN Driver Information, version: 0.8.2
W RKNN: [02:31:33.413] Current driver version: 0.8.2, recommend to upgrade the driver to the new version: >= 0.8.8
I RKNN: [02:31:33.417] RKNN Model Information, version: 6, toolkit version: 1.6.0+81f21f4d(compiler version: 1.6.0 (585b3edcf@2023-12-11T07:42:56)), target: RKNPU v2, target platform: rk3588, framework name: PyTorch, framework layout: NCHW, model inference type: static_shape
W RKNN: [02:31:33.447] query RKNN_QUERY_INPUT_DYNAMIC_RANGE error, rknn model is static shape type, please export rknn with dynamic_shapes
W Query dynamic range failed. Ret code: RKNN_ERR_MODEL_INVALID. (If it is a static shape RKNN model, please ignore the above warning message.)
done
--> Running model
resnet18
-----TOP 5-----
[812] score:0.999676 class:"space shuttle"
[404] score:0.000249 class:"airliner"
[657] score:0.000014 class:"missile"
[833] score:0.000009 class:"submarine, pigboat, sub, U-boat"
[466] score:0.000009 class:"bullet train, bullet"
done