find_rt_cpu_number() Error in uspace_rtapi_app.cc on PREEMPT_RT
- WonderOwl
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
14 Jan 2025 02:05 #318916
by WonderOwl
find_rt_cpu_number() Error in uspace_rtapi_app.cc on PREEMPT_RT was created by WonderOwl
Hi, I am new to LinuxCNC and have some questions about how LinuxCNC find the RT CPU (isolate CPU core) on PREEMPT_RT.
It seems the find_rt_cpu_number() function in uspace_rtapi_app.cc either choose the environment variable RTAPI_CPU_NUMBER (which is NULL if not set manually) or choose the last CPU core regardless of whether there is an isolated core.
e.g. The isolate core on my Preempt_RT is core 1, but find_rt_cpu_number() returns 3 and the RT thread is running on core3 in the attached images.
My test version is LINUXCNC - 2.10.0~pre0. Thx for your time :-D
It seems the find_rt_cpu_number() function in uspace_rtapi_app.cc either choose the environment variable RTAPI_CPU_NUMBER (which is NULL if not set manually) or choose the last CPU core regardless of whether there is an isolated core.
e.g. The isolate core on my Preempt_RT is core 1, but find_rt_cpu_number() returns 3 and the RT thread is running on core3 in the attached images.
My test version is LINUXCNC - 2.10.0~pre0. Thx for your time :-D
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4868
17 Jan 2025 18:37 #319203
by andypugh
Replied by andypugh on topic find_rt_cpu_number() Error in uspace_rtapi_app.cc on PREEMPT_RT
This isn't an answer to your question, but it looks like you can override it with an environment variable:
github.com/LinuxCNC/linuxcnc/blob/master...ce_rtapi_app.cc#L984
It might be interesting in your case to do that and see if latency improves.
Are you using Linux and not BSD or similar? (I see a comment about it only working with Linux in one of the commits.
Otherwise, looking at the code, I have no idea how it works, it looks very odd.
github.com/LinuxCNC/linuxcnc/blob/master...ce_rtapi_app.cc#L984
It might be interesting in your case to do that and see if latency improves.
Are you using Linux and not BSD or similar? (I see a comment about it only working with Linux in one of the commits.
Otherwise, looking at the code, I have no idea how it works, it looks very odd.
Please Log in or Create an account to join the conversation.
- Grotius
- Online
- Platinum Member
Less
More
- Posts: 2267
- Thank you received: 2027
17 Jan 2025 23:52 #319233
by Grotius
Replied by Grotius on topic find_rt_cpu_number() Error in uspace_rtapi_app.cc on PREEMPT_RT
At line 996.call to retrieve the number of available CPUs
at line 1006. It runs over the cpu list.
then it sets the priority 0-100% for each used cpu.
sysconf(_SC_NPROCESSORS_ONLN)
at line 1006. It runs over the cpu list.
then it sets the priority 0-100% for each used cpu.
Please Log in or Create an account to join the conversation.
Time to create page: 0.055 seconds