Debian 12 Bookworm Linuxcnc 2.9.2....Latency problem

More
05 May 2024 08:40 #299789 by hitchhiker
i must :
sudo apt-get install dc

because =
./pinirq: Zeile 3: dc: Kommando nicht gefunden.

./pinirq enp2s0
./pinirq: Zeile 3: dc: Kommando nicht gefunden.
Cores: 4
Old CPU Mask: f
./pinirq: Zeile 6: /proc/irq/27/smp_affinity: Keine Berechtigung
Set device enp2s0 IRQ 27 CPU mask to f

then i must=
sudo ./pinirq enp2s0
because of =
./pinirq: Zeile 6: /proc/irq/27/smp_affinity: Keine Berechtigung


after this i get =

Cores: 4
Old CPU Mask: f
Set device enp2s0 IRQ 27 CPU mask to 8

then i start linuxcnc and look to the hals

servo-thread ( 239092, 848396 )
217488 hm2_7i92.0.read.time
22292 hm2_7i92.0.write.time

now i let my gcode run...


i am on an fresh installed iso 2.9.2!
rt_setup.sh not installed!

only the kernel is changed to =
uname -v=
#3 SMP PREEMPT_RT Sun Apr 28 23:39:38 CEST 2024

cat /proc/cmdline=
BOOT_IMAGE=/boot/vmlinuz-6.9.0-rc5-rt1+ root=UUID=1c171f88-4f36-42ba-b84a-1dcf20ae1a6b ro initrd=/install/gtk/initrd.gz quiet

and only add this to grub =
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noresume isolcpus=3"

and then start this by hand =
sudo ./pinirq enp2s0

i checked now if rc.local present=
udo systemctl status rc-local
○ rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Drop-In: /usr/lib/systemd/system/rc-local.service.d
└─debian.conf
Active: inactive (dead)
Docs: man:systemd-rc-local-generator(8)

sudo geany /etc/rc.local
shows me a empty file!

sudo geany /lib/systemd/system/rc-local.service
shows me =
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

i reopen with sudo geany /etc/rc.local the rc.local file and add to the file =
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

then i use=
sudo thunar
to copy the pinirq to /etc/

in terminal
sudo chmod +x /etc/pinirq
sudo chmod +x /etc/rc.local
sudo systemctl enable rc-local
sudo systemctl start rc-local
sudo systemctl status rc-local.service

then i get =

rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; preset: enabled)
Drop-In: /usr/lib/systemd/system/rc-local.service.d
└─debian.conf
Active: active (exited) since Sun 2024-05-05 10:21:59 CEST; 9min ago
Docs: man:systemd-rc-local-generator(8)
Process: 3091 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
CPU: 2ms

Mai 05 10:21:59 debian systemd[1]: Starting rc-local.service - /etc/rc.local Compatibility...
Mai 05 10:21:59 debian systemd[1]: Started rc-local.service - /etc/rc.local Compatibility.


now i need to add the /etc/pinirq to rc.local?!how?

sudo geany /etc/rc.local
and then

/etc/pinirq enp2s0
over exit 0?

then in terminal
sudo systemctl daemon-reload

restart computer..


now i test again.

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

More
05 May 2024 09:00 #299790 by hitchhiker
i look to latncy histogram.... the spike stays... but linuxcnc runs... will run again a large gcode.. 

sorry for the big post but it could be possible that we are on the way to solve my issue.. and i think its nice to share it complete with others.


does someone have more information about the spike?! i absolut new to the debian 12 problem.. thats why i have a mirrored linux with debian 10 running 
Attachments:

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

More
05 May 2024 09:07 #299791 by hitchhiker
servo-thread ( 415228, 4213244 )


with 8 youtube single windows and gcode running.. still runs

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

More
05 May 2024 10:15 #299795 by royka
I'm not sure if adding the line to rc.local is the best solution, but if it works it's okay. If it doesn't you might need to delay it, then you'll have:
sleep 10 && /etc/pinirq enp2s0
exit 0

Otherwise you can add it to crontab with: sudo crontab -e
Then add the following line:
@reboot sleep 10 && /etc/pinirq enp2s0

You can see if it works with "cat /proc/interrupts", the interrupts of enp2s0 should be on the last cpu.

Since you use a Mesa card you don't need a base thread so you could run:
latency-histogram --nobase

These kernel parameters reduced the latency on my Optiplex 7040 micro:
isolcpus=3 intel_pstate=disable processor.max_cstate=0 idle=poll cpufreq.default_governor=performance i915.enable_dc=0 ahci.mobile_lpm_policy=1 irqaffinity=0 nomodeset quiet
The following user(s) said Thank You: vre

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

More
05 May 2024 10:42 #299796 by hitchhiker
it works but my servospindle gets error 190... this means vibration... this is new to me...

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

More
05 May 2024 11:39 #299800 by hitchhiker
servo error comes on deb 10 the same.. its the driver.. my fault...

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

More
05 May 2024 14:16 #299810 by PCW
Here is the same script modified so it does not use "dc"

File Attachment:

File Name: pinirq_2024-05-05.txt
File Size:0 KB
Attachments:
The following user(s) said Thank You: vre, royka

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

Time to create page: 0.340 seconds
Powered by Kunena Forum