Can't switch to NVIDIA graphics card on Wayland KDE (Integrated NVIDIA/Intel)

ON X11:
I’m not sure that I’m using specifically suse-prime, most likely I’m using the one that was installed with the drivers. But I’m not sure.

inxi -GSaz
System:
  Kernel: 6.9.7-1-default arch: x86_64 bits: 64 compiler: gcc v: 13.3.0
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.9.7-1-default
    root=UUID=eeded03c-b88e-4133-b3ac-a6b810b9857c rhgb quiet
    rd.driver.blacklist=nouveau nvidia-drm.modeset=1 splash=silent
    mitigations=auto quiet security=apparmor
  Desktop: KDE Plasma v: 6.1.1 tk: Qt v: N/A info: frameworks v: 6.3.0
    wm: kwin_x11 tools: avail: xscreensaver vt: 2 dm: SDDM Distro: openSUSE
    Tumbleweed 20240701
Graphics:
  Device-1: Intel UHD Graphics 620 vendor: Xiaomi driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
    empty: DP-1,HDMI-A-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:5917
    class-ID: 0300
  Device-2: NVIDIA GP108M [GeForce MX150] vendor: Xiaomi Mi Notebook Pro
    driver: nvidia v: 550.90.07 alternate: nouveau,nvidia_drm non-free: 545.xx+
    status: current (as of 2024-06; EOL~2026-12-xx) arch: Maxwell code: GMxxx
    process: TSMC 28nm built: 2014-2019 pcie: gen: 3 speed: 8 GT/s lanes: 4
    bus-ID: 01:00.0 chip-ID: 10de:1d12 class-ID: 0302
  Device-3: Cheng Uei Precision Industry (Foxlink) XiaoMi USB 2.0 Webcam
    driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0
    bus-ID: 1-6:4 chip-ID: 05c8:03b7 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.12 with: Xwayland v: 24.1.0
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia alternate: intel
    dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 507x285mm (19.96x11.22")
    s-diag: 582mm (22.9")
  Monitor-1: eDP-1 mapped: eDP-1-1 model: BOE Display 0x0747 built: 2017
    res: 1920x1080 hz: 60 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: 1920x1080
  API: EGL v: 1.5 hw: drv: intel iris drv: nvidia platforms: device: 0
    drv: nvidia device: 1 drv: iris device: 3 drv: swrast gbm: drv: iris
    surfaceless: drv: nvidia x11: drv: nvidia inactive: wayland,device-2
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.90.07
    glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce MX150/PCIe/SSE2
    memory: 1.95 GiB
  API: Vulkan v: 1.3.283 layers: 6 device: 0 type: integrated-gpu name: Intel
    UHD Graphics 620 (KBL GT2) driver: N/A device-ID: 8086:5917
    surfaces: xcb,xlib device: 1 type: discrete-gpu name: NVIDIA GeForce MX150
    driver: N/A device-ID: 10de:1d12 surfaces: xcb,xlib

Configuration file in /etc/X11/xorg.conf.d/ is under90-nvidia.conf

under90-nvidia.conf
Section "ServerLayout"
    Identifier "layout"
    Screen "nvidia"
    Inactive "intel"
    Inactive "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
EndSection

Section "Screen"
    Identifier "modesetting"
    Device "modesetting"
EndSection

Section "Device"
    Identifier "modesetting"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
    Option "DPI" "96 x 96"
    Option "AllowEmptyInitialConfiguration"
    Option "AllowExternalGpus"
EndSection

@JabaTheFrog So it’s still using the Intel GPU with modesetting as that’s the only card connected to the display (eDP-1-1). Also notice the ERR in the nvidia-smi output.

Do you have switcherooctl service installed/enabled/started? If so start the service and run the command switcherooctl list

This is likely causing issues in the kernel options rd.driver.blacklist=nouveau nvidia-drm.modeset=1 Normally for Intel/Nvidia it’s fbdev=1 nosimplefb=1 any other options can be set in a /etc/modprobe.d/50-nvidia.conf

Then if you switch to Wayland and post the output from the commands again.

I have a problem that I don’t have the /etc/modprobe.d/50-nvidia.conf file at all. Do I need to create one?

And by the way switcherooctl list under X11 is giving me

Device: 0
  Name:        Intel® UHD Graphics 620
  Default:     yes
  Environment: DRI_PRIME=pci-0000_00_02_0

Device: 1
  Name:        NVIDIA Corporation GP108M [GeForce MX150] (Mi Notebook Pro [GeForce MX150])
  Default:     no
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only

@JabaTheFrog So as you can see, Intel is still the default GPU…

Installation of the nvidia driver should blacklist nouveau, so check with (as root user) modprobe -c | grep "blacklist nouveau"

That xorg 90-nvidia.conf is also likely an issue, and my experience with the recent versions of Tumbleweed is not needed… Can you check if suse-prime is installed via zypper se -i suse-prime bbsitch it should return no output if not installed.

Oh, I do have suse-prime installed (and even some applet, but it doesn’t work)

modprobe -c | grep "blacklist nouveau"

blacklist nouveau
blacklist nouveau
blacklist nouveau

@JabaTheFrog, care to clean up the system and get back to a know base to work from? My expectation with a few changes that we will see the same outputs in both Xorg and Wayland, your system will use the Intel GPU to drive the display and the Nvidia card should offload the same as it currently is in Xorg…

What do you mean by “clean up the system”? Completely reinstall the OS or what? :face_with_raised_eyebrow:

@JabaTheFrog No, just get the setting back to a known base

My system is fairly clean and recently installed. The only thing I have installed are the NVIDIA drivers and the powerprofilesctl. Do you suggest removing these?

@JabaTheFrog No cleaning up the Nvidia and suse-prime, fix the boot options etc.

I don’t really understand the problem. I also have the optimus system with intel and nvidia graphics card. I use suse-prime under Wayland for the switch. That works without any problems!

@matbhm It’s very hardware specific depending on the Intel/Nvidia setup. Is yours a 3D Controller?

@matbhm Wayland still uses hybrid mode with PRIME. JabaTheFrog wants to use NVIDIA exclusively to render the desktop environment.

If that’s ok to you to still use Plasma on Intel, but run every application on NVIDIA as mentioned, i think that may work for you:

Create a .sh file on /etc/profile.d

export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __NV_PRIME_RENDER_OFFLOAD=1
export __VK_LAYER_NV_optimus=NVIDIA_only

Thank you for your answer. To be honest, I don’t know if it’s a 3D controller.

The technical data:

And the Nvidia card used is a 940m.

@matbhm if you run /sbin/lspci -nnk | grep -EA3 "VGA|Display|3D" will show :wink:

The result:

/sbin/lspci -nnk | grep -EA3 “VGA|Display|3D”
00:02.0 VGA compatible controller [0300]: Intel Corporation Skylake GT2 [HD Graphics 520] [8086:1916] (rev 07)
Subsystem: Acer Incorporated [ALI] Device [1025:100c]
Kernel driver in use: i915
Kernel modules: i915


01:00.0 3D controller [0302]: NVIDIA Corporation GM108M [GeForce 940M] [10de:1347] (rev a2)
Subsystem: Acer Incorporated [ALI] Device [1025:100d]
Kernel modules: nouveau, nvidia_drm, nvidia
02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)

And now :blush: ?

@matbhm So yours is the same, 3D Controller :wink: But your not using Nvidia (Module not in use), is it turned off?

It broke the system, I had to delete this file through the recovery

@JabaTheFrog Ok, so my suggestion(s) is as follows;

  1. Remove suse-prime and plasma5-applet-suse-prime and lock;
zypper rm suse-prime plasma5-applet-suse-prime
zypper al suse-prime plasma5-applet-suse-prime
  1. Check the /etc/X11/xorg.conf.d/90-nvidia.conf file is gone. If not manually remove with rm /etc/X11/xorg.conf.d/90-nvidia.conf

  2. Fire up YaST Bootloader and select the Kernel Parameter tab and under Optional Kernel Command Line parameter, remove the rd.driver.blacklist=nouveau nvidia-drm.modeset=1 and add fbdev=1 nosimplefb=1

  3. Optional/Recommended for power management of the Nvidia GPU, since it looks like it’s stuck on P0 (Max performance)? So create a file called /etc/modprobe.d/50-nvidia.conf and in that file add;

##Power Management
options nvidia NVreg_DynamicPowerManagement=0x02

Once that is all done, run the command dracut -f --regenerate-all to ensure the options are added to initrd.

  1. Reboot.

Log into the Xorg Session and check with switcherooctl list and inxi -Gxxz, log into a Wayland session and run the commands again and they should be the same?

If you get a black screen at boot or can’t login, then press Ctrl+Alt+F1 to get to a tty, login as root and run systemctl reboot, then at Grub, press the e key to edit, arrow down to the line starting linux (you will see the kernel options we added), press the end key and add nomodeset and press F10 to boot. Then can sort out the issue if there is one.