×
Test (Today)

test of forum features

Real-time kerel not detected on patched 6.12

More
24 Nov 2024 03:08 #315159 by royka
It should work indeed when selected fully preempted. At least it worked for me until 6.11 (after patching). What's strange for me is that when it's set manually to rt prio it works

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

More
26 Nov 2024 11:18 #315286 by rodw

www.phoronix.com/news/Linux-6.12-Does-Real-Time
6.12 does not need patching for AMD64 according to the above, it should work with just setting the preemption to full. That needs to be tested.
 

Not so lucky Tommy. You still need to compile the kernel to get PREEMPT_RT on 6.12 after setting fully preemptible kernel under general settings in menuconfig when compiling the kernel.
But you no longer need to apply the RT patch before compiling the kernel.
There are a few tutorials on this. HEre is one for the Pi 5
github.com/by/RT-Kernel
The following user(s) said Thank You: tommylight, Aciera

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

More
26 Nov 2024 11:53 #315289 by rodw
This is actually quite exciting for Pi users. One of the problems using earlier pi kernel code (eg the rpi-6.1.y  branch used in linuxcnc) was that you had to pull code at a specific commit that matches the RT patch as there was a risk the code deviated too far from the patch and you ended up building a broken kernel. By using the 6.12.y branch head of the Pi kernel, it will always be up to date :)
Interested users who wanted to compile a complete image for the pi4b or pi5 could clone the linuxcnc rpi-img-builder-lcnc (2.9.3 branch) or the master version in my repo which is arguably more up to date.
github.com/rodw-au/rpi-img-builder-lcnc/tree/linuxcnc-2.9.3
You would need to:
1. delete the RT patch in github.com/rodw-au/rpi-img-builder-lcnc/.../patches/userpatches
2. delete the commit details (2 lines) here github.com/rodw-au/rpi-img-builder-lcnc/...9.3/userdata.txt#L28
3. Change the kernel version here  to 6.12.y github.com/rodw-au/rpi-img-builder-lcnc/....9.3/userdata.txt#L7
 And it should build. (cross compiled on an x86 PC)

Bonus marks if you merge the upstream repo in but that will likely break some of the config files which will need tweaking after recreating.
 
The following user(s) said Thank You: TomAlborough

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
26 Nov 2024 17:39 #315315 by tommylight
Replied by tommylight on topic Real-time kerel not detected on patched 6.12
Oh well, another dream shattered ! :)
The following user(s) said Thank You: rodw

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

More
28 Nov 2024 06:08 - 28 Nov 2024 06:39 #315437 by royka
Solved, the issue is that LinuxCNC checks /sys/kernel/realtime for a 1. The realtime patch added this but this part didn't become mainline.
I made this patch in case someone else wants to compile a custom kernel.

 

File Attachment:

File Name: sys-kernel...me.patch
File Size:1 KB


 
Attachments:
Last edit: 28 Nov 2024 06:39 by royka.

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

More
30 Nov 2024 12:15 #315643 by royka
@rodw Can you confirm that it's the same with the Raspberry or is that kernel source already patched?

I noticed that the patch only works when VMCORE_INFO=y which gets selected by:
 - CRASH_DUMP [=y] && ARCH_SUPPORTS_CRASH_DUMP [=y] && KEXEC_CORE [=y] 
 - PROC_KCORE [=y] && PROC_FS [=y] && MMU [=y]

Is really necessary for LinuxCNC to check that /sys/kernel/realtime or will checking for "PREEMPT_RT" in uname -v be enough?

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

More
30 Nov 2024 19:23 #315677 by rodw

@rodw Can you confirm that it's the same with the Raspberry or is that kernel source already patched?
 

Sorry, I have no Idea. I don't have a Pi5.
Did you find the code Linuxcnc uses for this check in Git?
 
The following user(s) said Thank You: royka

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

More
30 Nov 2024 21:36 #315687 by royka
Alright, I assumed you would have one since you have an rpi image builder. But likely it uses a prebuild from Debian that seems to be patched already.

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

More
01 Dec 2024 06:14 #315706 by rodw

Alright, I assumed you would have one since you have an rpi image builder. But likely it uses a prebuild from Debian that seems to be patched already.

Yes, I built the Pi images for Linuxcnc you find on the downloads page. I shared my repo for the builder on this thread earlier. Bear in mind the pi5 was released just after we released Linuxcnc 2.91 and at the time pi5 support was patchy in the upstream builder. I've since updated the builder and it has been tested on the Pi5 and the shortcomings are reported to be gone.

We actually build the kernel .deb from the official Raspberry pi kernel repo and wrap Debian around it and build a compressed image. The 6.12  kernel should be supported by the builder. You should give it a go. As its cross compiled, building the kernel will be quicker than  it can ever be on a Pi and the kernel as well as an optional img (which we compress) is built.

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

More
08 Jan 2025 21:58 #318472 by alangibson
Replied by alangibson on topic Real-time kerel not detected on patched 6.12
@royka I can confirm that you fix works on Raspberry Pi 5. See this thread:

forum.linuxcnc.org/media/kunena/attachme...ernel-realtime.patch
The following user(s) said Thank You: rodw, royka

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

Time to create page: 0.313 seconds
Powered by Kunena Forum