Error finishing read... *sigh*

More
14 Jun 2025 16:44 #330278 by SebastianM
Error finishing read... *sigh* was created by SebastianM
Hello everyone. 
I know there are plenty of other threads about this topic, and I think I read them all, still I struggle to solve the issues that I am having.

My setup is:
  • Dell Wyse 5070 with Celeron J4105 4-core cpu THIN CLIENT
  • realtek onboard NIC
  • fresh Linuxcnc 2.9.3 install
  • brandnew Mesa 7i76eu, flashed with pktUART firmware
I experience issues when I startup Linuxcnc / probebasic.
Most of the time the system errors out right after startup with "error following read...". Sometimes I am "lucky" and it works for maybe 5minutes before it errors out. 

What I did so far (after reading in this forum for 2 nights):
  • I ran sudo chrt 99 ping -1.001 -q 10.10.10.10 to get some statistics. Here is the result:

    179555 packets transmitted, 179555 received, 0% packet loss, time 180656ms
    rtt min/avg/max/mdev = 0.052/0.065/8.974/0.036

  • disabled all BIOS options regarding power management, hyperthreading, ... etc
  • Installed R8168-dkms driver (sudo apt-get install r8168-dkms)
    While searching in this forum, I found that some people had to install linux headers first. I did not do that. 
    When I run a script to identify the used drivers (JCW posted this somewhere a while ago), i get the followig result:
    ./edriver.txt
    xargs: warning: options --max-args and --replace/-I/-i are mutually exclusive, ignoring previous --max-args value
    enp1s0 : r8169
    wlp0s12f0 : iwlwifi


    Is this result "expected? Or did the driver installation not work?
    Other people posted that they had to install linux-headers and purge the old driver... 
  • then I found a script that JCW posted in another thread that pins the IRQ somewhere (I honestly dont really understand whats behind this, but still this is the output):
    cnc@linuxcnc:~/gcodes$ sudo ./pinirq.txt enp1s0
    Cores: 4
    Old CPU Mask: f
    Set device enp1s0 IRQ 122 CPU mask to 8


    However, it did not improve my ping / latency at all. Do I need to do anything prior to that? Isolating something?
What I have not done yet:
  • editing the kernel parameters in grub customizer (quiet isolcpus= 3 pcie.aspm=0 r8168.eee_enable=0 pcie_aspm=off idle=poll).
    I dont really understand what this does, therefore I hesitated to run it. 
  • .... 
Another question... almost all other threads regarding this issue link to a tutorial / troubleshooting file that was hosted by @rodw on google drive, but the link is dead. Could someone provide this file?

regards and thx.
Sebastian
 

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

More
14 Jun 2025 18:12 #330279 by PCW
Replied by PCW on topic Error finishing read... *sigh*
Definitely do the grub (kernel command line) change, also the pinirq script will have
minimal effect unless you add the isolcpus line.

 

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

More
14 Jun 2025 19:09 - 14 Jun 2025 19:21 #330280 by SebastianM
Replied by SebastianM on topic Error finishing read... *sigh*
No idea if I did anything wrong, but after I applied that line from above and rebooted, Debian won’t launch the desktop environment anymore. I can manually start xfce. Never mind 
Last edit: 14 Jun 2025 19:21 by SebastianM.

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

More
14 Jun 2025 19:20 - 14 Jun 2025 19:21 #330281 by SebastianM
Replied by SebastianM on topic Error finishing read... *sigh*
Alright. I applied that command in the grub configurator, rebooted and ran the pinIRQ script again.
ping times look much better (dropped from 8 to 1.2), but I am still too high... right?

first

sudo ./pinirq.txt enp1s0
Cores: 4
Old CPU Mask: f
Set device enp1s0 IRQ 121 CPU mask to 8


then

cnc@linuxcnc:~/gcodes$ sudo chrt 99 ping -i .001 -q 10.10.10.10
PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.
^C
--- 10.10.10.10 ping statistics ---
142832 packets transmitted, 142831 received, 0.000700123% packet loss, time 143400ms
rtt min/avg/max/mdev = 0.056/0.108/1.211/0.035 ms


 
Last edit: 14 Jun 2025 19:21 by SebastianM.

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

More
14 Jun 2025 19:52 #330282 by PCW
Replied by PCW on topic Error finishing read... *sigh*
Might be usable with a 2 ms servo thread.

I would check how LinuxCNC runs now

 

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

More
14 Jun 2025 20:05 - 14 Jun 2025 20:07 #330283 by SebastianM
Replied by SebastianM on topic Error finishing read... *sigh*
Thx Peter. Really appreciate your help. Last question …. Can you tell if my realtek nic is using the dkms driver or not? I attached the output of a script that you posted somewhere.Like I said in the first posting, I didn’t know that Linux headers might have been necessary when I installed dkms.  
Attachments:
Last edit: 14 Jun 2025 20:07 by SebastianM.

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

More
14 Jun 2025 23:56 #330289 by DMNZ
Replied by DMNZ on topic Error finishing read... *sigh*
after installing the driver run this to check that it is the right one being used:
sudo lspci -v
under Realtek controller check Kernel driver in use, it should be r8168. (see attached screenshot)

to avoid problems i suggest to blacklist the r6169 driver completely in grub by adding: modprobe.blacklist=r8169

or, since your pc looks similar to mine you can add the whole my line to /etc/default/grub which through trial and error i found the most stable:

GRUB_CMDLINE_LINUX="irqaffinity=0-1 kthread_cpus=0-1 isolcpus=domain,managed_irq,2-3 rcu_nocb_poll pcie_aspm=off r8168.aspm=0 r8168.eee_enable=0 modprobe.blacklist=r8169,mei_txe"

don't worry it will not kill your pc  it just rebalance your cores to do different things. 

dont forget to run "sudo update-grub" to update grub configuration otherwise you won't see any changes after restart.

also check sudo dmesg for any errors during boot.

having 1.2ms ping once in a blue moon won't kill you. i suggest to add "grep -v time=0." to see how many actual pings you got over 1ms.

i normally run something like this:

sudo chrt 99 ping -i 0.001 -q 10.10.10.10 -c 1800000 | grep -v time=0. 

this will run ping for 30 minutes with 1ms pings and only show you the pings that took longer then 0.999 ms.

if you see only one or two 1.2 ms in 30 minutes it is not a problem, 8ms is super bad though. 

have fun!
Attachments:
The following user(s) said Thank You: SebastianM

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

More
15 Jun 2025 03:57 #330292 by SebastianM
Replied by SebastianM on topic Error finishing read... *sigh*
thank you, that is very helpful.
By running "sudo lspci -v", I could confirm that the right driver is used (see attachment).

 

But when I try to run the modified ping command, the result is just the same as before. It doesnt filter out any packets over 1ms... again, see screenshot.
I guess the command has to be modified a bit...
 
Regards and thank you
Sebastian
Attachments:

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

More
15 Jun 2025 05:32 #330295 by DMNZ
Replied by DMNZ on topic Error finishing read... *sigh*
sorry, my bad, you should remove that -q in the command which makes your ping output quiet. try this:
sudo chrt 99 ping -i 0.001 10.10.10.10 -c 1800000 | grep -v time=0.

btw. are you still getting that error finishing read?

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

Time to create page: 0.099 seconds
Powered by Kunena Forum