Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Processor Cores affinity? #650

Open
Sarah-Connelli opened this issue Jan 19, 2025 · 3 comments
Open

Feature request: Processor Cores affinity? #650

Sarah-Connelli opened this issue Jan 19, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Sarah-Connelli
Copy link

Sarah-Connelli commented Jan 19, 2025

Hi, firstly many thanks for this, a great useful app.

The one issue I witnessed with this was that you can't set the affinity of the python process in Windows to specific cores, so it is always running on core 0, which adds latency to quite a few games etc, meaning I need to kill the python app first, play a game or whatnot, and then restart this app after finishing.

What would be good is to be able to assign a specific core affinity? I've seen this done with other projects, apparently you just need to import the multiprocessor lib and launch the main process on a particular core.

Ideally I prefer to not run background apps on the first 4 cores, and I can change the affinity for the apps via the Task Manager in Windows. Maybe a config.yaml entry to specify which cores should be permitted, the OS manages the threads then accordingly but among the chosen cores?

Hope this is doable as this is a great app, but being forced to it running on Core 0, impacts the core latency for other tasks. Not usually noticeable until you hit a very demanding unit of work in an app such as a game etc.

Heres a short example:
https://stackoverflow.com/questions/36172101/designate-specific-cpu-for-a-process-python-multiprocessing?noredirect=1&lq=1

@Sarah-Connelli Sarah-Connelli added the enhancement New feature or request label Jan 19, 2025
@Sarah-Connelli
Copy link
Author

Just did a small comparison with the official 'TURZX.exe' app, and that cycles within the range of 0.3% to 0.5% CPU usage and Task Manager marks the power consumption as 'Very Low' and now and again it changes to 'Low'.

However, this app pegs CPU usage at 1%, and the Task Manager marks the power consumption as 'Moderate'.

Is there anything that can be done to bring that cpu usage down to 0.5% or less?

@Sarah-Connelli
Copy link
Author

Sarah-Connelli commented Jan 20, 2025

Update:

Ah, I changed 'HW_SENSORS:' from LHM to PYTHON and now the Task Manager is able to set the core affinity of the python process.

So it seems the 'LibreHardwareMonitorLib.dll' is the culprit? as in when this app is using LHM, core affinity cannot be assigned externally via Task Manager or powershell etc.

Only problem with setting HW_SENSORS from LHM to PYTHON is that I don't get the dynamic CPU frequency update nor the CPU temp.

@Sarah-Connelli
Copy link
Author

Sarah-Connelli commented Jan 20, 2025

Yes, the culprit for locking affinity is indeed the 'LibreHardwareMonitorLib.dll'.
HWINFO doesn't lock affinity, so it seems the LHM devs have taken the easy way out to how they measure individual cores?...

Found this: Rem0o/FanControl.Releases#2527

Apparently no way around it, it is by design.

So I think I will stick to the PYTHON setting for sensors, and have to live without the CPU temp on the display.

Unless there is another solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant