- Posts: 99
- Thank you received: 23
Can the OPI5 be Configured to Run LCNC?
- echristley
- Offline
- Premium Member
-
Less
More
3 years 4 months ago - 3 years 4 months ago #274064
by echristley
Replied by echristley on topic Can the OPI5 be Configured to Run LCNC?
I've been running the gcode on an actual machine, but doubling the servo thread time period was enough to account for the network latency and eliminate the failures.
I have isolcpus set to 5,6,7.
'end1', the ethernet, is on interrupts 86 and 87 (not sure why two interrupts).
What I'm gather here is that I should:
echo "e0" > /proc/irq/86/smp_affinity
echo "e0" > /proc/irq/87/smp_affinity
I'll run the test is a couple hours if that is correct.
I have isolcpus set to 5,6,7.
'end1', the ethernet, is on interrupts 86 and 87 (not sure why two interrupts).
What I'm gather here is that I should:
echo "e0" > /proc/irq/86/smp_affinity
echo "e0" > /proc/irq/87/smp_affinity
I'll run the test is a couple hours if that is correct.
Last edit: 3 years 4 months ago by echristley.
- echristley
- Offline
- Premium Member
-
Less
More
- Posts: 99
- Thank you received: 23
3 years 4 months ago #274105
by echristley
Replied by echristley on topic Can the OPI5 be Configured to Run LCNC?
I've got wonderful news.
IT WORKS.
After moving the mill's base, I changed the smp_affinity. My isolcpu parameter is set to 2,4,5,6 and the end1 ethernet adapter is using IRQ 86 and 87. For some reason it didn't let me do it with sudo, I had to sudo su into root, but I
echo "32">/proc/irq/86/smp_affinity
echo "32">/proc/irq/87/smp_affinity
Ran the cds.ngc program in the examples folder, and got about halfway through the top before it errored out. Disappointing, but further than it had been getting without the modifications.
Then, I saw that 32 was not the correct hex for the bitmap from 2,4,5,6. I should have used "3c" (0011 1100). Go easy on me. I had just moved the heavy part of a 3500lb mill in the NC summer humidity.
Back to root to make the change,
echo "3c">/proc/irq/86/smp_affinity
echo "3c">/proc/irq/87/smp_affinity
then into PncConf to make sure I had the servo period set to 1000000. All good, then back to LinuxCNC.
It ran through the cds.ngc with no problem at 32ipm. , so I ran it again. Halfway through, I got bored, so I loaded up a couple more at random. The snowflake one had the motors shaking the wireframe shelf I have them sitting on. The round drill pattern one is cool to watch.
I'm going to do more testing (and of course some tuning), but it looks like setting the affinity is the answer.
IT WORKS.
After moving the mill's base, I changed the smp_affinity. My isolcpu parameter is set to 2,4,5,6 and the end1 ethernet adapter is using IRQ 86 and 87. For some reason it didn't let me do it with sudo, I had to sudo su into root, but I
echo "32">/proc/irq/86/smp_affinity
echo "32">/proc/irq/87/smp_affinity
Ran the cds.ngc program in the examples folder, and got about halfway through the top before it errored out. Disappointing, but further than it had been getting without the modifications.
Then, I saw that 32 was not the correct hex for the bitmap from 2,4,5,6. I should have used "3c" (0011 1100). Go easy on me. I had just moved the heavy part of a 3500lb mill in the NC summer humidity.
Back to root to make the change,
echo "3c">/proc/irq/86/smp_affinity
echo "3c">/proc/irq/87/smp_affinity
then into PncConf to make sure I had the servo period set to 1000000. All good, then back to LinuxCNC.
It ran through the cds.ngc with no problem at 32ipm. , so I ran it again. Halfway through, I got bored, so I loaded up a couple more at random. The snowflake one had the motors shaking the wireframe shelf I have them sitting on. The round drill pattern one is cool to watch.
I'm going to do more testing (and of course some tuning), but it looks like setting the affinity is the answer.
The following user(s) said Thank You: tommylight, royka
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 383
- Thank you received: 135
3 years 4 months ago #274125
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
That's great news indeed!
sudo echo doesn't work directly indeed, but instead you could type:
echo 3c | sudo tee /proc/irq/86/smp_affinity
"3c" (0011 1100) = cpu 2,3,4,5
Setting the IRQ affinity this way is temporary, so after a reboot you'll have to type it again. You could try to add the commands to /etc/rc.local before the last line "exit 0", then check "cat /proc/irq/86/smp_affinity" if it worked.
In rc.local you don't have to use sudo tee
I'm not sure if isolcpus=2,4,5,6 is optimal but at least it works, I've just did a fresh install on my Opi5 and will do some tests too.
sudo echo doesn't work directly indeed, but instead you could type:
echo 3c | sudo tee /proc/irq/86/smp_affinity
"3c" (0011 1100) = cpu 2,3,4,5
Setting the IRQ affinity this way is temporary, so after a reboot you'll have to type it again. You could try to add the commands to /etc/rc.local before the last line "exit 0", then check "cat /proc/irq/86/smp_affinity" if it worked.
In rc.local you don't have to use sudo tee
I'm not sure if isolcpus=2,4,5,6 is optimal but at least it works, I've just did a fresh install on my Opi5 and will do some tests too.
The following user(s) said Thank You: rodw
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 383
- Thank you received: 135
3 years 4 months ago #274145
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
After loading a 42mb gcode file it immediately threw a hmread error. After moving the irq affinity of eth0 (only the one with interrupts) to core 5 (HEX 20) it runs fine.
isolcpus=5,7
TBH the reason why isolcpus=5,7 runs better than isolcpus=7 I don't know, but somehow it seems to be. My first thoughts was that they might share the same timer, but after looking at the dtb this isn't the case. Perhaps the timers come from the same mcu?
isolcpus=5,7
TBH the reason why isolcpus=5,7 runs better than isolcpus=7 I don't know, but somehow it seems to be. My first thoughts was that they might share the same timer, but after looking at the dtb this isn't the case. Perhaps the timers come from the same mcu?
- echristley
- Offline
- Premium Member
-
Less
More
- Posts: 99
- Thank you received: 23
3 years 4 months ago #274158
by echristley
Replied by echristley on topic Can the OPI5 be Configured to Run LCNC?
I was thinking, when I ran my long latency test, I got some strange outlier interrupts when I did it with youtube running in the background. Youtube would have been running over the internet.
I'm thinking it worthwhile to bring the machine back in (not internet access in the workshop) to rerun the test with Youtube and the IRQ affinity set.
I'm thinking it worthwhile to bring the machine back in (not internet access in the workshop) to rerun the test with Youtube and the IRQ affinity set.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 383
- Thank you received: 135
3 years 4 months ago #274168
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
I've seen that too while playing a yt video in the background. It looked like the video froze while it was out of sight and filling up the memory, the moment I made the window active it catched up and that seemed to cause the latency.
If you had the same issue I don't expect that the IRQ affinity will help. Playing yt works fine as long as you pause the video before you bring it to the background. Perhaps the newer kernel or updating mpp will fix it.
If you had the same issue I don't expect that the IRQ affinity will help. Playing yt works fine as long as you pause the video before you bring it to the background. Perhaps the newer kernel or updating mpp will fix it.
Time to create page: 0.482 seconds