nokyan / resources

Keep an eye on system resources
GNU General Public License v3.0
613 stars 47 forks source link

Wrong detection of the number of logical cpus #209

Closed adm313 closed 2 months ago

adm313 commented 2 months ago

Is there an existing issue for this?

Current Behavior

Hi I've lately installed Resources and I've seen that it is doubling the number of logical cpus. My system is a Lenovo P900 with 2 E5-2690V3 cpus (12 core each). The overall number should be 48 as lscpu & htop show but Resources show 96 ....

Expected Behavior

Show 48 graphs instead of 96

Steps To Reproduce

No response

Environment

Version 1.4.0
Flatpak distribution
Ubuntu 23.10

Anything else?

image

adm313 commented 2 months ago

I've taken a look at the source and (maybe) the error is here

let logical_cpus = RE_LSCPU_CPUS.captures(&lscpu_output).and_then(|captures| { captures.get(1).and_then(|capture| { capture .asstr() .parse::() .ok() *.map(|int| int sockets.unwrapor(1))** }) });

The cpu number is already doubled for the two sockets in the CPUs field of lscpu output.

nokyan commented 2 months ago

Sweet, I'm gonna fix that soon. I'll add this multiplication with sockets for the physical CPUs section though, I think that's more intuitive instead of showing the physical CPUs of just one CPU. If I can find some more smaller bugs to squash, I'll release this fix with Resources 1.4.1. :)