Jump to content

Recommended Posts

Posted (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 by m1zfs

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines