Currently there is no way to change the primary GPU in GNOME/Wayland. I tried multiple solutions, only to come around some environment variables.
Why there should be a way to change the primary GPU? Because multi-monitor performance. Attaching an external monitor to the HDMI/DP output in many laptops results in choppy/laggy/unresponsive monitor output.
Because the dGPU must read the framebuffer in RAM from the CPU and push it to the HDMI/DP output, the only way to avoid this is to set the dGPU as primary (NVIDIA or AMD).
While I did successfully on a Laptop with an NVIDIA card, there should be a switch somewhere to, at least, manually set these environment variables and reboot. At least, a ujust toggle-primary-gpu
showing the current primary GPU, a list of of available GPUs to switch, and a reboot prompt.
> ujust toggle-primary-gpu
Current primary GPU: NVIDIA GeForce GTX 750/PCIe/SSE
Which GPU you want to switch it for?
> Hybrid Graphics (PRIME driver, default)
Intel Graphics 4000 HD
AMD Radeon RX 7600XT/USB4/SSE
Switching to Hybrid Graphics...
Reboot to apply changes?
> Yes
Later...
Theoretically, if GNOME/Wayland supports it, it should be a way to change default/primary GPU used for display and applications, but I don’t know if it’s possible if the PRIME renderer allows to hot-swap graphic chips. If it does, it would be far better to hear AC/Battery events and have the option to switch to a dGPU if on AC and a external monitor if the user enables this behavior.