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

[BUG] Reported processor speeds are incorrect on some machines. #815

Closed
AcatXIo opened this issue Apr 27, 2024 · 12 comments
Closed

[BUG] Reported processor speeds are incorrect on some machines. #815

AcatXIo opened this issue Apr 27, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@AcatXIo
Copy link

AcatXIo commented Apr 27, 2024

General description of the bug:

  • What happened:
    I noticed that Fastfetch shows either the turbo or the regular processor speed depending on which machine I run it on; in one case, the reported speed was totally incorrect.
    Tested machines (first 3 run Windows 11, and number 4 runs Windows 10):
    1. Toshiba Satellite P755 with Intel Core i7-2670QM:
      • shown speed: 3.8 GHz (♦️totally incorrect)
      • processor turbo speed: 3.1 GHz
      • processor regular speed: 2.2 GHz
    2. Dell Latitude 5490 with Intel Core i5-7300U:
      • shown speed: 3.5 GHz (🔷correct turbo)
      • processor turbo speed: 3.5 GHz
      • processor regular speed: 2.6 GHz
    3. HP OMEN 15-ce0xx with Intel Core i7-7700HQ:
      • shown speed: 2.81 GHz (🔶correct regular)
      • processor turbo speed: 3.8 GHz
      • processor regular speed: 2.8 GHz
    4. HP ProBook 6460b with Intel Core i5-2410M:
      • shown speed: 2.3 GHz (🔶correct regular)
      • processor turbo speed: 2.9 GHz
      • processor regular speed: 2.3 GHz
  • What should happen:
    Fastfetch should tell the user which processor speed it is showing: the regular one or the turbo, and the speed should be correct.
  • Fastfetch version used: 2.10.2 (x86_64).
  • Did it work in an older version: No.
  • Where did you get the binary: From Scoop package manager for Windows.
  • Does this issue still occur in the latest dev build: Yes.

Often helpful information:

Screenshots:

image
image
image
image

The content of the configuration file you use (if any): Not used.

Outputs of fastfetch -c ci.jsonc --format json (I only included the processors; feel free to ask for the rest if needed.):

{
  "type": "CPU",
  "result": {
    "cpu": "Intel(R) Core(TM) i7-2670QM",
    "vendor": "GenuineIntel",
    "cores": {
      "physical": 4,
      "logical": 8,
      "online": 8
    },
    "frequency": {
      "base": 2.195,
      "max": 3.8,
      "min": null
    },
    "temperature": null
  },
  "stat": 0
},
{
  "type": "CPUUsage",
  "result": [
    0.0,
    0.0,
    0.0,
    75.0,
    0.0,
    0.0,
    7.6923076923076925,
    0.0
  ],
  "stat": 207
}
{
  "type": "CPU",
  "result": {
    "cpu": "Intel(R) Core(TM) i5-7300U",
    "vendor": "GenuineIntel",
    "cores": {
      "physical": 2,
      "logical": 4,
      "online": 4
    },
    "frequency": {
      "base": 2.712,
      "max": 3.5,
      "min": null
    },
    "temperature": null
  },
  "stat": 0
},
{
  "type": "CPUUsage",
  "result": [
    0.0,
    7.142857142857142,
    42.857142857142854,
    0.0
  ],
  "stat": 213
}
{
  "type": "CPU",
  "result": {
    "cpu": "Intel(R) Core(TM) i7-7700HQ",
    "vendor": "GenuineIntel",
    "cores": {
      "physical": 4,
      "logical": 8,
      "online": 8
    },
    "frequency": {
      "base": 2.808,
      "max": null,
      "min": null
    },
    "temperature": null
  },
  "stat": 1
},
{
  "type": "CPUUsage",
  "result": [
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0,
    0.0
  ],
  "stat": 206
}
{
  "type": "CPU",
  "result": {
    "cpu": "Intel(R) Core(TM) i5-2410M",
    "vendor": "GenuineIntel",
    "cores": {
      "physical": 2,
      "logical": 4,
      "online": 4
    },
    "frequency": {
      "base": 2.295,
      "max": 2.3,
      "min": null
    },
    "temperature": null
  },
  "stat": 0
},
{
  "type": "CPUUsage",
  "result": [
    21.428571428571427,
    14.285714285714285,
    14.285714285714285,
    50.0
  ],
  "stat": 205
}

Output of fastfetch --list-features (for all machines):

threads
vulkan
zlib
opencl
Proprietary GPU driver API
@AcatXIo AcatXIo added the bug Something isn't working label Apr 27, 2024
@CarterLi
Copy link
Member

CarterLi commented Apr 27, 2024

SMBIOS sometimes reports incorrect max CPU freq, especially in some old platforms. Please try this: #800 (comment)

@AcatXIo
Copy link
Author

AcatXIo commented Apr 27, 2024

Here are the processor values (in the same order as above), I also added comments for the speeds:

Length: 0x2A
Socket Designation: CPU 1
Processor Type: Central Processor
Processor Family:
Processor ID:
Processor Manufacturer: Intel
Processor Version: Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
External Clock: 400MHz, 0MHz is unknown clock
Max Speed: 3800MHz <- wrong, should be 3100 MHz
Current Speed: 2200MHz <- correct
Status: 0x41
Length: 0x30
Socket Designation: U3E1
Processor Type: Central Processor
Processor Family:
Processor ID:
Processor Manufacturer: Intel(R) Corporation
Processor Version: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz
External Clock: 100MHz, 0MHz is unknown clock
Max Speed: 3500MHz <- correct
Current Speed: 2300MHz <- wrong, should be 2600 MHz
Status: 0x41
Length: 0x30
Socket Designation: U3E1
Processor Type: Central Processor
Processor Family:
Processor ID:
Processor Manufacturer: Intel(R) Corporation
Processor Version: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
External Clock: 100MHz, 0MHz is unknown clock
Max Speed: 8300MHz <- very wrong, should be 3800 MHz
Current Speed: 2700MHz <- slightly wrong, should be 2800 MHz
Status: 0x41
Length: 0x2A
Socket Designation: CPU 1
Processor Type: Central Processor
Processor Family:
Processor ID:
Processor Manufacturer: Intel(R) Corporation
Processor Version: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
External Clock: 100MHz, 0MHz is unknown clock
Max Speed: 2300MHz <- wrong, should be 2900 MHz
Current Speed: 2300MHz <- correct
Status: 0x41

CarterLi added a commit that referenced this issue Apr 27, 2024
Note this only works when Hyper-V is not enabled

Ultimately fixes #800 #812 #815
@CarterLi
Copy link
Member

CarterLi commented Apr 27, 2024

Can you try this ( assume Hyper-V / WSL2 is not enabled in your laptop ): https://github.com/fastfetch-cli/fastfetch/actions/runs/8860739281/artifacts/1453433558

Oops. Try this please: https://github.com/fastfetch-cli/fastfetch/actions/runs/8860844348/artifacts/1453449229

@Null-Ping @lostdusty Can you also test it?

@AcatXIo
Copy link
Author

AcatXIo commented Apr 27, 2024

With new one (first is the CPU line from fastfetch.exe, second is frequency part from fastfetch.exe -c ci.jsonc --format json):

CPU: Intel(R) Core(TM) i7-2670QM (8) @ 3,80 GHz
"frequency": {
	"base": 2.195, <- correct
	"max": 3.8, <- wrong, should be 3.1
	"min": null
}
CPU: Intel(R) Core(TM) i5-7300U (4) @ 3,50 GHz
"frequency": {
	"base": 2.7, <- correct
	"max": 3.5, <- correct
	"min": null
}
CPU: Intel(R) Core(TM) i7-7700HQ (8) @ 2.81 GHz
"frequency": {
	"base": 2.808, <- correct
	"max": null, <- should be 3.8
	"min": null
}
CPU: Intel(R) Core(TM) i5-2410M (4) @ 2,30 GHz
"frequency": {
	"base": 2.295, <- correct
	"max": 2.3, <- wrong, should be 2.9
	"min": null
}

Apparently the only change is 2.712 being rounded to 2.7 for i5-7300U?
I double-checked to use the new version, but I'm not 100% sure if I'm doing everything correctly.
Does Fastfetch have some caching or something?

@CarterLi
Copy link
Member

You didnt have WSL2 / virtual machine platform enabled right?

@CarterLi
Copy link
Member

CarterLi commented Apr 27, 2024

According to https://stackoverflow.com/a/39620056, the method is only supported in Skylake (6th gen) and later. Its expected no change for old cpus

What strange is 7700HQ

@AcatXIo
Copy link
Author

AcatXIo commented Apr 27, 2024

You didnt have WSL2 / virtual machine platform enabled right?

The laptop with i7-7700HQ is not a VM (nor are the others), but I had virtualization enabled in its BIOS; after I disabled it, Fastfetch now shows:

CPU: Intel(R) Core(TM) i7-7700HQ (8) @ 3.8 GHz
"frequency": {
	"base": 2.8, <- correct
	"max": 3.8, <- correct
	"min": null
}

So it now works correctly, but why does it depend on disabling virtualization in BIOS?
I had it on because I sometimes use Android emulators.
Is it possible to make the speed be detected correctly regardless of this setting?

@ghost
Copy link

ghost commented Apr 27, 2024

@Null-Ping Can you also test it?

Sure!
The results are as follows:

CPU: 11th Gen Intel(R) Core(TM) i3-1125G4 (8) @ 3,7 GHz
"frequency": {
  "base": 1.2,
  "max": 3.7,
  "min": null
}

Everything is correct, but I also had to disable virtualization like AcatXIo did, apparently my laptop had it on by default.
Before I turned it off the results were:

"frequency": {
  "base": 1.19,
  "max": null,
  "min": null
}

@lostdusty
Copy link

lostdusty commented Apr 27, 2024

@lostdusty Can you also test it?

Nope, sorry (I'll be away from my pc/home for about ~2 weeks, or maybe even more). But I have both virtualization and VT-x enabled. Also my processor is from the 7th gen, just like the i7-7700HQ.

I guess virtualization features makes the smbios report the wrong frequency, even if it shows the right one in bios.

@AcatXIo
Copy link
Author

AcatXIo commented Apr 27, 2024

I guess virtualization features makes the smbios report the wrong frequency, even if it shows the right one in bios.

I tested, and the SMBIOS for i7-7700HQ with virtualization off is still the same:

Max Speed: 8300MHz <- should be 3800 MHz
Current Speed: 2700MHz <- should be 2800 MHz

So the virtualization setting likely doesn't affect the SMBIOS data.

@CarterLi
Copy link
Member

CarterLi commented Apr 28, 2024

You don't need to disable VT-x / AMD-v in BIOS, and it's recommanded to enable it to get better VM performance.

You need to disable Virtual Machine Platform in Windows Features ( note WSL2 and WSA use that )

img

This feature has negative impact on performance. Microsoft suggests disabling it.

https://support.microsoft.com/en-us/windows/options-to-optimize-gaming-performance-in-windows-11-a255f612-2949-4373-a566-ff6f3f474613#ID0EDD

@CarterLi
Copy link
Member

I think this is the best result that fastfetch can get as for now. SMBIOS still seems ok for people uses WSL2 on newer CPUs ( like me ) so I want to keep it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants