Wayland setting primary gpu(NVIDIA)

Hi there,

I recently installed Fedora 36 on my XPS 9520. It has RTX 3050 and I installed all the required drivers from rpm fusion repository(akmod-nvidia:510). However, Wayland chooses Intel gpu as primary gpu. I know that Fedora 36 came with Wayland+Nvidia by default but I can’t say same thing for my setup. How can I set primary gpu to Nvidia for wayland?

PS. It works fine with x11

$ glxinfo | egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Graphics (ADL GT2)


1 Like

Instructions here but might not work as expected with wayland

It’s not for wayland. I already followed that instructions for x11 but it doesn’t work for wayland. I am specifically looking for some configuration file in wayland as in x11.

I know post is old but here I go :))

This is wayland way I hope you can do it.

1 Like

Thanks for the reply! I switched back to X11. I just wanted to give it a try to wayland but it was early :slight_smile:

NVIDIA proprietary drivers only recently support Wayland framework, Fedora default configuration is Wayland … this explains that, Intel as default GPU, not recent NVIDIA hardware so X11 …

I’m on Fedora Gnome + Wayland + Nvidia/Intel hybrid graphics, any updates on this?

What updates are you looking for?

The posts above show how to use nvidia as primary with wayland and this shows how to do it with xorg.

Nvidia drivers support wayland since the 495 version was released with fedora 35.

How do you do it in Fedora 37 exactly? The gnome extension that did it only supported Gnome 42, not 43. I am just a little confused is all.

We need a starting point to answer that.
Does the nvidia driver work for you with wayland?
Is the only issue the desire to set nvidia as the primary GPU?
Is there something else that is of concern?
What version of the nvidia drivers are installed? (that can be answered by posting the output of dnf list installed '*nvidia*' using the Preformatted text tags </> above.)

Here is a similar topic

I’m currently on Fedora 37, Gnome using Wayland with my Nvidia MX150+Intel with proprietary drivers 525 from RPMFusion. I’ll try to post as much information as I can. On Xorg I’ve always run the GPU as my primary and on Xorg the option to do that in Fedora is straight forward enough I was able to figure it out according to the Fedora Docs here. As far as I can tell, I’m using my Intel graphics for like +90% of my Wayland usage, all apps except for maybe Minecraft launcher, open with my Intel integrated graphics. I was just hoping/seeing if there was a simple way to at the very least test how using only the Nvidia GPU on Wayland would fare in comparison. It’s mostly for testing purposes. The link you posted, I also did that for my xorg.conf file btw, but I am now aware that doesn’t apply to Wayland.

[scott@fedora ~]$ dnf list installed '*nvidia*'
Installed Packages
akmod-nvidia.x86_64                       3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.0.16-300.fc37.x86_64.x86_64 3:525.60.11-1.fc37 @@commandline         
kmod-nvidia-6.0.17-300.fc37.x86_64.x86_64 3:525.60.11-1.fc37 @@commandline         
kmod-nvidia-6.0.18-300.fc37.x86_64.x86_64 3:525.60.11-1.fc37 @@commandline         
nvidia-gpu-firmware.noarch                20221214-145.fc37  @updates              
nvidia-persistenced.x86_64                3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                    3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
nvidia-vaapi-driver.x86_64                0.0.8-1.fc37       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64           3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.i686        3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64      3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64        3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686             3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64           3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64          3:525.60.11-1.fc37 @rpmfusion-nonfree-nvidia-driver
[scott@fedora ~]$ glxinfo | egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
[scott@fedora ~]$ lsmod | grep -Ei 'nouveau|nvidia'
nvidia_drm             73728  2
nvidia_modeset       1208320  2 nvidia_drm
nvidia_uvm           2904064  0
[scott@fedora ~]$ inxi -Fzx
  Kernel: 6.0.18-300.fc37.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.38-25.fc37 Desktop: GNOME v: 43.2 Distro: Fedora release 37 (Thirty
  Type: Laptop System: Acer product: Aspire E5-576G v: V1.32
    serial: <superuser required>
  Mobo: KBL model: Ironman_SK v: V1.32 serial: <superuser required>
    UEFI: Insyde v: 1.32 date: 10/24/2017
  ID-1: BAT1 charge: 9.1 Wh (100.0%) condition: 9.1/62.2 Wh (14.7%)
    volts: 12.7 min: 11.1 model: PANASONIC AS16B5J status: full
  Info: quad core model: Intel Core i5-8250U bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
  Speed (MHz): avg: 3000 high: 3401 min/max: 400/3400 cores: 1: 3401 2: 3400
    3: 1800 4: 3400 5: 1800 6: 3400 7: 3401 8: 3400 bogomips: 28800
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Device-1: Intel UHD Graphics 620 vendor: Acer Incorporated ALI driver: i915
    v: kernel arch: Gen-9.5 bus-ID: 00:02.0
  Device-2: NVIDIA GP108M [GeForce MX150] vendor: Acer Incorporated ALI
    driver: nvidia v: 525.60.11 arch: Maxwell bus-ID: 01:00.0
  Device-3: Chicony HD WebCam type: USB driver: uvcvideo bus-ID: 1-7:4
  Display: wayland server: X.Org v: 22.1.7 with: Xwayland v: 22.1.7
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    unloaded: fbdev,nouveau,vesa dri: iris gpu: i915
    resolution: 1920x1080~60Hz
  API: OpenGL v: 4.6 Mesa 22.3.2 renderer: Mesa Intel UHD Graphics 620 (KBL
    GT2) direct render: Yes
  Device-1: Intel Sunrise Point-LP HD Audio vendor: Acer Incorporated ALI
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
  Sound API: ALSA v: k6.0.18-300.fc37.x86_64 running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.63 running: yes
  Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
    v: kernel bus-ID: 03:00.0
  IF: wlp3s0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Acer Incorporated ALI driver: r8169 v: kernel port: 3000
    bus-ID: 04:00.1
  IF: enp4s0f1 state: down mac: <filter>
  Device-1: Intel Wireless-AC 3168 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-5:3
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
  Local Storage: total: 238.47 GiB used: 145.59 GiB (61.0%)
  ID-1: /dev/sda vendor: SK Hynix model: HFS256G39TND-N210A size: 238.47 GiB
  ID-1: / size: 236.87 GiB used: 145.3 GiB (61.3%) fs: btrfs dev: /dev/dm-0
    mapped: luks-d99ea368-7957-47b2-871b-98d2044ddea8
  ID-2: /boot size: 973.4 MiB used: 280 MiB (28.8%) fs: ext4 dev: /dev/sda2
  ID-3: /boot/efi size: 598.8 MiB used: 17.4 MiB (2.9%) fs: vfat
    dev: /dev/sda1
  ID-4: /home size: 236.87 GiB used: 145.3 GiB (61.3%) fs: btrfs
    dev: /dev/dm-0 mapped: luks-d99ea368-7957-47b2-871b-98d2044ddea8
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0
  System Temperatures: cpu: 59.0 C pch: 52.0 C mobo: N/A
  Fan Speeds (RPM): N/A
  Processes: 346 Uptime: 1h 11m Memory: 15.5 GiB used: 5.33 GiB (34.4%)
  Init: systemd target: graphical (5) Compilers: gcc: 12.2.1 Packages: 90
1 Like

X11.conf file doesn’t apply to Wayland. Currently, there is no option for setting Nvidia as the primary GPU. Wayland runs in hybrid mode. By saying that, you can launch apps with discrete GPU but not the gnome shell itself. I don’t know if recent updates brought an option for disabling hybrid mode.

1 Like

I distinctly recall seeing a couple options posted about making nvidia primary when using wayland, but cannot seem to find them right now. A bit of searching should reveal them though.

You can switch to and back from Wayland and X11 either using GDM login manager or installing/removing ‘gnome-session-wayland-session’ or ‘gnome-session-xsession’ packages. Many apps are compiled with Wayland libraries. NetBSD uses exclusively X11R7 with some Wayland dependencies so at some point you might need to recompile an app …

Well, when you find them feel free to let me know and I’ll test them out on Fedora 37