Latency test

More
02 Jan 2023 21:58 - 02 Jan 2023 22:04 #260803 by Stanislavz
Latency test was created by Stanislavz
Hello !

I was passive user of Linuxcnc for 10 years. Used it on my first cnc foam cutter and it was ok. It still runs Ubuntu 10 on lenovo t61 with lpt on docking station and all is ok for foam cutter.
Now i am upgrading supermax ycm40 cnc mill. Its comes with kolmorgen servos and drivers, but without controller.
Solved it by making custom step-dir to 0-10v converter with encoder feedback. A long story short.
First cpu rig was with n270 intel atom it was barely useable, and gives latency in 50-70k range. System itself was sloow. And i was limited to 32 bits linuxcnc only.

Problem - it was an industrial pc rig and lcd monitor was connected via lvds connector.
Another three intel atom mother boards with d2500, d2550 and d525 - before i was able to connect lvds cable propertly. After some modification still.

And - only two of them were able to run latest 2.8 version. But latency was in 50k region again.

But it was in 35k on 2.7 version. And it was ok for the time.

Recently, i bought separated lcd frame with same dimension as in my panel and with vga connector. And Asrock j3355b-itx mb.

After some tweaking, isolcpus=1 and disabling most of advanced feautures in bios, i am in a 25k region while watching youtube etc..

Feeling half hungry up here - was expecting more. Or 25k is ok for j3355 cpu ? Running latest 2.8.4 buster ?


Yes, i do run stepgen via lpt. I need 2000 pulses per rotation, my screw have 5mm lead..
Last edit: 02 Jan 2023 22:04 by Stanislavz.

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

More
02 Jan 2023 22:22 - 02 Jan 2023 22:36 #260804 by NTULINUX
Replied by NTULINUX on topic Latency test
Debian Buster's PREEMPT_RT kernel config:

# CONFIG_RCU_NOCB_CPU is not set
# CONFIG_NO_HZ_FULL is not set

Debian Bullseye has the same things unset..

So for possibly lower latency, you're best off trying to upgrade to either bookworm (testing) or sid (unstable) because of the following in linux-image-6.0.0-6-rt-amd64:

CONFIG_RCU_NOCB_CPU=y
CONFIG_NO_HZ_FULL=y

Then on the kernel command line, try:

isolcpus=1 nohz_full=1 rcu_nocbs=1

One setting which Debian still has disabled however is:

# CONFIG_SCHED_CORE is not set

For lowest latency, that option should also be enabled. In any case, please give that a go and report your latency test results! I'm very curious because I have no Intel hardware to test with and this would be an excellent A/B comparison.

Feel free to mess with those settings a bit such as:

isolcpus=1 rcu_nocbs=1

or:

isolcpus=1 nohz_full=1

as well. The nohz_full and rcu_nocbs options do not function in Debian Buster/10.

Firefox/YouTube kills latency, best off not doing that if machining ;)

Oh! You can also try specifying "nomodeset" (without quotes) on the kernel command line too.

On paper, and mind you, I actually had worse latency using nohz_full (lol) the best options would theoretically be, for a dual-core processor:

isolcpus=1 nohz_full=1 rcu_nocbs=1 nomodeset idle=poll

Forgot about idle=poll

You can also try:

intel_idle.max_cstate=0 intel_pstate=disable

or:

intel_idle.max_cstate=0 intel_pstate=no_hwp

Not sure what the difference is really, haven't tested either, I have all AMD here.

So, we now have..

isolcpus=1 nohz_full=1 rcu_nocbs=1 nomodeset idle=poll intel_idle.max_cstate=0 intel_pstate=disable

YMMV!!! Good luck!! Cheers!
Last edit: 02 Jan 2023 22:36 by NTULINUX. Reason: little tip about Firefox/YouTube, more latency tips, fix
The following user(s) said Thank You: Stanislavz

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

More
02 Jan 2023 22:22 #260805 by tommylight
Replied by tommylight on topic Latency test
You can try installing the RTAI kernel and see if that gives better latency, although it is pretty good as is.
linuxcnc.org/docs/2.8/html/getting-start...#cha:Installing-RTAI
The following user(s) said Thank You: NTULINUX, Stanislavz

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

More
02 Jan 2023 22:43 #260807 by Stanislavz
Replied by Stanislavz on topic Latency test
Lets give it a shot.
Attachments:

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

More
02 Jan 2023 22:50 #260808 by Stanislavz
Replied by Stanislavz on topic Latency test
10k with youtube.
Going next.
Attachments:

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

More
02 Jan 2023 22:53 - 02 Jan 2023 22:56 #260809 by NTULINUX
Replied by NTULINUX on topic Latency test
Fix the nohz=1 to nohz_full=1

Then make sure you update grub so your new defaults take effect. Note that the nohz_full and rcu_nocbs settings will not work on Buster, others should work just fine.

Also, I found my RTAI guide:

forum.linuxcnc.org/18-computer/47425-rta...ebs-available#258025

For RTAI, you may only need isolcpus=1 or perhaps nothing at all. cstates and all the idle stuff is automatically disabled through Kconfig using my RTAI tree.

To make sure your new settings are working on your next boot, run:
cat /proc/cmdline
Last edit: 02 Jan 2023 22:56 by NTULINUX. Reason: minor adjustment
The following user(s) said Thank You: Stanislavz

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

More
02 Jan 2023 22:55 #260810 by Stanislavz
Replied by Stanislavz on topic Latency test
12-13k with two intel parameters. Reverting back..
Attachments:

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

More
02 Jan 2023 23:14 #260812 by Stanislavz
Replied by Stanislavz on topic Latency test
Glxgears, wifi usb removes. Still in 10k region. Starting to like it. Fixed mentioned parameter, updated grub.
Attachments:

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

More
02 Jan 2023 23:28 #260814 by NTULINUX
Replied by NTULINUX on topic Latency test
Did you upgrade to bookworm/testing or sid?

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

More
03 Jan 2023 06:30 - 03 Jan 2023 06:32 #260825 by Stanislavz
Replied by Stanislavz on topic Latency test
No, i have not update it at all. Hot wifi only a day after install.
Shell i do it ?
All night running with glx gears - 11k.
Much better whan it was.
 
Last edit: 03 Jan 2023 06:32 by Stanislavz.

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

Time to create page: 0.139 seconds
Powered by Kunena Forum