NVIDIA “PrimaryGPU” Support Wayland

I have a HP Omen 15 laptop with a hybrid AMD + Nvidia GPU and I use Fedora KDE. I normally use the laptop in “dock” mode connected to an external 2K monitor, and for better performance I set the NVIDIA GPU as the Primary GPU (following the process documented here)

This works great in X11, but I can’t figure out how to set the NVIDIA GPU as the Primary GPU in Wayland.

Does anyone know how to do it? There are no Wayland instructions on the Fedora or RPMFusion website.


Okay, for anyone interested I found there are some environment variables you can set to make the NVIDIA GPU the primary GPU in Wayland. This solution technically works but the performance is absolutely horrendous and unusable.

export __GLX_VENDOR_LIBRARY_NAME=“nvidia”
export __VK_LAYER_NV_optimus=NVIDIA_only

By analogy with the auto mecahnics “parts cannon”, you have to be careful with environment-variables cannons:

Consult official Nvidai documentation for you hardware. I suspect all those variables were never intended to have all set at the same time on one device. Optimus is Nvidia’s name for laptop (and maybe some All-in-1’s) power “optimization”, so may need vendor BIOS-level support and only supports certain GPU models. From Arch Linux Prime Documnetation:

PRIME is a technology used to manage hybrid graphics found on recent desktops and laptops (Optimus for NVIDIA, AMD Dynamic Switchable Graphics for Radeon). PRIME GPU offloading and Reverse PRIME are an attempt to support muxless hybrid graphics in the Linux kernel.

Fedora’s rpmfusion drivers for my elderly iMac provide 10-nvidia.rules (fallback) and 60-nvidia-udev (power management) rules in /usr/lib/udev/rules.d/.

The environment variables come from Nvidia documentation: Chapter 35. PRIME Render Offload

I’m really clutching at straws at the moment. There doesn’t appear to be any way to make Wayland use the Nvidia GPU by default instead of integrated AMD graphics. That’s a big problem because Fedora 40 will be unusable for me.

Please explain?

Fedora has had the ability to use the iGPU for most apps and to select the dGPU for specific apps for quite some time.

When using xorg it is very simple to set the nvidia GPU as primary and not use the iGPU at all, though wayland does not have the same feature.

There are even some apps that still have glitches when using wayland (Steam, Chrome, and a few others are ones I have experienced.)

For me, I prefer using xorg because of the glitches in wayland with those apps I depend upon.

Your link to prime render offload seems to describe the way fedora allows selectively using the nvidia gpu for certain apps but does not seem to make it primary.

not sure where is to issue, but just installin rpm-fusion drivers include hybrid/optimus by default and that means igpu is first and dgpu comes when needed. also switching fedora to performance mode usually switching to use dgpu and more cpu to get best performance. balanced is like optimus/hybrid dgpu when needed and power saver is only igpu. i have never had issues on this or needed to tweak any settings

and the link to use prime-render-offload is workaround only for Xorg it dosent work at wayland sicne prime render is made only on xorg as a workaround for this. PopOS has working packages to do this on wayland have used it and tested it it works there cant remember what it was called but it is set on the OS nvidia by default

1 Like

I only want to use the Nvidia dGPU because it gives me significantly better performance – smooth animations, more responsiveness, etc. The desktop is a lot smoother.

I know how to set the dGPU as primary in X11. My my problem is that Wayland doesn’t seem have this feature - and it’s a big problem because Fedora 40 will drop the Plasma X11 session completely, as announced here and here.

I’m looking for a way around it but I can’t find one that works. Setting those environment variables offloads everything to the dGPU but the performance is really bad, so it didn’t work.

That is a bit of a misunderstanding.
Fedora is not dropping X11.
Plasma 6 is dropping X11 support so for anyone who uses Plasma with F40 and beyond they are locked out of X11. Yes, it appears to lock them out of using nvidia as the primary GPU for now.

I understand your concern; but it only appears to affect those who use kde/plasma right now.

There have been many threads over the time since wayland support was integrated into the nvidia drivers about the desire to have nvidia as the primary GPU and as I recall none have shown a solution.

It is still possible to use nvidia for each app as long as the user selects to use the dGPU when the app is launched though. A bit of a hassle but not a full deal breaker though.

Disclaimer: Systems with iGPU and dGPU have been “high maintenance”, so I stick to single GPU configurations for my personal systems: late 2012 iMac and now a deceased 2007 desktop that had only Nvidia dGPU’s. My newer systems have only iGPU’s, so I haven’t needed to deal with iGPU combined with Nvidia dGPU.

I have read descriptions of a mechanism that assigns rendering of complex elements to the dGPU, then passes rendered elements to the iGPU for display.
This could eliminate the need for the dGPU to have a direct connection to the display, so it would not be possible to disable the iGPU. Nvidia PRIME appears to support using the dGPU on a per-app basis, which would leave the iGPU in charge of the other elements in the display.

This could simplify the hardware (dGPU doesn’t need to connect to the display), but then it would not be possible to disable the iGPU.