RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime

More
08 Jan 2025 11:38 #318392 by alangibson
Hello all. I'm trying out LinuxCNC 2.9.3 on the 6.12 kernel running on a Raspberry Pi 5. Installation goes fine, but LinuxCNC refuses to acknowledge I'm running a realtime kernel. On startup, it spits out the message: "Note: Using POSIX non-realtime"

However, `uname-a` shows:
Linux plasma 6.12.8-v8-16k+ #1 SMP PREEMPT_RT Tue Jan  7 22:00:59 CET 2025 aarch64 GNU/Linux

My installations script is here:
gist.github.com/alangibson/12700b72f737889536565896143eefe0

Can anyone make out my mistake? Or is there a known issue? I've searched but found nothing applicable.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
08 Jan 2025 12:23 #318396 by rodw
Allan, I have not quite got to 6.12 on my installer but I did  merge ther upstream to my master branch to get 6.12 support
github.com/rodw-au/rpi-img-builder-lcnc
This runs on a normal PC and cross compiles.
The main branch did compile 6.12
It would need cloning my 2.9.3 branch to a new branch and merging the master branch into it
Then a bit of massaging to remove the existing RT patch and configuring a few config files in the top level folder.

I remember seeing someone here saying you needed to set a few more config settings that used to be set in the patch. They also included a script to set it up. Perhaps that is your issue.

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

More
08 Jan 2025 17:25 #318436 by alangibson
Hi rodw. Thanks for the pointer. You must be referring to this thread below. I can't believe I missed it.

forum.linuxcnc.org/38-general-linuxcnc-q...6-12?start=10#315437

I'm going to try that patch and report back.

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

More
08 Jan 2025 21:56 #318471 by alangibson
So far so good. I now get "Note: Using POSIX realtime" after applying the patch from that post I linked. Thanks a lot rodw.

I've updated my gist for anyone that lands here in the future.
The following user(s) said Thank You: rodw

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

More
09 Jan 2025 02:17 #318492 by cornholio
The real time thing in the kernel seems a little confusing at the moment.

Unless a change is made to the /arch/Kconfig file you are unable to select a fully_preemptible kernel, which would appear the one required for Linuxcnc, the available info refers to this as RTOS. I'm not exactly clear about the amd64 kernel, as ATM I've only been interested in arm64 and specifically the bcm2712 kernel. I have tried the change the above mentioned file and can confirm the behavior.

Unfortunately I don't have a free SD card for testing and unable to get out to obtain one. So I can't comment on the kernel when booted, which is frustrating as I like to test things before commenting.

There is also the ability to select the type of real time kernel with via the kernel command line.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
09 Jan 2025 05:26 #318501 by rodw
Great work! thanks fo finding that thread for me :)
@cornholio, I think some of the enabling settings in menuconfig are ARM specific but they were there before 6.12 arrived.

We should be able to apply the required changes without a patch by changing the defconfig.
github.com/rodw-au/rpi-img-builder-lcnc/...onfig_defconfig#L112
That is probably cleaner
Can somebody let me know exactly what should be put in this file? (eg what is the result of the patch?0

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
09 Jan 2025 05:54 #318503 by rodw
For AMD64, these instructions apply
To get PREEMPT_RT at compile time, we need to enable "Fully Preemptible Kernel (Real-Time)" in the "Preemption Model" menu (of "General Setup", in make menuconfig), but "Fully Preemptible" is not an option visible by default, for that we need to enable the "Configure standard kernel features (expert users) (NEW)" option of "General Setup".

So its a bit different in the pi

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

More
09 Jan 2025 06:29 #318509 by alangibson
The patch adds this function:
#if defined(CONFIG_PREEMPT_RT)
static ssize_t realtime_show(struct kobject *kobj,
 struct kobj_attribute *attr, char *buf)
{
 return sprintf(buf, "%d\n", 1);
}
KERNEL_ATTR_RO(realtime);
#endif

The best thing would be for LinuxCNC to remove its dependency on /sys/kernel/realtime and check some other way. That's the only thing keeping LinuxCNC from at least starting up on an unmodified 6.12 kernel (caveat: I haven't cut anything with it yet).

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

More
09 Jan 2025 07:32 #318511 by cornholio
Rod I mentioned it via email what needs to be done.

This is an excerpt from the patch for arch/Kconfig
 config ARCH_SUPPORTS_RT
-	bool
+	def_bool y

Without this small edit, you don't get all 4 selections when you select which preempt model you need.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
09 Jan 2025 12:41 #318535 by rodw
1. @alan, in my build system with 6.1.2.y code, the patch causes the kernel build to fail
2. @rob, funny, I have never been asked for that for a long time PREEMPT_RT is always an option

Any ideas about 1 would be appreciated. ksysfs.c does not exist in my builder so I think I needs to directly set the konfig variables in the file I linked to earlier. I just don't know how yet.

For now, I have built it without the patch.

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

Time to create page: 0.328 seconds
Powered by Kunena Forum