Skip to content

v1.5.1 — NPU actually works + Brave browser

Choose a tag to compare

@mack42 mack42 released this 07 May 23:02
· 27 commits to main since this release

What's new in v1.5.1

NPU support is actually working now

v1.5.0 shipped a half-finished NPU stack — the module loaded, the DT overlay was on disk, librknnrt.so was in /usr/lib, but /dev/rknpu never appeared and librknnrt couldn't talk to anything. v1.5.1 fixes the chain of issues required to make the vendor rknpu driver compile, bind to a DT node, and expose a misc device that librknnrt can actually open.

What had to be fixed (in order of discovery):

  1. DT overlay install path was wrong. Armbian's u-boot loads user_overlays= from /boot/overlay-user/, not /boot/dtb/rockchip/overlay/. v1.5.0 had the file in the wrong place, so u-boot silently skipped it, the upstream rknn_core_* nodes stayed at compatible = rockchip,rk3588-rknn-core, and our rknpu driver's match table never hit.

  2. Missing dt-bindings includes. The overlay referenced SCMI_CLK_NPU and SRST_A_RKNN_NODDR. The clock symbol exists in dt-bindings/clock/rockchip,rk3588-cru.h; the reset symbol doesn't exist in mainline at all (vendor BSP only). Added the clock include, dropped the resets ref + the optional npu_opp_table (not in mainline either).

  3. IRQ + PM-domain names were wrong. Driver looks up npu0_irq, npu1_irq, npu2_irq and PM domains npu0, npu1, npu2; overlay had npu_irq0/1/2 and nputop, npu1, npu2. Fixed to match upstream rknpu_drv.c lookups exactly.

  4. -DCONFIG_ROCKCHIP_RKNPU_DRM_GEM made the driver expose /dev/dri/cardN instead of /dev/rknpu. librknnrt.so only opens /dev/rknpu (the misc device). Switched the build to DMA_HEAP mode (mutually exclusive with DRM_GEM) by stripping the -D from upstream's Kbuild, adding -DCONFIG_ROCKCHIP_RKNPU_DMA_HEAP, and force-including rknpu_build_config.h to #undef DRM_GEM after autoconf.h runs.

  5. Missing rk-dma-heap.h header. Rockchip BSP-only API; mainline kernels don't ship it. Added a stub at src/include/compat/linux/rk-dma-heap.h with safe -ENODEV returns so the DMA_HEAP code path compiles and degrades to "no heap" at runtime (the misc device is registered regardless).

  6. rknpu_devfreq.c won't build. Armbian-current's kernel-headers package doesn't ship linux/devfreq-governor.h. Dropped rknpu_devfreq.o from the Kbuild obj list and added -DRKNPU_NO_DEVFREQ so the inline-stub path in rknpu_devfreq.h is taken everywhere. Loses DVFS — NPU runs at fixed clock — functional inference unaffected.

  7. rknpu_gem.c ungated fake_dev reference. rknpu_gem_sync_ioctl references rknpu_dev->fake_dev unconditionally, but the field is only declared under CONFIG_ROCKCHIP_RKNPU_DRM_GEM. The function is dead code in DMA_HEAP mode (never reached without a DRM device), but the compiler still type-checks it. Sed-swapped the three refs to ->dev.

  8. Upstream w568w/rknpu-module is missing rknpu_mem.c entirely. The memory-allocation ioctl backends rknpu_mem_create_ioctl, rknpu_mem_destroy_ioctl, rknpu_mem_sync_ioctl are declared in headers but never implemented. modpost failed with three "undefined symbol" errors. Vendored Talos's ~700-line from-scratch implementation (npu-patches/rknpu_mem.c, GPL-2.0) which provides them — IOVA cursor allocator, dma_alloc_noncontiguous(), graceful fallback when rk_dma_heap_find returns NULL.

Brave browser baked into the desktop image

Native arm64 .deb from Brave's official APT repo. Picked over Firefox because Ubuntu 26.04's snap-based Firefox is sluggish on RK3588; Brave's deb is responsive, supports VAAPI hardware video decode against the rockchip-vaapi we already build, and has a built-in ad blocker. Adds ~150 MB.

plasma-discover is also installed (came in via kubuntu-desktop's recommends — was already there in v1.5.0, just confirming).

Asset sizes

File Size v1.5.0 v1.4.3
*_desktop.img.xz ~923 MB 830 MB 758 MB
*_minimal.img.xz ~393 MB 421 MB 291 MB

Desktop grew ~93 MB — Brave browser plus the additional NPU patches (Talos's rknpu_mem.c, compat headers). Minimal shrank slightly vs v1.5.0 (better xz block alignment with the slightly different rootfs).

Verifying NPU after first boot

# Driver bound? Should show fdab0000.npu and three IRQs registered.
sudo dmesg | grep -i rknpu

# Misc device exposed?
ls /dev/rknpu

# Userspace runtime present?
ldconfig -p | grep librknnrt

# DT overlay applied?
cat /sys/firmware/devicetree/base/npu@fdab0000/compatible
# Should print: rockchip,rk3588-rknpurockchip,rknpu

If /dev/rknpu exists and compatible includes rockchip,rk3588-rknpu, the stack is functional and rknn-toolkit2 model inference will work.

Known limits (unchanged)

  • OpenGL Core profile capped at 3.1 (Mesa panthor maturity).
  • ffmpeg-vaapi -hwaccel vaapi doesn't work with woodyst/rockchip-vaapi 0.1; browser HW decode via libva still works.
  • 5 Pro is community-tier (CSC) in Armbian.
  • NPU runs at fixed clock (no DVFS) due to the missing linux/devfreq-governor.h workaround.
  • DT overlay drops srst_a reset (no soft-reset on probe) and npu_opp_table (no OPP-driven DVFS); cold-reset from boot works fine.
  • Mainline rocket driver is blacklisted because it's mutually exclusive with vendor rknpu. Can be swapped if you specifically want the rocket + Mesa Teflon path (only supports MobileNet-class models today).

Boot flow (unchanged)

  1. Flash with balenaEtcher (Pi Imager and Rufus have produced unbootable cards on this board).
  2. TTY login: armbian-firstrun walks you through root password, user creation, locale.
  3. Desktop image: SDDM/Plasma starts → kdialog wizard pops up → reboot lands in Plasma every time.
  4. Minimal image: motd shows the setup-reminder banner → run orangepi-setup at the text prompt.