Curious about limiting virtual cpu cores on an old i5 Haswell

Been using a now quite old computer as a dedicated music recorder for a long time but have never considered whether this i5 Haswell’s “virtual” cores may have more of a negative impact for plugins on this 2014 Macbook Pro which runs MX Linux quite well and covers my needs for everything aside from video editing and anything 3D graphics related.

So I guess a few questions for anyone who can share are: If I were to disable the virtual cores, would I see a benefit for plugin use in DAWS such as Ardour? If I limit the cores in Ardour’s preferences for plugins to 2, will they then avoid the two virtual cores or do I have to do that on the OS boot level somehow?

I’ve seen I can basically edit GRUB to boot with maxcpus=2 but I’m unsure if this would essentially disable the virtual cores or what the outcome would be and if that might be negative.

Using only the primary cores and not the virtual cores can sometimes have a benefit for low latency use. You would have to try it and see, but it probably won’t be worse.

No, the linux scheduler treats primary cores and virtual cores as all useable, so there is a possibility that if you limit ardour to using 2 cores it could end up using 2 virtual cores.

The best place to do that is in the system firmware setup, either BIOS or UEFI depending on what kind of machine you have.

1 Like

Do you mean hyperthreading aka. Simultaneous MultiThreading (SMT)?

If so the Linux sheduler is aware of those and when you set Ardour to only use half of the available CPUs it’ll avoid those.

You can also toggle it at runtime:

#!/bin/sh
if grep -q on /sys/devices/system/cpu/smt/control; then
   echo off | sudo tee /sys/devices/system/cpu/smt/control
else
   echo on | sudo tee /sys/devices/system/cpu/smt/control
fi
1 Like

I suppose this is about hyperthreading. It has 2 physical cores and it has 4 threads which get viewed by software on the system as 4 available cores… unless I’m not grokking this properly. (i5-4278U)

So disabling SMT will allow it to focus on the physical cores as 2 individual cores or does it disable hyperthrading between the two of them as well? Could no hyper-threading overall be preferred?

But that said if I limit the cores in ardour to half like you mentioned, which is 2 in this case, and the linux scheduler is ltkely to select one thread from each physical core rahter than two threads from the same physical core, then I’ll give that a go today.