Can the OPI5 be Configured to Run LCNC?

More
15 Sep 2024 19:50 #310220 by briansm
These results are from my tests with the OrangePi 5 Plus and OrangePi 5 Max using the kernel patch (version 5.10.160) from your Google Drive.

I attempted to patch kernel 6.1 with PREEMPT_RT patches but couldn't achieve the same low latency levels

Please Log in or Create an account to join the conversation.

More
19 Sep 2024 14:53 #310460 by nhanpham
Hello, I am using the Orange Pi 5 Plus. I’m running Debian from the official Orange Pi website, and I have installed a real-time kernel patch (version 5.10.160). When I run LinuxCNC, I encounter this error when starting hm2:
iptables: Failed to initialize nft: Protocol not supported
hm2_eth: ERROR: Failed to execute 'env "PATH=/usr/sbin:/sbin/${PATH}" iptables -A hm2-eth-rules-output -o enP3p49s0 -p icmp -j DROP'
The real-time kernel is working very well, but I am experiencing many errors related to total_packet_errors, which was showed in hal

Please Log in or Create an account to join the conversation.

More
20 Sep 2024 14:12 #310516 by royka
@nhanpan You probably need to pin the ethernet irq to another core, preferably an isolated core. The irq you can get by entering the command: cat /proc/interrupts and find your ethernet adapters. In case yours also start with "enP" you could enter:
grep enP /proc/interrupts
185:          0          0          0          0     799186          0          0          0   ITS-MSI 428343296 Edge      enP3p49s0
186:          0          0          0          0          0          0          0          0   ITS-MSI 570949632 Edge      enP4p65s0

To pin them to cpu5 with the above result as example you could add to /etc/rc.local in a line above "exit 0"
sleep 15 && echo 20 > /proc/irq/185/smp_affinity & echo 20 > /proc/irq/186/smp_affinity

It seems that the error tells that the kernel doesn't support that, perhaps a missing module? But with the irqs pinned you can ignore the message.
The following user(s) said Thank You: nhanpham

Please Log in or Create an account to join the conversation.

More
20 Sep 2024 15:08 #310519 by royka
@briansm The 6.1 kernel is a bsp kernel so I doubt it patched successfully, you might have more luck with patching the 6.11 kernel including these patches and use the right config:
github.com/armbian/build/tree/main/patch...rockchip-rk3588-6.11

But some things might not work yet. If you can't figure it out, maybe I'll take a look at it sometime. But for now I don't see much added value in it.

Please Log in or Create an account to join the conversation.

More
21 Sep 2024 16:33 #310556 by nhanpham
Thank you very much. After reinstalling the kernel, adding iptables, and assigning IRQ to core 7, everything worked perfectly. I was able to run with SERVO_PERIOD = 500,000 for 6 hours without any issues.

@nhanpan You probably need to pin the ethernet irq to another core, preferably an isolated core. The irq you can get by entering the command: cat /proc/interrupts and find your ethernet adapters. In case yours also start with "enP" you could enter:
grep enP /proc/interrupts
185:          0          0          0          0     799186          0          0          0   ITS-MSI 428343296 Edge      enP3p49s0
186:          0          0          0          0          0          0          0          0   ITS-MSI 570949632 Edge      enP4p65s0

To pin them to cpu5 with the above result as example you could add to /etc/rc.local in a line above "exit 0"
sleep 15 && echo 20 > /proc/irq/185/smp_affinity & echo 20 > /proc/irq/186/smp_affinity

It seems that the error tells that the kernel doesn't support that, perhaps a missing module? But with the irqs pinned you can ignore the message.

The following user(s) said Thank You: royka

Please Log in or Create an account to join the conversation.

More
05 Oct 2024 04:58 #311320 by s.o.v.a
Hi, guys!
It seems that using a GPU improves latency on this board.
Without:
 
With:
 
$ glxinfo | grep Device
    Device: llvmpipe (LLVM 14.0.0, 128 bits) (0xffffffff)

# no hardware acceleration

$ glxinfo | grep Device
    Device: Mali-G610 (Panfrost) (0xffffffff)

# hardware acceleration here

Good thread:
dietpi.com/forum/t/orange-pi-5-hardware-...tion-enabled/16387/2

If you are using Armbian Jammy, you just follow the instructions. (You may encounter two errors that are easy to google)
I'm using Bookworm so manually installed .debs
$ ls
libd3dadapter9-mesa_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libdri2to3_1.0.5-2_arm64.deb
libegl1-mesa_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libegl-mesa0_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libgbm1_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libgl1-mesa-dri_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libgl1-mesa-glx_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libgl4es_1.1.4-1+git230404.22af242~j2_arm64.deb
libglapi-mesa_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libgles2-mesa_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libglx-mesa0_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libmali-g610-x11_1.0.5-2_arm64.deb
libosmesa6_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
libwayland-egl1-mesa_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
mali-g610-firmware_1.0.2_all.deb
malirun_1.0.5-2_all.deb
mesa-opencl-icd_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
mesa-va-drivers_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
mesa-vdpau-drivers_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb
mesa-vulkan-drivers_23.0.5-0ubuntu1~panfork~git221210.120202c6757~j3_arm64.deb

# all *arm64*.deb files excluding *dev* (development stuff)

$ sudo apt install ./*.deb

...

The following additional packages will be installed:
  libclang-common-14-dev libclc-14 libclc-14-dev libllvm14 libvdpau1 libvulkan1 ocl-icd-libopencl1
Recommended packages:
  libclang-rt-14-dev
The following NEW packages will be installed:
  libclang-common-14-dev libclc-14 libclc-14-dev libd3dadapter9-mesa libdri2to3 libegl1-mesa libgl1-mesa-glx libgl4es libgles2-mesa
  libllvm14 libmali-g610-x11 libosmesa6 libvdpau1 libvulkan1 libwayland-egl1-mesa mali-g610-firmware malirun mesa-opencl-icd
  mesa-va-drivers mesa-vdpau-drivers mesa-vulkan-drivers ocl-icd-libopencl1
The following packages will be upgraded:
  libegl-mesa0 libgbm1 libgl1-mesa-dri libglapi-mesa libglx-mesa0
5 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.

...

$ sudo reboot
 
Attachments:
The following user(s) said Thank You: tommylight, royka, onceloved

Please Log in or Create an account to join the conversation.

More
07 Oct 2024 21:59 - 09 Oct 2024 12:25 #311533 by royka
6.11 also seems to give good results, rt patched the source from:
github.com/Joshua-Riek/linux-rockchip/tree/oracular

Audio doesn't work here and perhaps some other features are missing, for those who would still like to try:
 
Kernel deb package and config:
drive.google.com/drive/folders/1JglCIPKv...cjOvr?usp=drive_link

An easy way to install with gpu acceleration is to install the image 6.10.6 with backported mesa from:
mirror.vinehost.net/armbian/dl/orangepi5/archive/
or
mirror.vinehost.net/armbian/dl/orangepi5-plus/archive/

Install the kernel with: sudo apt install ./linux*.deb
Then copy the dtb files: sudo cp /usr/lib/linux-image-6.11.0-rt7-g375956b48579-dirty/rockchip/* /boot/dtb/rockchip/
And link the Image file to the rt-kernel: cd boot; sudo ln -sf vmlinuz-6.11.0-rt7-g375956b48579-dirty Image


 
Attachments:
Last edit: 09 Oct 2024 12:25 by royka.
The following user(s) said Thank You: onceloved

Please Log in or Create an account to join the conversation.

More
11 Oct 2024 13:57 - 11 Oct 2024 14:22 #311810 by royka
 
Also tested the 6.1.75 vendor kernel (with panthor driver), only after loading chromium and watching videos on youtube the latency raised a bit as you can see, but still very acceptable. Isolating all the fast cores improved that, but for me it's not worth it as it becomes noticeable slower.

For the rt-patch only a few had to be done manually for the serial 8250 driver because of some vendor edits.

Kernel/config
drive.google.com/drive/folders/1JglCIPKv...cjOvr?usp=drive_link

An easy way to install with gpu acceleration is to install the kernel on the image 6.1.75 with backported mesa from:
mirror.vinehost.net/armbian/dl/orangepi5/archive/
or
mirror.vinehost.net/armbian/dl/orangepi5-plus/archive/

Install the kernel with: sudo apt install ./linux*.deb
And link the Image file to the rt-kernel: cd boot; sudo ln -sf vmlinuz-6.1.75-rt23 Image
Attachments:
Last edit: 11 Oct 2024 14:22 by royka.
The following user(s) said Thank You: onceloved

Please Log in or Create an account to join the conversation.

More
13 Oct 2024 11:29 #311947 by onceloved

 
Also tested the 6.1.75 vendor kernel (with panthor driver), only after loading chromium and watching videos on youtube the latency raised a bit as you can see, but still very acceptable. Isolating all the fast cores improved that, but for me it's not worth it as it becomes noticeable slower.

For the rt-patch only a few had to be done manually for the serial 8250 driver because of some vendor edits.

Kernel/config
drive.google.com/drive/folders/1JglCIPKv...cjOvr?usp=drive_link

An easy way to install with gpu acceleration is to install the kernel on the image 6.1.75 with backported mesa from:
mirror.vinehost.net/armbian/dl/orangepi5/archive/
or

mirror.vinehost.net/armbian/dl/orangepi5-plus/archive/

Install the kernel with: sudo apt install ./linux*.deb
And link the Image file to the rt-kernel: cd boot; sudo ln -sf vmlinuz-6.1.75-rt23 Image

Where is the kernel source code for 6.1.75? I installed it and WiFi doesn't work. I plan to recompile it to turn on WiFi.

Please Log in or Create an account to join the conversation.

More
13 Oct 2024 11:30 #311949 by onceloved
Or you can help me compile and turn on WiFi. I use the AX200 wireless network card. Thank you.

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Powered by Kunena Forum