How to find out on which card Wayland runs?

Thank you all!
Much appreciated.

@malcolmlewis
Sorry, I didn’t follow what eactly are you trying to find.
Is to establish which GPU is connected to display?

Here is the inxi output with suggested parameters:

espinosa@espinosa-asus:~> inxi -GSaz
System:
  Kernel: 6.13.0-1-default arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.13.0-1-default
    root=UUID=60138d9f-ea26-4f20-95f6-98767950ee42 splash=silent quiet
    security=apparmor mitigations=auto
  Desktop: KDE Plasma v: 6.2.5 tk: Qt v: N/A info: frameworks v: 6.9.0
    wm: kwin_wayland tools: avail: i3lock,xscreensaver vt: 2 dm: SDDM
    Distro: openSUSE Tumbleweed-Slowroll 20250101
Graphics:
  Device-1: NVIDIA AD106M [GeForce RTX 4070 Max-Q / Mobile] vendor: ASUSTeK
    driver: nvidia v: 550.144.03 alternate: nouveau,nvidia_drm
    non-free: 550/565.xx+ status: current (as of 2025-01) arch: Lovelace
    code: AD1xx process: TSMC n4 (5nm) built: 2022+ pcie: gen: 4
    speed: 16 GT/s lanes: 8 ports: active: none empty: DP-9,HDMI-A-1
    bus-ID: 64:00.0 chip-ID: 10de:2820 class-ID: 0300
  Device-2: Advanced Micro Devices [AMD/ATI] Strix [Radeon 880M / 890M]
    vendor: ASUSTeK driver: amdgpu v: kernel pcie: gen: 4 speed: 16 GT/s
    lanes: 16 ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, DP-6,
    DP-7, DP-8, Writeback-1 bus-ID: 65:00.0 chip-ID: 1002:150e class-ID: 0380
    temp: 35.0 C
  Device-3: Shinetech ASUS FHD webcam driver: hid-sensor-hub,usbhid,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-1:2
    chip-ID: 3277:0059 class-ID: fe01 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.4
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia
    unloaded: vesa alternate: fbdev,nouveau,nv dri: radeonsi gpu: amdgpu
    display-ID: 0
  Monitor-1: eDP-1 model: Samsung 0x415d built: 2021 res: mode: 3840x2400
    hz: 60 scale: 175% (1.75) to: 2194x1371 dpi: 284 gamma: 1.2
    size: 344x215mm (13.54x8.46") diag: 406mm (16") ratio: 16:10 modes:
    max: 3840x2400 min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia drv: amd radeonsi platforms: device: 0
    drv: nvidia device: 1 drv: radeonsi gbm: drv: kms_swrast surfaceless:
    drv: nvidia wayland: drv: nvidia x11: drv: swrast
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.144.03
    glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce RTX 4070 Laptop
    GPU/PCIe/SSE2 memory: 7.81 GiB display-ID: :0.0
  API: Vulkan v: 1.4.304 layers: 2 device: 0 type: discrete-gpu name: NVIDIA
    GeForce RTX 4070 Laptop GPU driver: N/A device-ID: 10de:2820
    surfaces: xcb,xlib,wayland device: 1 type: integrated-gpu name: AMD
    Radeon Graphics (RADV GFX1150) driver: N/A device-ID: 1002:150e
    surfaces: xcb,xlib,wayland
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor wl: wayland-info
    x11: xdpyinfo, xprop, xrandr

Is it with Wayland that it always trys to run on card which is connected to display?
That would make sense. People would like to see the desktop.

@deano_ferrari

espinosa@espinosa-asus:~> cat /sys/class/drm/card*/device/power_state
D0
D0

I interpret this as both cards are powered.
No surprise here. That would explain why fans are always on.

@malcolmlewis, @deano_ferrari
About switcherooctl, I cannot find it anywhere. My Yast returns nothing when searched. Online search in repositories also finds nothing:
https://software.opensuse.org/search?baseproject=ALL&q=switcherooctl

Found it. The package is called switcheroo-control.
https://software.opensuse.org/package/switcheroo-control
…and I had it already installed.

I’ve read manual on:
https://en.opensuse.org/SDB:NVIDIA_Switcheroo_Control

I have started switcheroo-control.service systemd service as recommended:

sudo systemctl enable switcheroo-control.service

Rebooted my system.

espinosa@espinosa-asus:~> switcherooctl list
Device: 0
  Name:        NVIDIA Corporation AD106M [GeForce RTX 4070 Max-Q / Mobile]
  Default:     yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only

Device: 1
  Name:        Advanced Micro Devices, Inc. [AMD®/ATI] Strix [Radeon 880M / 890M]
  Default:     no
  Environment: DRI_PRIME=pci-0000_65_00_0

Wayland seems to be still using Nvidia.
Both GPUs are powered:

espinosa@espinosa-asus:~> cat /sys/class/drm/card*/device/power_state
D0
D0

What to do now?
Please, how to make Wayland to run on iGPU, not dGPU?

FYI: I have a dual boot with Windows. Windows by default run on iGPU. I can easily switch off dPGU completely, just from desktop software, no need to go to BIOS.

@espinosa_cz Is there a BIOS seting to control GPU order?

No unfortunately there is no such settings in BIOS, not for this laptop.

Might be off-topic, but I found the code of switcheroo-control was updated 2 years ago, while the code of suse-prime was updated 2 months ago. Why is switcheroo-control considered better for new systems?

@az Hi did you read the link @deano_ferrari posted in post #18?

@malcolmlewis Yes, I regularly check openSUSE news. While I appreciate the improved design mentioned in that post, my concern is that switchrooctl hasn’t been updated in about three years. But well, maybe that’s not a concern to others…

There is no update needed for switcheroo-control. It is a totally simply script which needs zero bugfixes, adaptions, updates or anything else. In oposite to prime.

That is also a reason why switcheroo-control is prefered. It is simple snd maintenance free.

1 Like

@hui That makes sense. Thanks!

Hi everyone,
Back to my original question - how to find on which card Wayland runs.

I did a bit of research and it turned out it is the Wayland compositor that decides which GPU is going to be used in the case of multiple GPUs system; to decide which one is going to be the “primary GPU”.

Quoting from the response:
…The compositor/server (or its logs) would be the more appropriate place to tell what card it is using and driving which outputs, by looking at what driver it’s loading/using on its own.

In my case the compositor is KDE’s KWin. And I found the place which makes the decision. It was changed recently:

494749 – Heuristic for selecting primary GPU - Heuristic for selecting primary GPU
Sign in · GitLab commit/5133842717679787074682aa8eebbf92e41f48da - backends/drm: make a smarter default choice about the primary GPU

Quoting:
By default, we want the primary GPU to be one that displays are connected to, and if we’re on a laptop, one that the internal display is connected to.

I guess this means this behaviour has been there since KDE Plasma 6.3.
I suspect, in previous versions, the compositor simply picked whichever card was first on the PCI bus.
Other Wayland compositors may have other strategies, so you can end up with a different GPU as the primary one.

There is no communication about which GPU card was chosen with Wayland server or wayland-info :frowning:
There is no GUI tool in KDE Plasma showing this information :frowning:
KWin simply prints it to a debug log. Look for string:
chose <DRM device> as the primary GPU

So, I need to change which card the monitor is connected to. I cannot do that in BIOS.
So it is down to the kernel, hopefully settable with parameters like KMS, modesetting or ACPI. I’ll open a separate thread for that. Thank you everyone for helping me here!

P.S.
Few tips here:

inxi -GSaz

should do it???

@espinosa_cz You need to revisit your system BIOS and check all the settings that may affect GPU order. While the order is Nvidia then AMD in the output, it’s going to use the Nvidia device…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.