RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime

More
09 Jan 2025 12:44 #318536 by alangibson
Make sure you include these .config options or it will fail:
echo 'CONFIG_CRASH_DUMP=y' >> .config
echo 'CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y' >> .config
echo 'CONFIG_KEXEC_CORE=y' >> .config
echo 'CONFIG_PROC_KCORE=y' >> .config
echo 'CONFIG_PROC_FS=y' >> .config
echo 'CONFIG_MMU=y' >> .config

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

More
11 Jan 2025 20:54 - 11 Jan 2025 20:55 #318704 by gene_weber
I'm trying to do this with an Rpi 4 and I'm seeing the same thing. I can find the PID of latency-histogr. Then run chrt -p PID which reports that current scheduling policy as SCHED_OTHER. Then run chrt -f -p PID which does change the scheduling policy to SCHED_FIFO.

But all I did (hoped was necessary) was to update the kernel. sudo rpi-update next, thne reboot. Must one actually build the kernel with a patch? That seems odd if the kernel offers full RT support.
Last edit: 11 Jan 2025 20:55 by gene_weber.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
11 Jan 2025 21:21 #318705 by rodw
Yes the kernel needs to be specifically built to support preempt_rt even in kernel 6.12
It seems that on the Pi a default 6.12 RT kernel build is not recognised by linuxcnc unless the kernel has additional settings that are provided in the patch. This may end up being fixed by the kernel developers in later versions

This may not be relevant to you but building a custom image that includes Linuxcnc is not trivial and requires building a kernel from source so it needs to be a RT kernel.


 

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

More
11 Jan 2025 21:33 #318707 by gene_weber
Thanks Rod,

I gave this a try because I was excited to read that "This release includes realtime support (PREEMPT_RT), a feature that has been in the works for 20 years." So is there a bug in the PREEMPT_RT support in the 6.12 kernel, or is it simply not implemented the way LinuxCNC has come to expect? Obviously LinuxCNC needs to support a working standard.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
11 Jan 2025 21:44 #318710 by rodw
I'm not sure yet. I installed Debian Trixie on an i7 the other day. It uses 6.12.6. I installed Linuxcnc on it from the Debian repositories (which also installs linux-image-rt-arm64 as a dependency) and everything worked correctly.It might just be an ARM problem,
The following user(s) said Thank You: gene_weber

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

More
11 Jan 2025 21:55 #318712 by gene_weber
Interesting. So that was unmodified OS install, and then a LinuxCNC 2.93 Uspace install? It's great that that worked.

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

More
12 Jan 2025 09:36 #318744 by alangibson

 So is there a bug in the PREEMPT_RT support in the 6.12 kernel, or is it simply not implemented the way LinuxCNC has come to expect? Obviously LinuxCNC needs to support a working standard.


This conversation is a bit confusing because rodw and I are doing different things to get the same result.

I am starting with Raspberry Pi OS, switching to their 6.12 branch then building the kernel to enable PREEMPT_RT. I'm doing this because they don't have a kernel build of 6.12 with realtime enabled yet.

rodw is starring with plain Debian and using a build system to create an image for the Raspberry Pi.

Sidenote: all realtime code is merged in upstream 6.12 now, but you still have to enable it at build time with a configuration option. There's no way to turn realtime on and off after it's built. 
The following user(s) said Thank You: rodw, gene_weber

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

  • Cant do this anymore bye all
  • Cant do this anymore bye all's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
12 Jan 2025 10:11 #318748 by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
No not all the realtime code is there (it is a very confusing situation, mainly thanks to tech bloggers, and other sundry types that aren't trying to build a fully preemptive arm kernel), there are still patches up on kernel.org. Without the patches at kernel.org there is no way to select a fully_preemptible kernel (and another one if working on the 6.1.69 kernel). The highest level you can chose is a low-latency desktop, but this is not the model really required for realtime. In another thread I post the differences between the different kernels, forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=30#318731

This has been a bit of a headache all weekend, I've built a successful image using the 6.1.y branch (unfortunatley first attempt didn't include the Linuxcnc binaries), the commit chosen is 6.1.69, the latest commit on that branch doesn't have a corresponding patch set is available.

I tried with the 6.12.y branch, but there was an issue with the build of the final image.

Finally working with the 6.1.y branch and the 6.1.69 commit it appears that I have a successful image, with the Linuxcnc binaries and spi turned on as default.

I think one reason for "rolling our own image" is to get away from any RPi Foundation branding. Another reason is that we can insert our own modifications in as well.
The following user(s) said Thank You: rodw, gene_weber

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

More
12 Jan 2025 13:54 - 12 Jan 2025 14:02 #318774 by gene_weber
@alangibson @cornholio, thanks for the clarifications.

I've been trying to simply update the kernel to 6.12, install LinuxCNC in uspace and go. I've been playing with this for a week. I took the blogs that said the kernel now supports PREEMPT_RT a bit too literally. (First version of this sentence was considerably less kind to the bloggers)

The post about the differences between the different kernels is very enlightening. I've been using Linux for years at work & home. I had thought there was "The One Linux Kernel" at the heart of Debian, Fedora, Ubuntu, Mint, etc. Based on this conversation I guess that's not the case.
Last edit: 12 Jan 2025 14:02 by gene_weber.
The following user(s) said Thank You: TomAlborough

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

  • Cant do this anymore bye all
  • Cant do this anymore bye all's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
12 Jan 2025 14:02 #318775 by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
The Rpi5 will work fine with the posted image on the download page. Will be fine for mesa ethernet.
For SPI you'll have to compile Linuxcnc from the most recent sources, master or 2.9.3, as they include the spi driver thats supports the RPi5. If using ethernet nothing needs to be done.

This may be worth a read
github.com/by/RT-Kernel

Along with this post
forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=40#318767

I'm actually getting fed up with my RPi5, for the second time for Linuxcnc, it's a Me Issue which I fully admit to. Hopefully I'll be able to gently with great care put it back into the container rather than forcibly inserting into the wall, which will make other people mad at me.

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

Time to create page: 0.187 seconds
Powered by Kunena Forum