It is currently July 13th, 2024, 3:52 pm

Illustro | CPU usage incorrect (getting worse!?)

Get help with creating, editing & fixing problems with skins
User avatar
SilverAzide
Rainmeter Sage
Posts: 2683
Joined: March 23rd, 2015, 5:26 pm

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by SilverAzide »

martin-london wrote: May 29th, 2023, 12:32 am I appreciate that I have probably mis-understood something about the change, or what is going on "under the hood" -- and that's fine, am happy to be corrected and learn more about what has changed/broken, why, and the way(s) to fix it. But please can someone explain this to me?
I'm not sure I know all the details of what Microsoft did to "break" their CPU usage reporting (obviously, they have a different opinion). If you search around, some devs on the MSI Afterburner forums figured out a certain low-level Windows API changed in Win11 22H2, and they were able to work around the issue to revert things back somewhat. I think the very latest versions of HWiNFO have adopted a similar approach, and it now reports CPU Usage two different ways (time-based and utility-based). None of these fixes solves the problem of "CPU usage by process", so "Top Process"-type skins are still going to read low.

Most apps (Rainmeter included) use Windows built-in Performance Counters to report this data (Performance Monitor is built on top of this). As I mentioned before/elsewhere, Windows changed how Task Manager works way back in Windows 8 days. Windows 8 created a new class of performance counters that didn't work by time-slicing, it worked by "utility" (which seems to factor in core clock speed, and thus can exceed 100% usage when cores are running at speeds higher than their base clock), and Task Manager switched to use these instead of time-based counters. No one really noticed the difference much until CPUs started really aggressively varying their core clocks.

For some reason, Win11 22H2 made a really noticeable change to the time-based performance counters, which clearly got everyone's attention since the numbers now vary significantly from the utility-based counters. MSI Afterburner and HWiNFO seems to have worked around this issue by creating their own time-based counters. Whether you think time-based or utility-based counters are the "correct" way to report CPU usage seems to be a matter of opinion nowadays. Microsoft clearly thinks utility-based counters are the way to go.

Personally, I tend to agree with MS for one simple reason that most people overlook. People who are interested in monitoring clock speed and CPU usage tend to be interested in overlocking and max performance. But the problem is when CPUs start underclocking (like laptops in power-saving mode, for example). When this happens, the time-based counters are hilariously and clearly wrong. For example, I had a laptop that would clock itself down to <1 GHz speeds when on low battery. Using the time-based counters, it would easily show the CPU running at 100% "usage", which was true because the CPU was 100% busy crawling along at like 800 Mhz. Plug it in and -- tadaa! -- the CPU usage was magically now at 25% "usage" (or much less) even though the same apps were still running, but now at 3+ GHz. With the utility-based counters, CPU usage would be reported at 25% all the time -- plugged in or not -- since it factors in the CPU's clock speed.

I suspect that Intel's hybrid CPUs make this issue even more complex, since the E-cores run at a lower clock speed than the P-cores. Perhaps this was why they changed their API.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7719
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by Yincognito »

SilverAzide wrote: May 29th, 2023, 4:39 pmWhen this happens, the time-based counters are hilariously and clearly wrong. For example, I had a laptop that would clock itself down to <1 GHz speeds when on low battery. Using the time-based counters, it would easily show the CPU running at 100% "usage", which was true because the CPU was 100% busy crawling along at like 800 Mhz.
I guess the effect on the user depends on whether he also sees the clock speed. If he only sees the usage, he'd expect the same usage for the same workload, but if he sees both the usage and the speed, then suddenly the usage doesn't seem so far fetched. I tend to prefer the latter, I have no idea if this makes me a time based or an utility based fan (pun intended). :sly:

In any case, I don't like these half done things, like one way for overall usage, and another way for process based usage in Win 11. It reminds me of the settings being divided between Control Panel and the Settings in the Start menu for years now, with MS still unable to put them all in one place. I'm pretty sure this is more useful to the user since I have zero trust in the "new, superficial" way of dealing with things lately, but it's a total mess from a structural point of view (user be like: where was the setting I needed to change again?!)... :?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2683
Joined: March 23rd, 2015, 5:26 pm

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by SilverAzide »

Yincognito wrote: May 30th, 2023, 10:31 am I guess the effect on the user depends on whether he also sees the clock speed. If he only sees the usage, he'd expect the same usage for the same workload, but if he sees both the usage and the speed, then suddenly the usage doesn't seem so far fetched. I tend to prefer the latter, I have no idea if this makes me a time based or an utility based fan (pun intended). :sly:
Sounds like you're a utility-based fan... :)

Where things really get confusing is situations like the one happening with my machine right now. Looks like MS Defender is going nuts and maxing out (and overclocking) all the E-cores on my CPU, while the P-cores are just coasting, half of them asleep. Is the CPU at 66% usage like it says? Or is it more like ~30% (e.g., if you sum all the time-based processes)? :confused: MS has decided the right answer is 66%.

Screenshot 2023-05-30 074843.png
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7719
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by Yincognito »

SilverAzide wrote: May 30th, 2023, 11:59 am Sounds like you're a utility-based fan... :)

Where things really get confusing is situations like the one happening with my machine right now. Looks like MS Defender is going nuts and maxing out (and overclocking) all the E-cores on my CPU, while the P-cores are just coasting, half of them asleep. Is the CPU at 66% usage like it says? :confused: ...Windows says so, so I guess I'll go with it.


Screenshot 2023-05-30 074843.png
Ouch! I didn't see an AV use that much and not take ruthless action ever since my Norton AV days! I swore those days I won't let such hogs torment my computer ever again and double checked to make sure that everything about it was gone after format. After that, ESET ruled unchallenged till a couple of years ago when I reluctantly switched to a tightly controlled Avast and Windows Firewall Control, with about the same - and much better - results.

But yeah, even if you take those maxed cores at just 100% each and the rest at a 10% on average, you still get 40%, so I guess the overall is right. It's way too much though, and at a high clock rate, IMHO. By the way, is it just me or all your top 5 CPU processes are MS ones? I hope it's you manually scanning here, and not the AV running in "background". Or at least some short occasional frenzy gone in one or two seconds. I'm curious what would Win 10 show in TM in this case...

When it comes to the core distribution of usage, it's a bit strange. For me, I can see individual cores almost maxing out in general usage, but they do it one at a time and by switching roles accordingly, so to speak. Only some games, video encoding, or benchmarks keep the same cores at a consistent high usage for longer periods. Even if my computer could take it, I still wouldn't like it. In such cases, especially when encoding for some time, I do indeed under clock my CPU or limit it from the Power settings - I just feel safer that way, and the temps seem to agree.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
martin-london
Posts: 6
Joined: May 18th, 2023, 10:22 am

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by martin-london »

SilverAzide wrote: May 29th, 2023, 4:39 pm Win11 22H2 made a really noticeable change to the time-based performance counters, which clearly got everyone's attention since the numbers now vary significantly from the utility-based counters. MSI Afterburner and HWiNFO seems to have worked around this issue by creating their own time-based counters. Whether you think time-based or utility-based counters are the "correct" way to report CPU usage seems to be a matter of opinion nowadays. Microsoft clearly thinks utility-based counters are the way to go.
Firstly, wanted to say thanks @SilverAzide for all the info in your post (I quoted above what I understood to be the 'core' of the issue but referring generally to everything you wrote overall.. [I genuinely appreciate it when people take the time and effort to provide longer / more detailed replies as I know first hand how much longer this takes (but also the benefit this has) and so wanted to say thanks for that!] 👍🏼
SilverAzide wrote: May 29th, 2023, 4:39 pm Time-based counters are hilariously and clearly wrong. For example, I had a laptop that would clock itself down to <1 GHz speeds when on low battery. Using the time-based counters, it would easily show the CPU running at 100% "usage", which was true because the CPU was 100% busy crawling along at like 800 Mhz. Plug it in and tada, the CPU usage was magically now at 25% "usage" [as it was now running] at 3+ GHz.
With utility-based counters, CPU usage would be reported at 25% all the time, plugged in or not, since it factors in the CPU's clock speed.

[NOTE: Some changes made to original text to fit context better, no intention to mis-quote or mis-represent!]
Thanks for this example, whether intentionally or coincidentally this helped me understand the wider problem/issue/challenge, or at least help me understand the rationale for the change better.

Interestingly, in the example above, I would actually prefer the time-based metric. To elaborate, to date, I have generally always considered CPU usage (what I think of as 'performance') as like the max speed of a car...
  • Say I am driving on a nice, flat, smooth piece of road; top gear, foot all the way down on the accelerator... Lets say the car goes 200mph, then I would consider this 100% "usage", because that is the most (maximum 'performance') the car can do.
  • If I am driving at 100mph (same conditions) then I would consider that 50% "usage" as the car is doing half of what it is capable of.
  • Now, if the above 200mph is based on the car's "base" max speed and has a "turbo" mode that let's it go 300mph on the same road, then actually the above changes and I would say going 200mph is only 66% "usage" as the car is capable of doing 33% more 'performance' (i.e. in this case speed).
  • Similarly, if instead of that road I am driving up a steep hill in rough terrain (i.e. trying to be analogous to the laptop being in low battery mode), if with everything maxed the car can only do 50mph up that road, and I am doing 50mph, then I would consider that 100% "usage" as yes, the car can do more in different conditions, but right now the car is not capable of going any faster and so 50mph is 100% of what it can do.
  • Yes, I can take that same car, put it on a runway and it will zoom along at 300mph again, but I can't zoom up a 45° hill at 300mph
  • So personally, I would be quite happy (and even prefer) my laptop saying 100% "usage" when it's on low-battery mode and the CPU is being throttled/down-clocked, as I would want to know that right now the CPU is working as hard as it can, and so say doing a video-encoding job would be a bad idea as the CPU is already maxed and so will be painfully slow... Also, plugging my laptop in and see that I now have 75% more "usage" 'available' would make total sense to me.
NOTE: I realise now (and again, thanks to @SilverAzide for helping me understand this better) that part of the 'issue' is that performance is more subjective that I had always thought and while time-based metrics make sense for me personally (at least AFAIK), I totally appreciate that people may/will disagree (arguably for valid reasons) and so ultimately I suppose it's probably about what makes most sense for you. So, not disagreeing with you at all @SilverAzide if you use / recommend utility-based metrics, simply trying to explain my perspective.

⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤

Now, just to muddy the water slightly 🙂 -- The initial reason I came to reply to this thread was to ask for help as I just got back from holiday, had updated my rainmeter skin to reflect all 12 threads that I have, however I was still having an issue (or at least what I thought was one), where my overall CPU "usage" was >100%...
  • Reflecting on the above (and other comments / things discussed) I am wondering if that is maybe more along the lines of 'correct' / (potentially) 'expected behaviour' - if it's supposed to be accounting for things like my CPU boosting above it's base clock?
  • Personally, I would prefer my "usage" to reflect the 'max performance' of the CPU, is this possible (easy), i.e. just switching back to using time-based counters?
  • How would this compare against say Task Manager, i.e. ...
    └ If I was using 'time-based' metrics before but this meant I was seeing different numbers to what Task Manager was reporting
    └ I switched to 'utility-based' metrics (AFAIK) to align with Task Manager (which generally fixed this issue)
    └ However, I've never seen Task Manager usage go >100% 🤔
  • Personal / FYI: NOT criticising, just sharing - I was stunned for a split-second when I saw some of your cores at 180% (coming from the mindset I explained above), but I guess you're happy with this and find this useful(?)... I appreciate you have P- and E- cores, and so maybe that makes it more relevant(?)
ONE LAST THING -- @SilverAzide Been meaning to say for ages, I really like your Gadgets skin - every time I see it I think about switching to use it instead, nice work! 👍🏼

⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤⏤
Yincognito wrote: May 30th, 2023, 10:31 am I guess the effect on the user depends on whether he also sees the clock speed...
TBH, this post is already FAR longer than I originally intended 🤦🏼‍♂️ but just to say thanks also to @Yincognito as appreciate your input + comments!... For the sake of my sanity I haven't replied directly to your post but tried to factor it in the overall above, thanks 👍🏼




TECH SPECS (FOR CONTEXT) -- I daily drive a 3y laptop (always plugged-in) with an i7-9750H (12 threads | 6 cores (older/std, not E/P)... base clock 2.6Ghz, boost 4.5Ghz. My CPU is essentially always 'boosted' AFAIK...

Image
User avatar
SilverAzide
Rainmeter Sage
Posts: 2683
Joined: March 23rd, 2015, 5:26 pm

Re: Illustro | CPU usage incorrect (getting worse!?)

Post by SilverAzide »

martin-london wrote: June 16th, 2023, 9:00 am
If you prefer time-based counters -- and a lot of people do, based on the flamewars on various forums -- you only really have one choice now.

Windows performance counters give you two options: utility-based counters (which you don't want) and time-based counters (which are broken).

The most recent version of HWiNFO is now your best option. Martin (the HWiNFO dev) just added in the most recent version a set of sensor outputs you can use. You can use the utility-based counters (which are the same as Windows, which he calls "Core Utility") or you can use HWiNFO's time-based counters (which he calls "Core Usage"). These act more like the old non-broken time-based counters.
Screenshot 2023-06-16 093513.png
martin-london wrote: June 16th, 2023, 9:00 am [*]How would this compare against say Task Manager, i.e. ...
└ If I was using 'time-based' metrics before but this meant I was seeing different numbers to what Task Manager was reporting
└ I switched to 'utility-based' metrics (AFAIK) to align with Task Manager (which generally fixed this issue)
└ However, I've never seen Task Manager usage go >100% 🤔
[*]Personal / FYI: NOT criticising, just sharing - I was stunned for a split-second when I saw some of your cores at 180% (coming from the mindset I explained above), but I guess you're happy with this and find this useful(?)... I appreciate you have P- and E- cores, and so maybe that makes it more relevant(?)
Task Manager doesn't go over 100% because the graphs are capped at 100. So it's misleading... Regarding the 180% usage (LOL), the base and max clocks are lower on these E-cores, but they are single-threaded, so I'm not sure what Windows is doing to come up with those numbers. :confused:
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...