LibreHardwareMonitor icon indicating copy to clipboard operation
LibreHardwareMonitor copied to clipboard

Core Count is wrong...

Open ElectroAttacks opened this issue 2 years ago • 0 comments

I have a CPU with SMT, 8 Cores / 16 Threads.

LibreHardwareMonitor reports it as 16 Cores under CPU but 8 Cores in the SMBIOS Part, so clearly something is being processed wrong.

While taking a deep dive into your Code I've found something that would Explain this behavior:

public GenericCpu(int processorIndex, CpuId[][] cpuId, ISettings settings) : base(cpuId[0][0].Name, CreateIdentifier(cpuId[0][0].Vendor, processorIndex), settings)
    {
...
        _coreCount = cpuId.Length;
        _threadCount = cpuId.Sum(x => x.Length);

So due to the fact that the CpuId Array contains one element per thread and it's length is used for both fields, you will always get a wrong count for the core count for processors with SMT/ HyperThreading.

To solve this issue you could divide the thread count by two. This will be more reliable than using the SMBIOS Data, because the user could've disabled some cores, which may not be reflected within the SMBIOS Data.

ElectroAttacks avatar Jan 03 '24 15:01 ElectroAttacks