This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| app-notes:ai-features [2026/09/25 06:23] – removed - external edit (Unknown date) 127.0.0.1 | app-notes:ai-features [2026/09/25 06:23] (current) – ↷ Page moved from internal:ai-features to app-notes:ai-features gray | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Netmodule Routers with AI Features ====== | ||
| + | ===== Goal ===== | ||
| + | |||
| + | This wiki shows how to enable an AI Core DX-M1 chip in the router and use it within an LXC container. It also explains how to set up additional utilities within the container. | ||
| + | |||
| + | ===== The background to this project ===== | ||
| + | Enable the router to run its own AI modules locally, directly on the router, without having to use a hyperscaler. Your own data can be used to train the AI modules because it is not shared with third parties. The entire value chain remains under your control and can be flexibly developed further. Applications include intelligent energy management systems, dynamic traffic control systems, and production management. The AI modules can be trained and fine-tuned for their core tasks to achieve optimal results. | ||
| + | |||
| + | |||
| + | ---- | ||
| + | === Modules in the router === | ||
| + | {{: | ||
| + | |||
| + | ---- | ||
| + | ===== Prerequisites ===== | ||
| + | |||
| + | * NetModule NB2800/ | ||
| + | * NetModule Software with AI Core DX-M1 Chip Support for NB2800 [[https:// | ||
| + | * NetModule Software with AI Core DX-M1 Chip Support for NB2810 [[https:// | ||
| + | * Not available for legacy products NB1600, NB2700, NB3700, NB3710 | ||
| + | |||
| + | ** | ||
| + | <WRAP center round important 90%> | ||
| + | The wiki was tested with router software nrsw-image-2800-0.0.0.0.img and the LXC container with debina 13 armhf (trixie) | ||
| + | </ | ||
| + | ** | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== - Installing the Module into the Router Hardware ===== | ||
| + | |||
| + | An adapter is required for the Deepx DX-M1 AI chip to be used with the router. The PCI Express interfaces are implemented as Mini PCIe on the router board. The DX-M1 chip requires a Mini PCIe to M.2 M-key adapter. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | The NB2800' | ||
| + | |||
| + | The module can be installed in slot 1 or 2 on the NB2800. | ||
| + | |||
| + | {{: | ||
| + | The DX-M1 chip was inserted into the first slot | ||
| + | |||
| + | To ensure communication between the chip and the router, the module must be configured as Wi-Fi in the BD. | ||
| + | |||
| + | < | ||
| + | === BDINFO === | ||
| + | bd/ | ||
| + | bd/ | ||
| + | bd/ | ||
| + | bd/ | ||
| + | </ | ||
| + | |||
| + | You can check whether the module is present via the router' | ||
| + | |||
| + | < | ||
| + | lspci | ||
| + | 02:00.0 Class 1200: 1ff4:0000 | ||
| + | </ | ||
| + | |||
| + | The module was detected in the router: “02: | ||
| + | |||
| + | The device class of the module was correctly identified as “Class 1200” (processing accelerator), | ||
| + | |||
| + | The last entry is generated generically because the name of the hardware is not stored in the lspci/ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== - Setting Up the Router Software on the Router ===== | ||
| + | |||
| + | The first step is to download the software that includes driver support for the DX-M1 chip. To do this, click the link '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The password for access is '' | ||
| + | |||
| + | Save the downloaded router software to the '' | ||
| + | |||
| + | |||
| + | < | ||
| + | BusyBox v1.35.0 () built-in shell (ash) | ||
| + | |||
| + | ~ $ cd /tmp/ | ||
| + | /tmp $ swupdate -fr nrsw-image-2800-0.0.0.0.img | ||
| + | This is swupdate (version 3.0) speaking | ||
| + | |||
| + | Will force things | ||
| + | root0 is currently our root partition | ||
| + | ========== system info ================== | ||
| + | Model NB2800 | ||
| + | Profile: | ||
| + | ROOTFS: | ||
| + | UBOOT: | ||
| + | LOGIC: | ||
| + | PATCH: | ||
| + | Forcing installation of an unsigned image. | ||
| + | </ | ||
| + | |||
| + | You can install this image on the router using the command '' | ||
| + | |||
| + | |||
| + | |||
| + | ==== Next, set up a mobile (WWAN) connection on the router ==== | ||
| + | |||
| + | In this example, I've set it up for a Telekom SIM card. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You can use a '' | ||
| + | |||
| + | < | ||
| + | ~ $ ping quad9.net | ||
| + | PING quad9.net (195.176.255.138): | ||
| + | 64 bytes from 195.176.255.138: | ||
| + | 64 bytes from 195.176.255.138: | ||
| + | 64 bytes from 195.176.255.138: | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== - Set up the LXC Contianer ===== | ||
| + | |||
| + | Activate the LXC container on the router | ||
| + | |||
| + | {{: | ||
| + | |||
| + | In the second step, the image of the LXC container in this case, a Debina 13 (trixie). | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The easiest way to do this is to install the whole thing over the Internet. However, the router requires a mobile connection to the Internet. | ||
| + | |||
| + | From a Jenkins server you get the current image for the container | ||
| + | |||
| + | * Jenkins Server Page image-debian / [[https:// | ||
| + | |||
| + | Here you can download a Debian image for various systems and versions. | ||
| + | |||
| + | The '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | The image is the '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | It would be structured like this: | ||
| + | |||
| + | https:// | ||
| + | |||
| + | When the '' | ||
| + | |||
| + | Set up the LXC container further. A network interface is enabled here. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The container has now also been assigned an IP address. | ||
| + | |||
| + | < | ||
| + | ~ $ lxc-info guest0 | ||
| + | Name: | ||
| + | State: | ||
| + | PID: 2255 | ||
| + | IP: | ||
| + | CPU use: 1.57 seconds | ||
| + | BlkIO use: 4.00 KiB | ||
| + | Memory use: 6.29 MiB | ||
| + | KMem use: 1.18 MiB | ||
| + | Link: virt0 | ||
| + | TX bytes: | ||
| + | RX bytes: | ||
| + | Total bytes: | ||
| + | ~ $ | ||
| + | </ | ||
| + | |||
| + | Always assign a fixed IP address for the LXC container via the DHCP server. | ||
| + | The MAC address of the LXC container is '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Log in to the LXC container and test whether it can access the Internet. | ||
| + | |||
| + | < | ||
| + | ~ $ lxc-attach guest0 | ||
| + | root@LXCNAME: | ||
| + | PING quad9.net (195.176.255.138) 56(84) bytes of data. | ||
| + | 64 bytes from 195.176.255.138 (195.176.255.138): | ||
| + | 64 bytes from 195.176.255.138 (195.176.255.138): | ||
| + | |||
| + | --- quad9.net ping statistics --- | ||
| + | 2 packets transmitted, | ||
| + | rtt min/ | ||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | The container is installed and set up. Now you can set up further tools on the container. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Adjust the LXC config so that the USB port can be used in the container ==== | ||
| + | |||
| + | Enable USB administration on the router | ||
| + | |||
| + | {{: | ||
| + | |||
| + | When the USB device is plugged in, it is mounted by the router and stored in the system as device part '' | ||
| + | |||
| + | < | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | Feb 12 09: | ||
| + | </ | ||
| + | |||
| + | In order to release the device in the container, I need to know what kind of device it is: '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | With this information, | ||
| + | |||
| + | ** | ||
| + | <WRAP center round important 90%> | ||
| + | This change is made directly in the router software. When updating the router software, this entry must be made again because it is not part of the official software. | ||
| + | </ | ||
| + | ** | ||
| + | |||
| + | Add these entries to the end of the '' | ||
| + | |||
| + | < | ||
| + | ~ $ vi / | ||
| + | |||
| + | # Setting up a USB flash drive in the LXC container | ||
| + | lxc.cgroup.devices.allow = b 8:1 rwm | ||
| + | lxc.mount.entry = /dev/sda1 /dev/sda1 none bind, | ||
| + | </ | ||
| + | |||
| + | Simply add these four entries to the LXC configuration file. Please ensure that you fill them in with your own parameters. '' | ||
| + | |||
| + | Now the USB device can be connected to the container and used. | ||
| + | The '' | ||
| + | |||
| + | < | ||
| + | ~ $ lxc-attach guest0 | ||
| + | |||
| + | $ mkdir -p / | ||
| + | |||
| + | $ chgrp -R users /mnt/home/ | ||
| + | $ chmod -R 770 /mnt/home/ | ||
| + | </ | ||
| + | |||
| + | Check whether the rights have been set. | ||
| + | |||
| + | < | ||
| + | /mnt/home $ ls -l | ||
| + | total 4 | ||
| + | drwxrwx--- 2 root users 4096 Aug 11 14:19 data | ||
| + | /mnt/home $ | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==== Integrating external storage into the container system ==== | ||
| + | |||
| + | The whole thing is integrated via a cron job, so that it is always available when the router is restarted. | ||
| + | |||
| + | Queries with which file system the external storage was formatted. | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | /dev/sda1: UUID=" | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | First, we create a script file called '' | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | mknod /dev/sda1 b 8 1 | ||
| + | sleep 1s | ||
| + | mount /dev/sda1 / | ||
| + | </ | ||
| + | |||
| + | To test it, you can now simply run this file. Now the whole thing has to be saved as a cron job. To do this, call up the command '' | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | |||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | @reboot / | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== - Set up the AI Core DX-M1 chip ===== | ||
| + | |||
| + | The driver must be loaded into the router using the '' | ||
| + | |||
| + | < | ||
| + | ~ $ vi / | ||
| + | |||
| + | # The dxrt_driver.ko driver is being loaded | ||
| + | modprobe dxrt_driver 2>/ | ||
| + | |||
| + | # LXC continaer restart | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Test this after rebooting the router to see if the interface is present in the router. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | In the next step, the interface must be passed to the LXC container. | ||
| + | |||
| + | < | ||
| + | ~ $ vi / | ||
| + | |||
| + | # Allow Access (Device 247) | ||
| + | lxc.cgroup.devices.allow = c 247:0 rwm | ||
| + | |||
| + | # Mount the DXRT device node in the container | ||
| + | lxc.mount.entry = /dev/dxrt0 dev/dxrt0 none bind, | ||
| + | </ | ||
| + | |||
| + | If the “dxrt0” interface under the LXC container is set to mode “(000), | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | crw-rw-rw- 1 root root 247, 0 Aug 11 15:38 dxrt0 | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== The next thing you'll need is the DX-RT runtime software ==== | ||
| + | |||
| + | To do this, you'll need to clone the DX-ALL-SUITE repository using '' | ||
| + | |||
| + | The git tool is required for this. The DX-ALL-SUITE repository is then saved to the USB flash drive for further installation | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | |||
| + | root@LXCNAME: | ||
| + | root@LXCNAME:/ | ||
| + | root@LXCNAME:/ | ||
| + | </ | ||
| + | |||
| + | Additional software is required for the installation | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | You can then proceed with the installation of the DX-RT (runtime software). | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | |||
| + | root@LXCNAME: | ||
| + | |||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | Once it has been successfully installed, you can test it. | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | Run the CLI command '' | ||
| + | |||
| + | < | ||
| + | root@LXCNAME: | ||
| + | DXRT v3.1.0 | ||
| + | ======================================================= | ||
| + | * Device 0: M1, Accelerator type | ||
| + | --------------------- | ||
| + | * RT Driver version | ||
| + | * PCIe Driver version : v2.5.0 | ||
| + | ------------------------------------------------------- | ||
| + | * FW version | ||
| + | --------------------- Device Info --------------------- | ||
| + | * Memory : LPDDR5 5600 Mbps, 3.92GiB | ||
| + | * Board : M.2, Rev 1.5 | ||
| + | * Chip Offset : 0 | ||
| + | * PCIe : Gen1 X1 [02:00:00] | ||
| + | |||
| + | NPU 0: voltage 750 mV, clock 1000 MHz, temperature 48'C | ||
| + | NPU 1: voltage 750 mV, clock 1000 MHz, temperature 49'C | ||
| + | NPU 2: voltage 750 mV, clock 1000 MHz, temperature 48'C | ||
| + | ======================================================= | ||
| + | root@LXCNAME: | ||
| + | </ | ||
| + | |||
| + | Now, information from the three NPU cores on the AI chip is displayed. | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | ===== - Additional information ===== | ||
| + | |||
| + | * Deepx DX-M1 AI-Chip [[https:// | ||
| + | |||
| + | * Deepx DX-M1 Documentation [[https:// | ||
| + | |||
| + | * AI-Models for the Chip [[https:// | ||
| + | |||
| + | * Overview | ||
| + | |||
| + | |||
| + | ---- | ||