[FR] Select CPUs/Cores klipper runs on

Not sure if this is a hardware issue, linux issue or klipper issue, but I’m running an OrangePi 5 which has an RK3588s SOC which has 4 A76 cores and 4 A55 cores in a big.LITTLE configuration. I was getting some wonky performance. QGL /bed mesh in particular had many noticeable pauses, occasional timeouts. At first I was blaming my CAN setup (which probably was exacerbating the situation), but on a whim I disabled all of the little cores and now everything runs beautifully.

My thought was if klipper itself can limit itself to run only on certain cores (defined in a config file perhaps), that could help solve some timing issues that might arise from heterogenous processors.

It could also be OS related.

I’m running Armbian on a Odroid X4U (32 bit) with no issues in QGL or ABL.

**Host** (armv7l, 32bit)
Version: v0.11.0-52-g40d8c2ef
OS: Debian GNU/Linux 10 (buster)
Distro: armbian

Armbian builds are specific per SBC, so there could be some OrangePi/Odroid build differences that might make Klipper operate differently. .

You can try to Set the cpu affinity in the systemd klipper Service file like this:

[Service]
CPUAffinity=13

You have to calculate the Correct Mask for your cores you want to run klipper on

After that:

Sudo systemctl daemon-reload

After that

Sudo service klipper restart