I found a working solution!
Add to kernel boot parameters in Grub (Grub2) this parameter: nvidia-drm.modeset=0
Yes, I’m setting there 0, not 1 as most online posts advised. 0 did the trick.
Now it looks like NVidia is finally switched off and Wayland is running on AMD. Reportedly the battery now would last 6-9 hours instead of 2 - 3 reported before.
Nvidia is reported as switched off:
espinosa@espinosa-asus:~> cat /sys/class/drm/card*/device/power_state
D3cold
D0
And I can still use Nvidia for for specific tasks, for offloading, with switcheroo:
switcherooctl launch -g 0 glxgears
…
espinosa@espinosa-asus:~> cat /sys/class/drm/card*/device/power_state
D0
D0
When I stop the glxgears
, after few seconds, Nvidia is switched off again:
espinosa@espinosa-asus:~> cat /sys/class/drm/card*/device/power_state
D3cold
D0
FYI, this is my current full boot kernel parameter printout:
espinosa@espinosa-asus:~> cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.13.2-1-default root=UUID=60138d9f-ea26-4f20-95f6-98767950ee42 splash=silent quiet security=apparmor modprobe.blacklist=nouveau rd.driver.blacklist=nouveau nvidia-drm.modeset=0 mitigations=auto
You may have noticed, I also added modprobe.blacklist=nouveau rd.driver.blacklist=nouveau
to the kernel boot parameters.
It doesn’t seem to have any effect but it cannot hurt either.
How did nvidia-drm.modeset=0
make Wayland running on AMD? Here is my layman explanation:
- Modesetting (aka KMS, kernel mode setting) is these days by default on for all cards in the system
- By switching modesetting (KMS) to off for one GPU, the other one will be the one doing the modesetting and that one ends with display output set to it (to be the Display/VGA Controller?)
- Do not set the general nomodeset, it would degrade the system. For example Wayland won’t be able to run, X11 probably still yes.
Here is some reading what the Nvidia modesetting does when it is activated:
Quoting:
Setting nvidia-drm.modeset=1 … All it really does is enable the DRIVER_MODESET capability flag in the nvidia-drm devices so that DRM clients can use the various modesetting APIs. In addition to allowing clients that talk to the low-level DRM interface to work, it’s also necessary for some PRIME-related interoperability features.
… loading nvidia-drm with modeset=1 causes it to configure and initialize all GPUs immediately rather than waiting for a client to open the /dev/nvidia device files. …*
That’s exactly the opposite of what I want. So I thought, switching it off may help. And it did.
Oddly, all online posts I found related to this topic recommended to set there 1.
Oddly, the fans are still on. I’ll open another issue for that.