Ubuntu 21.04 CPU throttle because of enabled (not used) nVidia gpu

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.

After few more research I found that on idle the package cpu power consumption was as follows:
Using iGPU (power saver mode in prime selector): ~2.5W
nVidia (performance/balances mode in prime selector): 5-12W

During prime95 stress the package cpu power consumption was as follows:
Using iGPU (power saver mode in prime selector): 45W (~42.5W for Core itself)
nVidia (performance/balances mode in prime selector): 45W (~33W for core itself)

So somehow enabling the nVidia GPU from Prime causes CPU to use ~10W more power. This is only while using Linux. On Windows - everything is fine.

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

I’m willing to test/debug anything. I would like really to resolve this issue.

Thanks :)

I can no longer edit my post, so here is an 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?

Seems I have the same issue: Ubuntu 20.04 + Dell XPS 15 9560 Nvidia GTX 1050 v470 No clues yet what’s causing it though…)