NPU not working on CM3

I just purchased a new board (2GB RAM / 16GB eMMC / WiFi).
Installed the latest Debian: https://github.com/radxa-build/radxa-cm3-rpi-cm4-io/releases/download/b15/radxa-cm3-rpi-cm4-io_debian_bullseye_cli_b15.img.xz
But can’t get the NPU to run. It always says “failed to open rknn device”.

I also tried:

  • renaming the /boot/dtbo/rk3568-npu-enable.dtbo.disabled to /boot/dtbo/rk3568-npu-enable.dtbo
  • sudo u-boot-update
  • reboot

But still no success. Can someone tell me what to do? @Alvin

I confirmed with the “radxa-cm3-rpi-cm4-io_debian_bullseye_cli_b15.img.xz” you mentioned.
However, we are happy to report that we did not see the symptoms you mentioned.

The criterion for determining whether “NPU” worked as expected is the item “Step3: Run RKNN2 SSD DEMO” listed in “npu-run-test” that you presented.
As a result of executing the contents described here as is, the result was exactly the same as the picture presented as a sample.
Since I am not familiar with “NPU” myself, I have determined that it is functioning correctly based on the above results.

Personally, I think it is unlikely to be hardware dependent, but
The hardware configuration used for verification is presented below.

    Module: "Ver 1.31A(20220526), RAM:4GB, without (eMMC/ WiFi)"
    Carrier board: "Waveshare: CM4-IO-BASE-C"

I should add that in the “radxa-cm3-rpi-cm4-io_debian_bullseye_cli_b15.img.xz” you presented, the “NPU” is enabled by default.
Therefore, there is no need to add any special operations.(etc. add parameter “k3568-npu-enable.dtbo.disabled”)

Could there be something more fundamentally wrong ?
I think it will be difficult to resolve the issue unless your presented detailed of logs.

What kind of logs do you need?

I’m using the Raspberry IO board. Could this be a problem? Other that that it‘s a brand new CM3. But WiFi is not available also. So it might be a problem with the hardware.

If NPU is enabled by default: how much RAM is available then? In my case it‘s the full 2GB. So it‘s not 500MB missing for the NPU.

On CLI version we do not install Rockchip related packages by default. Please retry with the Debian Desktop variant.

You should also enable the overlay via rsetup, which will check if overlays are compatible with your running device.

How is that? t4_4t says “in the cli version the NPU is enabled by default” and you say “it’s not installed at all”?

I just tried the radxa-cm3-rpi-cm4-io_debian_bullseye_kde_b15.img but still no success. It’s still the full 2GB RAM and rsetup does not show any overlay that says something like “enable NPU”.

> What kind of logs do you need ? 

See below for some specific examples, for reference.




aghost #4 November 3, 2021, 4:38pm


hoko #10 May 10, 2022, 1:06pm
DDR Version V1.10 20210810
In
...

Starting kernel ...

Armbian 22.05.0-trunk.0053 Jammy ttyS2
rock-3a login:

From immediately after startup (power on) “DDR Version …” to "rock-3a login: ",
Specifically, the log as presented above by “hoko #10 May 10, 2022, 1:06pm”.

Of course, there is no magic tool that will solve everything, so don’t expect transience.

But without it(boot-log), there would be nothing to discuss.
At best, it would end up as a chat-level daily conversation.

I tried the radxa-cm3-io_debian_bullseye_kde_b27.img and there I can select “Enable NPU” in rsetup. But when I reboot I still have the full 2GB RAM (don’t know if that’s supposed to be like this?). The boot log is attached. boot_b27.zip (22.6 KB)

I also tried this OS and removed the “disable NPU overlay”. Then I only have 1,5GB RAM available. But the NPU still does not work. The boot log is the following boot_2023.zip (23.3 KB)

I tried 3 different CM3. I start to believe that it has nothing to do with the CM3 hardware but with the OS itself or with the Raspberry IO board.

We forgot to add radxa-cm3-rpi-cm4 to overlay’s compatible list, which is why it was not shown in rsetup. I have updated this.

If you see 1.5GB ram then NPU should be enabled. Can you be more specific about “NPU still does not work”?

Ok, thank you. So how will this be available? Will there be a new build for the cm3-rpi-cm4-io? The latest one is quite old (13 Oct 2023). Or can I update this one with “apt update”?

I’ve only manged to see the 1.5GB RAM in the old version radxa-cm3-io-debian-bullseye-xfce4-arm64-20230101-1153-gpt.img.xz. For all the new versions I always have the full 2GB RAM available. But even when the 1.5GB RAM are available and I run the NPU demo, I get the error:

E RKNN: [12:50:42.310] failed to open rknpu module, need to insmod rknpu dirver!
E RKNN: [12:50:42.311] failed to open rknn device!
rknn_init fail! ret=-1

Please check if NPU service is running with sudo systemctl status rknpu2.service.

If you do not have this service please fully upgrade your system first.

With the image radxa-cm3-io_debian_bullseye_kde_b27.img and an enabled “Enable NPU” overlay I still have 2GB RAM available. Although the command sudo systemctl status rknpu2.service says that the service is running but when I execute the demo it still says:

E RKNN: [12:50:42.310] failed to open rknpu module, need to insmod rknpu dirver!
E RKNN: [12:50:42.311] failed to open rknn device!

With the radxa-cm3-rpi-cm4-io_debian_bullseye_kde_b15.img and a full update of with apt upgrade I cound not find the “Enable NPU” overlay.

If you have 2GB memory then NPU is not enabled. Please check NPU services when you only have 1.5GB memory.

Also what is the command you use to run the demo?

It is not published yet. We can’t just put any new code change out to the customer without first going through testing.

The only OS I was able to get the 1,5GB RAM was the radxa-cm3-io-debian-bullseye-xfce4-arm64-20230101-1153-gpt.img.xz.
But in this OS it says:

Unit rknpu2.service could not be found.

When I run the NPU test I follow this tutorial https://wiki.radxa.com/Rock3/dev/npu-run-test and execute the command:

./rknn_ssd_demo model/RK356X/ssd_inception_v2.rknn model/bus.jpg

The log you provided shows that a failure has occurred in the “i2c0 communication line.”
This is causing a situation where many nodes that should be detected [ function block: mmc0(sd-cad)/mmc2(bt-wifi)/npu/gpu/ etc… ] are not detected.
In this situation, software approaches such as trying other images are futile.

The first thing to do is to remove this obstacle.
If there is anything connected to connector: “J5” or “J16”, the first thing you should do is disconnect it.

There is nothing connected to the board. Neither is any Jumper connected. It’s just a plain CM3 on a plain Raspberry IO Board.

Could you take a picture of your CM3? Make sure the silkscreen is clear.

The issue seemed to be the Raspberry IO board. The camera didn’t work with the original Raspberry CM4 either. I changed the IO board and everything works :+1:. Sorry for all the hussle and thanks for the support.

1 Like