bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
https://bayas.dev/envycontrol
MIT License
1.14k stars 55 forks source link

[REQUEST] Workarounds for powering off GPU in hybrid mode #126

Closed ZZYSonny closed 10 months ago

ZZYSonny commented 10 months ago

Is your feature request related to a problem? Please describe. Yes, the feature request is related to a problem. When using hybrid mode, the nvidia gpu keeps taking power. The command nvidia-smi finishes immediately and there is a Xorg / gnome-shell process using GPU memory.

My laptop is Zephyrus G14 2020 with R7-4800HS and RTX 2060. The computer is running GNOME with wayland.

Describe the solution you'd like Recently I followed https://github.com/SnipeXandrej/zephyrus-g15-tweaks and it seems to fix the problem. nvidia-smi takes time to activate the GPU and there is no process running on the GPU.

So maybe it is worthwhile to integrate a few workarounds from the repo?

bayasdev commented 10 months ago

Hello,

I understand your concern regarding disabling the Nvidia dGPU. It's important to note that some of these tweaks may have unintended consequences for other users (eg: using modesetting 0 or deleting an EGL library).

One potential solution could be to make this feature opt-in through a CLI option. However, at the moment, there are no immediate plans to introduce additional features.

Feel free to submit a PR in the meantime ;)

Boria138 commented 10 months ago

@ZZYSonny Try adding ibt=off to grub if it's not there, on the Nvidia github some people wrote that it helps them.

Boria138 commented 10 months ago

I also found that enabling nvidia-persistenced.service also seems to fix rtd3.

Boria138 commented 10 months ago

@bayasdev I ran tests with a gtx 1650 video card with the service enabled consuming 16 watts at idle with it turned off 32 watts (Did some tests and came out with a total of 11 to 16 watts)

Boria138 commented 10 months ago

Must be fixed in https://github.com/bayasdev/envycontrol/pull/127/commits/f7941af475b6d97bf19cc09f81d78018a41d7669

Boria138 commented 10 months ago

@bayasdev This can be closed as the bug has been fixed.