Monday, May 12, 2025

Rockchip NPU update 5: Progress on the kernel driver

 It has been almost a year since my last update on the Rockchip NPU, and though I'm a bit sad that I haven't had more time to work on it, I'm happy that I found some time earlier this year for this.

Quoting from my last update on the Rockchip NPU driver:

The kernel driver is able to fully use the three cores in the NPU, giving us the possibility of running 4 simultaneous object detection inferences such as the one below on a stream, at almost 30 frames per second.


 

All feedback has been incorporated in a new revision of the kernel driver and it was submitted to the Linux kernel mailing list.

Though I'm very happy with the direction the kernel driver is taking, I would have liked to make faster progress on it. I have spent the time since the first revision on making the Etnaviv NPU driver ready to be deployed in production (will be blogging about this soon), and also had to take some non-upstream work to pay my bills.

Next I plan to cleanup the userspace driver so it's ready for review, and then I will go for a third revision of the kernel driver.

4 comments:

  1. Thank you for the information, can you share how to update NPU driver for rk3588 ?

    ReplyDelete
  2. Thank you for your work!

    ReplyDelete
  3. Great work! :)

    Maybe someone can point me into the right direction.. I'm using gentoo-linux on rock 5b+ (EFI v2.7 by EDK II) 6.15.3 - fully patched + dtd) but sadly getting this error when try to run the example from libteflon(mesa-git patched as well, of course):
    dmesg: [ 41.492600] rocket fdab0000.npu: gpu sched timeout <- (system stalls after that)
    teflon: compiled graph, took 5 ms

    nvm. will dig further - but again, great work! :)

    ReplyDelete
  4. got it working on Rock5b+ .. (YAY!)

    idx type inputs outputs operation type-specific
    ================================================================================================
    0 CONV 0,3,2 1

    teflon: compiled graph, took 6 ms
    teflon: invoked graph, took 14 ms
    teflon: invoked graph, took 1 ms
    teflon: invoked graph, took 12 ms
    teflon: invoked graph, took 1 ms
    teflon: invoked graph, took 11 ms
    teflon: invoked graph, took 1 ms
    teflon: invoked graph, took 12 ms
    teflon: invoked graph, took 0 ms
    teflon: invoked graph, took 13 ms
    teflon: invoked graph, took 0 ms
    0.901961: military uniform
    0.023529: Windsor tie
    0.011765: mortarboard
    0.007843: bulletproof vest
    0.003922: cornet
    time: 12.639ms

    ReplyDelete