m1zfs Posted February 15 Posted February 15 (edited) Hello Armbian-Community! TL;DR I've successfully enabled the Rockchip RK3568 NPU (0.8 TOPS INT8) on the ODROID-M1 with 8GB RAM running Armbian 6.18.9-current-rockchip64. The only thing needed to make this work for everyone is a 1-line kernel patch in Armbian build that I've already submitted: https://github.com/armbian/build/pull/9403 Once this patch is merged into Armbian, the DKMS modules will work out-of-the-box on all RK3568 boards. The Problem 1. Hardkernel and Rockchip provide NPU patches for quite old kernel versions: rockchip <= 6.6 hardkernel <= 5.10 2. IOMMU page table allocation bug — On systems with >4GB RAM, the kernel's IOMMU allocates page tables above 4GB, but the NPU can only access the first 4GB of physical memory, causing DMA mapping failures and inference timeouts The Solution 1. Kernel Patch (1 line!) - .gfp_flags = 0, + .gfp_flags = GFP_DMA32, This forces IOMMU page tables to be allocated below 4GB, fixing NPU operation on 8GB boards. 2. DKMS Driver Package I've created a complete DKMS package that: - Includes DT overlays for NPU, IOMMU, power-domain, and clock configuration - Supports dynamic frequency scaling (100 MHz - 1000 MHz) - Provides `/dev/dri/renderD129` (DRM/GEM interface) for RKNN Runtime - Would compile against Armbian's stock kernel headers with the above patch merged The Questions 1. What would be the best way to provide those modules for installation in the armbian system? 2. Has someone a 4 GB version of the M1 and could test the modules? Edited February 15 by m1zfs 0 Quote
Rajiv Singh Posted March 31 Posted March 31 @m1zfs I am willing to test as i have an m1 odroid with 4GB ram. What do i need to do ? I tried your dkms package installed it and rebooted but system never turned up after reboot. 0 Quote
ferro Posted Tuesday at 05:42 PM Posted Tuesday at 05:42 PM Hello, I believe @m1zfs's work on the DKMS modules is available here: https://github.com/vitalijborissow/rk3568-npu-ODROID-M1 I have spent many hours trying to get the NPU working on my ODROID-M1 (8 GB) running Armbian 26.5.1 with current kernel 6.18.x as well as edge kernels 6.19 and 7.1. I also tried building the latest Armbian image from source (July 19 build including U-Boot 2026.07), but so far I have not been able to get the device tree / overlay and DKMS modules from the repository working on any of these combinations. The system always fails to boot. Fortunately, I can capture the boot process through the serial console and see where it fails. The log shows a kernel exception related to enabling the RK3568 NPU power domain: rockchip-pm-domain fdd90000.power-management:power-controller: failed to get ack on domain 'npu', val=0x1ee platform fde40000.npu: Adding to iommu group 3 Internal error: synchronous external abort ... Workqueue: pm genpd_power_off_work_fn ... rockchip_pd_power From the log it appears that the crash occurs before rknpu.ko is loaded. This makes me believe the issue is more likely related to the device tree, overlay, power-domain, regulator, or clock configuration rather than to the DKMS module itself. Has anyone seen a similar issue on recent Armbian kernels, or can suggest a direction for further troubleshooting? I am still willing to spend some time investigating this and would appreciate any ideas or hints. 0 Quote
ferro Posted 53 minutes ago Posted 53 minutes ago Hi, Finally, I made some good progress. I updated the DTS by starting with the DTS from Armbian 26.5.1 for current 6.18.x kernels and then merged the missing NPU and Power Domain nodes from the original DTS provided by @m1zfs. While comparing the original DTS with the current Armbian DTS, I also found that one of the phandle references in the NPU power-domain definition needed to be adjusted to match the phandle numbering used in the current Armbian DTS. After fixing that, the system booted successfully and the NPU was detected correctly. I'm now testing it with rknn_toolkit2 to verify that the NPU is fully functional. root@odroidtest:~# uname -a Linux odroidtest 6.18.35-current-rockchip64 #2 SMP PREEMPT Tue Jun 9 10:28:53 UTC 2026 aarch64 GNU/Linux root@odroidtest:~# root@odroidtest:~# lsmod | grep -E '^(rknpu|dma32_heap)\b' rknpu 94208 0 dma32_heap 12288 0 root@odroidtest:~# root@odroidtest:~# ls -l /dev/rknpu /dev/dri/by-path/platform-fde40000.npu-render /dev/dma_heap/system /dev/dma_heap/dma32 crw------- 1 root root 251, 3 Jul 25 21:19 /dev/dma_heap/dma32 lrwxrwxrwx 1 root root 19 Jul 25 21:19 /dev/dma_heap/system -> /dev/dma_heap/dma32 lrwxrwxrwx 1 root root 13 Jul 25 21:19 /dev/dri/by-path/platform-fde40000.npu-render -> ../renderD128 crw------- 1 root root 10, 261 Jul 25 21:19 /dev/rknpu root@odroidtest:~# root@odroidtest:~# dmesg | grep -i rknpu [ 6.108962] [drm] Initialized rknpu 0.9.8 for fde40000.npu on minor 1 [ 6.110169] RKNPU fde40000.npu: RKNPU: DKMS: /dev/rknpu registered (DMA-BUF import only) [ 6.132583] RKNPU fde40000.npu: RKNPU: SCMI clock 198 MHz [ 6.133433] RKNPU fde40000.npu: RKNPU: devfreq active (SCMI-only, OPP 200-1000 MHz) [ 6.134599] RKNPU fde40000.npu: RKNPU: thermal throttling enabled [ 6.139965] RKNPU fde40000.npu: RKNPU: sram region: [0x00000000fdcc0000, 0x00000000fdccb000), sram size: 0xb000 root@odroidtest:~# 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.