Score:1

CPU package power consumption is connected to nVidia GPU P-states which caused CPU to throttle during load

au flag

CPU: 7700HQ GPU: GTX 1050

I used Prime95 to stress the CPU (using AVX2). It stabilized at 3.0GHz@45W after few minutes. It was expected result so nothing new here.

After that I installed nVidia driver (470.x). In nVidia control panel I selected to use performance mode (only nVidia gpu). I thought that this will free the cpu even more and the clock speed should be at least equal or even higher than initially measured. I run the stress test again and for my great surprise the CPU stabilized at 2.7GHz@45W after few minutes.

I confirmed the results by running several tests. That's why I decided to switch back to integrated GPU. After the restart everything was as before. Then I tried balanced mode (nVidia gpu only on demand). In this case the results were identical to performance mode.

I run several more tests by switching GPUs/X11<->Wayland, but the results were always the same. With integrated GPU the CPU was running at 3.0GHz/~87 degrees@45W. With nVidia - 2.7GHz/~82 degrees@45W.

Does anyone have а suggestion or am I missing some kernel setting?

Thanks :)

Update:

The case turns out to be even more interesting. All said above is true, expect one thing - the OS. After a lot of tests I concluded that the situation is the same both on Windows and Linux.

Let's focus on idle package power consumption (IPPC) of the CPU.

  1. Using "Power Saver" mode in Prime results in using only iGPU and completely turns nVidia off. In this case the IPPC is <2.5W.
  2. Using "nVidia on demand" mode in Prime results in using iGPU unless explicitly selected nVidia. In this case both GPUs are always active. No matter how many processes are actually using the nVidia - it is always active! In this case IPPC is ~5-12W.
  3. Using "performance" mode in Prime results in using ONLY nVidia gpu. It is always active. In this case IPPC is ~5-12W.

Later on I tried to find why the IPPC is in so broad range - from 5 to 12W and how it is connected to the GPU. Luckily I found it. The answer was in power states of the GPU (P-states). When the GPU is using P0 (max performance) then the IPPC is 5W. In any other case the IPPC is more (up to 12W). It sounds quite counterintuitive but.. it turns out to be true. The faster the GPU runs the less affect it has on the CPU thus the CPU package power consumption is reduced and vise-versa - the slower the GPU runs, the more power CPU drains.

Now let's go to Windows. It has only one GPU mode - "on demand". The difference with Linux is that on Windows when no app is using the nVidia GPU then it is turned off thus resulting in IPPC <2.5W. If any app starts using the nVidia GPU then the IPPC go up to 12W. So on Windows the logic is the same as Linux - the faster the GPU runs, the lower CPU's package power is.

Note: I checked power consumption on Windows on idle. Power of the Core/IA/GX were almost 0, while package is 5-12W when nVidia enabled.

According to all findings the issue is not related to the OS/GPU. Somehow turning dGPU on (no matter of the usage) causes high CPU package power consumption (thus leaving to lower frequencies when CPU is loaded). What could be the reason? Is there something wrong with nVidia drivers for both Windows/Linux? Is there some specific CPU component that is activated when dGPU is running?

Doug Smythies avatar
gn flag
what is "AVX2"? Suggest Options/Torture Test (15) - Small FFTs (2). Also suggest running turbostat at the same time. Suggest this: `sudo turbostat --Summary --quiet --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt,GFXWatt --interval 6`. Does ilde power consumption change?
au flag
Thank you very much. I have a little more details at the moment. Using internal GPU: PkgWatt: 45W, CorWatt: 42.5W. Using nVidia: PkgWatt: 45W, CorWatt: 32W. So something is consuming a lot of power while nVidia is enabled.
au flag
Idle PkgWatt is also different. Integrated GPU: ~2.5W, nVidia: ~5 to 12W. CorWatt is the same: 0.5W.
Doug Smythies avatar
gn flag
Very interesting. My computer (server) for reference: Idle" PkgWatt: 1.4; CorWatt: 0.7. Load: PkgWatt: 134.2; CorWatt: 133.6
au flag
I check the output of Intel SoCWatch and powertop. I didn't find any interesting. In idle the Pkg power consumption is ranging from 5 to 12W when nVidia is enabled.
Score:0
cw flag

you will need bios mod with tdp unlock.

example https://www.bios-mods.com/forum/Thread-Request-ASUS-GL502VMZ-Unlocked-Bios

same thing for newer cpus https://linustechtips.com/topic/1070432-for-asus-fx504gm-25w-power-limit-throttling-users-only/

depending on laptop manufacturer it might have hidden bios tab, but you dont really need it - bios tdp unlock will do https://www.reddit.com/r/MSILaptops/comments/g4z52k/overclocking_i77700hq_is_possible/

upd added some workarounds to decrease power usage or increase cpu performance

dynamic power management on 7th gen intel and pascal is still not supported(in 470) https://forums.developer.nvidia.com/t/pascal-d3-power-management/181570/4

some laptops are borked even on newer chips https://forums.developer.nvidia.com/t/xorg-still-in-gpu-with-prime-offload-and-dynamic-power-management/170485/10

same for windows http://forum.notebookreview.com/threads/the-throttlestop-guide.531329/page-965#post-10853895

fyi you're probably want to have prime render offload for wayland games than not due to higher fps, so you're stuck with either running in hybrid or disabling nvidia gpu (and not having offload) when it is not needed - since you have no powermanagement when dgpu is enabled. you can use optimus-manager for that.

you can unlock your bios so the cpu could use more power to offset that fps decrease caused by unnecessary uncore power draw.

you could undervolt your cpu a little bit with linux intel-undervolt-gui and monitor it with throttled https://github.com/lukechadwick/linux-intel-undervolt-gui

for longer battery time (with dpu disabled) you could use tlp gui instead of ubuntu's 21 built in power control, use only one power control utility at a time TLP package with Power Mode Settings in Ubuntu 21.04?

au flag
Why do I need bios mod? I do not want to overclock anything.
userL avatar
cw flag
because cpu power limits are set by manufacturer inside bios. Some laptops are made with worse cpu vrm cooling or with lower power ac adapter that cant sustain max simultaneous load from cpu and gpu. You can check that with throttlestop - run any cpu test and check power usage, then run any 3d program that uses gpu, cpu power usage will drop instantly and throttlestop would display "power" as limiting reason.
au flag
This is not the case. I do not have problem with MAX TDP, I have problem with Idle TDP.
userL avatar
cw flag
on pascal if you're running nvidia prime (for hybrid graphics) or prime offload (for wayland) then dgpu wont disconnect and will draw power. cpu uncore power usage will be higher when dgpu is active and not going to sleep. pascal wont go to sleep due to non standard powermanagement. it works on windows but for some models it's broken too. https://download.nvidia.com/XFree86/Linux-x86_64/440.59/README/dynamicpowermanagement.html - > This feature requires a Turing or newer GPU. https://www.reddit.com/r/linux_gaming/comments/dy0zcb/do_the_nvidia_drivers_with_prime_offload_have_d3/f7xxuok/
au flag
If it can work on Windows, isn't it possible to work the same way on Linux. Also, do you know why cpu uncore power usage is higher when dgpu is running at low frequency compared to the cpu uncore power usage when gdpu is running at higher frequency?
userL avatar
cw flag
it is possible but optimus manager needs to know which acpi values to access. if platform(uefi) doesnt expose them then special driver commands are used and 470 still doesnt implement them, ask nvidia. https://www.reddit.com/r/linux_gaming/comments/dy0zcb/do_the_nvidia_drivers_with_prime_offload_have_d3/f802pwu about uncore - i dont know
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.