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

Nvidia GPU consuming more power in integrated mode than hybrid mode #347

Open
Rash419 opened this issue Nov 30, 2020 · 7 comments
Open

Nvidia GPU consuming more power in integrated mode than hybrid mode #347

Rash419 opened this issue Nov 30, 2020 · 7 comments

Comments

@Rash419
Copy link

Rash419 commented Nov 30, 2020

  1. Integrated Mode

Screenshot from 2020-11-30 13-27-55

  1. Hybrid Mode

Screenshot from 2020-11-30 13-26-51

In Integrated mode ,it is consuming 12W and in hybrid it is consuming 2W why is it so? Integrated should consume no power or minimal power. If it is false can someone explain why?

@Askannz
Copy link
Owner

Askannz commented Dec 6, 2020

Without knowing your optimus-manager.conf I can't tell if there's something wrong with your setup. But here's some possible explanation to this behavior:

Power management with Optimus on Linux is kind of complicated. When in "integrated" mode, the GPU can be in one of a few states, depending on your configuration:

  • There's no power management at all (this is the configuration optimus-manager comes with by default; see the power management guide). The nvidia driver is not loaded, but the GPU is still turned on and sips power even if it's not rendering anything/driving any display.

  • The GPU is turned on but power-managed at the PCI level (this corresponds to pci_power_control=yes in the config file). I don't really know how much this reduces power consumption (it it reduces it at all) since there isn't a ton of documentation about it. One thing to note is that invoking nvidia-smi in that state automatically loads the nvidia driver and can push the card to a high power state, so it's not a reliable way to measure power consumption.

  • The GPU is totally powered off. This state can be triggered with the kernel modules bbswitch or acpi_call on some laptop models (but not all). optimus-manager can use those modules but you have to enable them manually (see the power management guide). I can tell your laptop is not in that state because nvidia-smi works (if power to the GPU was off then would return "no such device" or something to that effect).

On the other hand, when in "hybrid" mode, the GPU is always powered on and the nvidia driver is always loaded. However, the nvidia driver is smart and does some power management of its own: it will downclock the card when not in use to reduce power consumption. This isn't as good as totally powering down the GPU with bbsiwtch/acpi_call, but still better than having it idle at full power. That's why you're seeing only 2 watts in hybrid mode, and also why the power management guide recommends using hybrid mode if all other power management solutions fail.

If your laptop is recent enough (Turing GPU or above and Coffee Lake CPU or above), you can even go one step further and have the nvidia driver completely shut down the GPU when in hybrid mode. This is the best of all worlds: the power consumption is effectively zero but the nvidia driver is still loaded and you can even use external displays. If you are able to enable that feature, you can just always use "hybrid" mode and completely ignore "integrated" mode. However it's kinda experimental and requires a bit of manual setup (see the guide).

@Rash419
Copy link
Author

Rash419 commented Dec 7, 2020

I have default configuration of optimus-manager. I have amd ryzen 3550h + gtx 1650(Turing)

@WhyDoWeWonder
Copy link

WhyDoWeWonder commented Dec 30, 2020

I'm not 100% sure but I believe some of the newer Ryzen chips support the necessary ACPI calls to use the NVIDIA drivers built-in power management. Try following the setup here and seeing if it works for you. You should see a significant reduction in power consumption on small workloads and when the GPU is idle.

@phush0
Copy link

phush0 commented Jan 11, 2021

Nvidia driver power management and D3 PCI will not work with Ryzen chips, only Intel 10-th gen up

@ferretwithaberet
Copy link

ferretwithaberet commented May 27, 2021

Nvidia driver power management and D3 PCI will not work with Ryzen chips, only Intel 10-th gen up

ferretwithaberet@ferret-FX505DT in ~
$ optimus-manager --status
Optimus Manager (Client) version 1.4

Current GPU mode : hybrid
GPU mode requested for next login : no change
GPU at startup : integrated
Temporary config path: no
ferretwithaberet@ferret-FX505DT in ~
$ nvidia-smi
Thu May 27 20:03:24 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 465.31       Driver Version: 465.31       CUDA Version: 11.3     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   45C    P0    12W /  N/A |    817MiB /  3911MiB |     25%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      6262      G   /usr/lib/Xorg                      44MiB |
|    0   N/A  N/A     11644    C+G   ... of Salem\TownOfSalem.exe      767MiB |
+-----------------------------------------------------------------------------+
ferretwithaberet@ferret-FX505DT in ~
$ cat /etc/optimus-manager/optimus-manager.conf
[amd]
DRI=3
driver=modesetting
tearfree=

[intel]
DRI=3
accel=
driver=modesetting
modeset=yes
tearfree=

[nvidia]
DPI=96
PAT=yes
allow_external_gpus=no
dynamic_power_management=fine
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
startup_auto_battery_mode=integrated
startup_auto_extpower_mode=nvidia
startup_mode=integrated
switching=none
ferretwithaberet@ferret-FX505DT in ~
$ cat /proc/driver/nvidia/gpus/0000\:01\:00.0/power 
Runtime D3 status:          Disabled by default
Video Memory:               Active

GPU Hardware Support:
 Video Memory Self Refresh: Supported
 Video Memory Off:          Supported

Power Limits:
 Default:                   N/A milliwatts
 GPU Boost:                 N/A milliwatts

Correct me if I am wrong, but the above means it works in hybrid mode with dynamic power management inside the Nvidia driver, right?
I got Ryzen 5 3550H and NVIDIA GeForce GTX 1650 Mobile / Max-Q (Asus TUF FX505DT).

Edit: Reworded.

@robthide37
Copy link

This was still an issue on 12th gen intel and 3070ti also with 3080 and 5900x. It def is an issue that when disabling the nvidia GPU it doesn't tell it to sleep instead it is just waiting for command and not doing an sleep states . It isn't as bad as shown their but still a difference of a few watts

@robthide37
Copy link

i think its why intel battery life on non evo is so bad , I know this is old but amazingly not much on this but I verified with many laptops .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants