How to make KWin run on the integrated GPU?

I have a Legion 5 laptop with an integrated AMD and discrete NVIDIA graphic card.

switcherooctl
Device: 0
Name:        NVIDIA Corporation GB206M [GeForce RTX™ 5060 Max-Q / Mobile]
Default:     yes
Discrete:    yes
Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=nvidia

Device: 1
Name:        Advanced Micro Devices, Inc. [AMD/ATI] HawkPoint1
Default:     no
Discrete:    no
Environment: DRI_PRIME=pci-0000_65_00_0 VK_LOADER_DRIVERS_SELECT=radeon

The battery life is pretty bad, even in power-save mode and only a browser/kate/dolphin running goes to 10% in under 2,5 hours.

If I don’t have anything open, the idle power draw is still 27-30W, and in nvtop, the RTX gpu still shows activity, while the AMD gpu never shows activity.

So I think the problem is that KWin and everything else always uses the dGPU.

Is there a way to have switcheroo-control launch things with the iGPU by default when on battery, and the dGPU when on AC power?

For the NVIDIA card, cat /proc/driver/nvidia/gpus/0000:01:00.0/power shows
Runtime D3 status: Enabled (fine-grained)
Video Memory: Active
GPU Hardware Support:
Video Memory Self Refresh: Supported
Video Memory Off: Supported
S0ix Power Management:
Platform Support: Supported
Status: Disabled
Notebook Dynamic Boost: Supported

Fedora 44, Plasma 6.6.4, kernel 6.19.14-200.fc43.x86_64 (64-bit)

Does anyone have the same GPU and managed to get better battery life?

There’s a “Laptop Mode” feature in the kernel, and on DebUntu there is/used to be a package called “laptop-mode-tools” which exploits this feature. It should allow you to do trigger actions when switching from AC to DC or back.

I doubt though that many applications which don’t have built in support for switching GPUs can do so on the fly. You’re probably better off to use the iGPU by default and reserve the dGPU for applications where it can make a real difference (hint: it’s quite possible that that does NOT include video playback).