RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
- alangibson
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 29
08 Jan 2025 11:38 #318392
by alangibson
RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime was created 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.
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
- Away
- Platinum Member
Less
More
- Posts: 10820
- Thank you received: 3565
08 Jan 2025 12:23 #318396
by rodw
Replied by rodw on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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.
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.
- alangibson
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 29
08 Jan 2025 17:25 #318436
by alangibson
Replied by alangibson on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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.
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.
- alangibson
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 29
08 Jan 2025 21:56 #318471
by alangibson
Replied by alangibson on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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.
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.
- cornholio
- Offline
- Platinum Member
Less
More
- Posts: 1127
- Thank you received: 373
09 Jan 2025 02:17 #318492
by cornholio
Replied by cornholio on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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.
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
- Away
- Platinum Member
Less
More
- Posts: 10820
- Thank you received: 3565
09 Jan 2025 05:26 #318501
by rodw
Replied by rodw on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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
@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
- Away
- Platinum Member
Less
More
- Posts: 10820
- Thank you received: 3565
09 Jan 2025 05:54 #318503
by rodw
Replied by rodw on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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
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.
- alangibson
- Offline
- Senior Member
Less
More
- Posts: 68
- Thank you received: 29
09 Jan 2025 06:29 #318509
by alangibson
Replied by alangibson on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
The patch adds this function:
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).
#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.
- cornholio
- Offline
- Platinum Member
Less
More
- Posts: 1127
- Thank you received: 373
09 Jan 2025 07:32 #318511
by cornholio
Replied by cornholio on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
Rod I mentioned it via email what needs to be done.
This is an excerpt from the patch for arch/Kconfig
Without this small edit, you don't get all 4 selections when you select which preempt model you need.
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
- Away
- Platinum Member
Less
More
- Posts: 10820
- Thank you received: 3565
09 Jan 2025 12:41 #318535
by rodw
Replied by rodw on topic RPi 5 with 6.12 PREEMPT_RT = Using POSIX non-realtime
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.
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