Friday, April 19, 2024

Rockchip NPU update 3: Real-time object detection on RK3588

Progress

Yesterday I managed to implement in my open-source driver all the remaining operations so the SSDLite MobileDet model can run on Rockchip's NPU in the RK3588 SoC.

Performance is pretty good at 30 frames per second when using just one of the 3 cores that the NPU contains.


 I uploaded the generated video to YouTube at:

You can get the source code at my branch here.

 

Next steps

Now that we got to this level of usefulness, I'm going to switch to writing a kernel driver suited for inclusion into the Linux kernel, to the drivers/accel subsystem.

There is still lots of work to do, but progress is going pretty fast, though as I write more drivers for different NPUs I will have to split my time among them. At least, until we get more contributors! :)

6 comments:

Anonymous said...

Might Jasbir's work provide some additional helpful information? https://jas-hacks.blogspot.com/2024/02/rk3588-reverse-engineering-rknn.html

Tomeu Vizoso said...

> Might Jasbir's work provide some additional helpful information? https://jas-hacks.blogspot.com/2024/02/rk3588-reverse-engineering-rknn.html

Yep, I have been in contact with him since I started working on this.

Tomeu Vizoso said...

> Loading external delegate from ./build/src/gallium/targets/teflon/libteflon.so with args: {}
> rknpu: driver missing
> Segmentation fault
>
> Any idea what I missed out. Thanks.

Maybe you haven't loaded the kernel driver?

segabor said...

Linux kernel is aware of the presence

cat /sys/kernel/debug/rknpu/version
RKNPU driver: v0.9.2

however I wasn't able to find it in module list (lsmod). I wonder if the driver is not bundled with the Ubuntu version I installed to RK1.

segabor said...

Dumb me, google helped. I found the source here https://github.com/airockchip/rknn-llm/tree/main/rknpu-driver
I only need to figure out how to build it from source.

StuartIanNaylor said...

Do the cores not scale well or just not implemented yet?
"when using just one of the 3 cores that the NPU contains"