I’m currently trying to get the NPU on my Orange Pi 5 Plus working to run various AI-related Docker projects, with a specific focus on getting the rkllama project up and running. I’m hoping to get some guidance or share experiences with anyone who might have attempted something similar.
My Hardware:
Device: Orange Pi 5 Plus (32GB RAM)
Storage: NVMe SSD
OS: DietPi v9.15.2
My Goal:
My plan is to use DietPi as the base OS, install OpenMediaVault (OMV) on top of it, and then use Docker to run several different containers. A primary goal is to leverage the NPU for performance in projects like rkllama.
What I’ve Tried So Far:
Unfortunately, I’ve already had a few unsuccessful attempts. I’ve tried this with the official Orange Pi image and also with Armbian, but in every case, I’ve failed to get access to the NPU driver from within the operating system or the Docker container.
I’m relatively new to the world of single-board computers with NPUs, so I’m still learning. My current setup is a Raspberry Pi 4 running OMV with a few Docker containers, and I’m looking to migrate and expand on my new Orange Pi.
Has anyone had success with accessing the NPU on the Orange Pi 5 Plus with a recent DietPi build? I would be very grateful for any help, tips, or pointers on how to get the driver recognized and passed through to Docker containers.
Hi,
Just installed v9.20.1 on OPi 5 Max and can’t get the NPU to work either, no kernel module present and it seems to be as if disabled by firmware… The vendor repo - RKlinux do have the driver, yet it doesn’t seem to be in the kernel (or initrd) image, or maybe disabled somehow?
TL;DR: Does modprobe brcmfmac actually work instead? While the driver is located below some Rockchip vendor subdir, and the chip is labelled AP6611, it is a Broadcom chip (indicated by the module name, but also clearly stated in source files). There is some info that the bcmdhd driver is actually an Android Broadcom WiFi driver, while Linux ships its brcmfmac. That wouldn’t be so surprising, since Rockchip had shared Android and Linux sources earlier, one of the issues with earlier Rockchip vendor kernels throwing a bunch of additional errors and warnings since Android-only flags were enabled. I gave them a hint a while ago related to some particular prominent multi-line warning caused by a flag that really made sense on Android only, and they separated sources with 5.10 IIRC. But I would not wonder if some (originally) Android drivers remained in the sources.
Let’s see, the two supplies it looks up are defined here:
This is the same for all RK3588 boards (with vendor kernel). The nodes are defined here:
There we have the regions it can’t request. And then it seems to retry 2 times, causing the “already present” errors from debugfs.
No idea, neither the driver nor those parts in the device trees (which are all the same across all boards) have seen any changed within 2 years. Do you have any overlays active? Also maybe try with an older kernel builds:
apt policy linux-image-vendor-rk35xx
Don’t forget to downgrade the linux-dtb-vendor-rk35xx package as well. Reminds me that I want to merge those two packages.
Didn’t use overlays (except the ones present in the images, if any). The board appears to be of “rev 1.1”, no idea if this may be the reason, but doubtful. The npu is initialized perfectly in the mainline - 6.18.0-edge-rockchip64: [ 0.997022] platform fdab0000.npu: Adding to iommu group 0 [ 0.998374] platform fdac0000.npu: Adding to iommu group 1 [ 0.999665] platform fdad0000.npu: Adding to iommu group 2 [ 10.949953] rocket fdab0000.npu: Rockchip NPU core 0 version: 1179210309 [ 10.950294] rocket fdac0000.npu: Rockchip NPU core 1 version: 1179210309 [ 10.950584] rocket fdad0000.npu: Rockchip NPU core 2 version: 1179210309
My bad about the vpu and hantro module mixup, it was a bad grep output very similar to npu initialization… Trying the modprobe brcmfmac on the edge has yielded only this:
[ 512.582827] usbcore: registered new interface driver brcmfmac
wlan didn’t turn up:(
Please, I beg of you to merge these two! Silly me tried to switch kernels using apt install, rendering the setup unbootable. Due to that, I must add that armbian’s Kernel menu is awesome, makes switching pretty automated.
P.S.
After witnessing armbian’s setup, I must extend deepest gratitude and respect to Michalng and the Team for all the efforts! Und a Happy New Year to everyone!
The TensorFlow Lite delegate Teflon also works as a liteRT backend for etnaviv
(VeriSilicon VIPNano NPU), which has long been upstream, as well as for the upcoming ethosu (Arm Ethos-U65/U85 NPU).
Though it might not contain all needed chip IDs. Always a problem with scattered sources patched independently, everyone adds own chip IDs and firmware paths as needed.
Happy to report that NPU (and Bluetooth) work out of the box on Opi5Max 6.19.3-edge-rockchip64 (mainline) - DietPi 10.1.2
Not happy to report that for wifi - building either of those drivers require broadcom-sta-* packages, no longer available for trixie or in backports, for some reason the ‘all’ arch build is not released any more. They’re there for Bookworm, but I prefer to stay on trixie edge since Collabora guys are making progress on the hardware features in rockchip.
There are some hacky packages for that sta driver I’ve seen around for trixie arm64 or ‘all’, but those dive too deep into the un land - unstable, unrepoducible, unupdateable, etc… so, no wifi for now
Thanks for the update and all the work on the releases!
So this Broadcom STA Wireless driver is the bcmdhd one, or a compatible one?
It contains a ~7 MiB wlc_hybrid.o_<arch> blob. Also the all package on Bookworm contains this blob only for amd64 and i386, so it likely never worked on ARM, even that it was installable. Since it is a blob, Debian cannot just build it for other architectures. So it is on Broadcom.
The wireless-tools package is also required in order to make use of these modules.
Is this meant literally, i.e. they do not support the nl80211 interface? We just got rid of wireless-tools with last release, with NanoPi Fire3 Linux 4.14 being the last SBC I know with onboard WiFi that does not support that standard . Anyway, not relevant as it cannot work on ARM.
This is not a contradiction: you can perfectly run edge Linux 6.19-rcX on Debian Bookworm. Would be interesting whether this Broadcom STA driver really works there, without a matching blob. If so, would be trivial to alter the package to make it installable on ARM.
I have also a question, here is the BCM4359 listed as PCIe device, but the AP6611 in the OPi 5 Max is using SDIO?
So I question myself, what is the AP6611 BT/Wifi module?
What is it’s hw ID? lspci -nn | grep -i broadcom
Sadly not. brcmfmac is also present in the vendor kernel, but it does not support a number of these AP6* chips. The bcmdhd driver really is a different one, and further developed + patched to support WiFi chips used in ARM devices with Android OS, which implies what many SBCs were originally shipped with. The Rockchip vendor kernel sources originally were used for both, Android and plain Linux, until 5.15 IIRC. When I recognized a bunch of nonsense Android-only settings in the defconf, I talked to them that this is causing a bunch of errors in the kernel log on (non-Android) Linux, after which they split it (or said so). But a bunch of custom drivers from Android remained, and were never mainlined, or support for the additional chips merged into brcmfmac in this case. It is a mess …
Yes, another thing annoying about this driver: it can be built only with one of either USB, or PCIe, or SDIO support, but not combining them. This is the reason we had a dedicated vendor kernel build only for Orange Pi 5 Max and Ultra, switching from PCIe to SDIO. But recently I reconsidered that it is very unlikely that someone uses an M.2 module with this AP6* chip that would require PCIe support, or a USB dongle. Only Orange Pi seems to use theses chips, like only Orange Pi uses these likewise problematic UNISOC/Speadtrum chips that (their driver) is not in mainline Linux either, and cause so much issues. Hence I switched that to SDIO support for all vendor kernel builds: rk35xx-vendor: enable bcmdhd SDIO support · MichaIng/build@5fda26c · GitHub
This really caused a lot of extra work previously.