Waydroid rendering problems on dual GPU (NVIDIA+AMD) system

(i’m asking here because the problem might not be related to Waydroid itself)

I installed Waydroid following the instructions from the Arch wiki and it works OK.
Since Waydroid does not support NVIDIA cards, renders using swiftshader (CPU) and when im using graphics intensive apps (games) it gets pretty hot. So I added a Radeon card that I had sitting collecting dust and installed its drivers: yay -S xf86-video-amdgpu mesa vulkan-radeon. Then reinstalled Waydroid and it detected my Radeon
But it didn’t start. Waydroid icon appears briefly in the taskbar and disappears in a loop until waydroid session stop is run. Later i downgraded to LineageOS build 20240217 because someone on github mentioned a similar problem with their Radeon card. I ran the waydroid-choose-gpu.sh script and now it works but a black screen appeared (sounds from Android are played also). In AMDGPU_TOP i can see signs of activity in the card and my CPU fans didn’t ramp up.
If i run waydroid using waydroid show-full-ui and open apps in multi-window mode, sometimes i can get some frames of the screen or apps and i can (very briefly) interact with them.

My goal is to get waydroid running using only the Radeon card
I guess is the problem is related to XOrg (misconfiguration, frame sync)?

I have the following setup:

  • EndeavourOS + Zen kernel 6.9.7
  • KDE Plasma 6.1 + Kwin
  • Waydroid 1.4.2
  • a NVIDIA card (my main card)
  • an old AMD Radeon RX 550

inxi -G

Graphics:
  Device-1: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
    driver: amdgpu v: kernel
  Device-2: NVIDIA GM204 [GeForce GTX 980] driver: nvidia v: 555.58.02
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: X: loaded: amdgpu,nvidia
    unloaded: modesetting dri: radeonsi gpu: amdgpu,nvidia resolution:
    1: 1366x768 2: 1920x1080
  API: EGL v: 1.5 drivers: nvidia,radeonsi,swrast,zink
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 555.58.02
    renderer: NVIDIA GeForce GTX 980/PCIe/SSE2
  API: Vulkan v: 1.3.279 drivers: nvidia,radv surfaces: xcb,xlib,wayland

Contents of /var/lib/waydroid/waydroid_base.prop (idk if relevant)

ro.hardware.gralloc=gbm
ro.hardware.egl=mesa
ro.hardware.vulkan=radeon

Waydroid only supports Wayland to begin with. In order to use it on X11 you would need a nested Wayland session, so this can’t be the reason.

Hi! Be sure to follow the instruction on arch wiki, to install packages, enable/start systemd services https://wiki.archlinux.org/title/Waydroid

although I’d recommend to use weston, I think is better than cage

I use weston on top of i3 and it works fine, even on tty.

I also had troubles to first use it, I made this script to run (there are similars on the net as well)

#!/bin/bash
    weston --xwayland &
    pid1=$!
    export WAYLAND_DISPLAY=wayland-1              
    sleep 2
    waydroid show-full-ui &
    wait $pid1
    waydroid session stop
    echo 'waydroid session stopped successfully!'
# Ctrl+Alt+Backspace to quit Weston.

For me it works fine, but I have only ryzen with integrated video.