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.
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.
“ai-chip”“ai-chip”
The wiki was tested with router software nrsw-image-2800-0.0.0.0.img and the LXC container with debina 13 armhf (trixie)
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's circuit board features a DC/DC converter that supplies 3.3 volts to the two Mini-PCIe slots. The maximum output current is 6 amps. A maximum of 12 watts is available for the Mini-PCIe modules. The DX-M1 chip has a maximum power consumption of less than 5 watts.
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.
You can check whether the module is present via the router's console.
The module was detected in the router: “02:00.0” (PCI address of the device: Bus 02, Device 00, Function 0).
The device class of the module was correctly identified as “Class 1200” (processing accelerator), i.e., an NPU or AI accelerator
The last entry is generated generically because the name of the hardware is not stored in the lspci/pci.ids database.
The first step is to download the software that includes driver support for the DX-M1 chip. To do this, click the link NB2800 or NB2810 to download the appropriate software for the two respective routers.
The password for access is “ai-chip”
Save the downloaded router software to the “/tmp” subdirectory on the router, and then connect to the router via the console using SSH or the Windows program PuTTY.
~ $ 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: NETBOLT ROOTFS: 0.0.0.0 (20260806194249) UBOOT: 5.0.0.100 LOGIC: 5.0.0.100 (1 file) PATCH: none Forcing installation of an unsigned image.
You can install this image on the router using the command swupdate -fr nrsw-image-2800-0.0.0.0.img.
In this example, I've set it up for a Telekom SIM card.
You can use a ping test to check whether the router can establish an Internet connection via the WWAN connection.
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 / Link
Here you can download a Debian image for various systems and versions.
The armhf tab is important here, and trixie
The image is the “rootfs.tar.xz” which is required. With a right click you can copy the link.
It would be structured like this:
When the “Apply” button is pressed, Debian will be installed.
Set up the LXC container further. A network interface is enabled here.
The container has now also been assigned an IP address.
Always assign a fixed IP address for the LXC container via the DHCP server.
The MAC address of the LXC container is 00:FF:AA:00:44:00.
Log in to the LXC container and test whether it can access the Internet.
— quad9.net ping statistics — 2 packets transmitted, 2 received, 0% packet loss, time 3006ms rtt min/avg/max/mdev = 28.823/36.685/40.937/4.768 ms root@LXCNAME:~#
The container is installed and set up. Now you can set up further tools on 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 “/dev/sda1“.
In order to release the device in the container, I need to know what kind of device it is: “b” is a block device, major number “8” and minor number “1”.
With this information, we can adjust the LXC configuration so that we have access to the device from within the container.
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 config file.
~ $ vi /etc/lxc/guest0/config
# 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,optional,create=file
Simply add these four entries to the LXC configuration file. Please ensure that you fill them in with your own parameters. Restart the router for these changes to take effect.
Now the USB device can be connected to the container and used.
The “mkdir” command is used to set up an area in the file system for access.In the second step, change the permissions of the file.
$ mkdir -p /mnt/home/data
$ chgrp -R users /mnt/home/ $ chmod -R 770 /mnt/home/
Check whether the rights have been set.
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.
First, we create a script file called vi usb_stick.sh
#!/bin/bash mknod /dev/sda1 b 8 1 sleep 1s mount /dev/sda1 /mnt/home/data
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 “crontab -e” and save this line there.
root@LXCNAME:~# apt install cron
root@LXCNAME:~# crontab -e @reboot /root/usb_stick.sh
The driver must be loaded into the router using the “modprobe” command. This is done by typing “done”.
~ $ vi /etc/init.d/done # The dxrt_driver.ko driver is being loaded modprobe dxrt_driver 2>/dev/null || sudo insmod /lib/modules/$(uname -r)/extra/rt/dxrt_driver.ko # LXC continaer restart /etc/init.d/virt 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 /etc/lxc/guest0/config # 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,create=file 0 0
If the “dxrt0” interface under the LXC container is set to mode “(000),” you must check the settings in lxc config again to make sure they are correct.
To do this, you'll need to clone the DX-ALL-SUITE repository using “git”.
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:~# cd /mnt/home/data/ root@LXCNAME:/mnt/home/data# export VERSION=v2.1.0 root@LXCNAME:/mnt/home/data# git clone -b ${VERSION} –recurse-submodules https://github.com/DEEPX-AI/dx-all-suite.git
Additional software is required for the installation
You can then proceed with the installation of the DX-RT (runtime software).
root@LXCNAME:~# cmake -S . -B build -DPython_EXECUTABLE=/usr/bin/python3 -Donnxruntime_INCLUDE_DIRS=/mnt/home/data/dx-all-suite/dx-runtime/dx_rt/extern/onnxruntime-win-x64-1.20.1/include -Donnxruntime_LIB_DIRS=/mnt/home/data/dx-all-suite/dx-runtime/dx_rt/extern/onnxruntime-win-x64-1.20.1/lib
root@LXCNAME:~# cmake –build build -j1
Once it has been successfully installed, you can test it.
Run the CLI command “dxrt-cli –status”
* FW version : v2.1.5 ——————— 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.
* Deepx DX-M1 AI-Chip Webpage DX-M1 Chip
* Deepx DX-M1 Documentation DX-M1 Documentation
* AI-Models for the Chip AI-Models
* Overview DX-M1 Chip Overview