Kwin_wayland fail to connect on igpu on first login

Hello,

I’m trying Linux on a laptop and I found this weird behavior on kwin.

On each boot the first login will always fall back to the dGPU because kwin will fail to connect on the iGPU.
But it will successfully do it on the second attempt.
You can see on the log below that at 20:41 it failed to select my igpu due to it not being detected.
And right after a logout, login at 21:30 this time it could select the drm device automatically and use it.

I already tried to use KWIM_DRM_DEVICES but forcing the igpu when he is not available will just bypass the command and start on the dGPU.

I can maybe suspect a race condition where the amd driver isn’t fully loaded when kwin try to connect to it but I don’t have enough knowledge on it.

Do you know if this problem is known by kde ?

Thanks in advance.

System Specs

OS : Kubuntu 25.04
CPU : AMD Ryzen 7 5800H
iGPU : AMD Vega 8
dGPU : NVIDIA RTX 3070 laptop

PS : I know that Kubuntu is not a bleeding edge distro, so if this problem is already solved, I will wait until the next version.

Logs

mai 15 20:41:34 thomas-omen systemd[1742]: Starting plasma-kwin_wayland.service - KDE Window Manager...
mai 15 20:41:34 thomas-omen systemd[1742]: Started plasma-kwin_wayland.service - KDE Window Manager.
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: No backend specified, automatically choosing drm
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_core: Failed to open drm node: "/dev/dri/card0"
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:127:90: numeric keysym "0x1002014" (16785428)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:128:90: numeric keysym "0x1002013" (16785427)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:129:90: numeric keysym "0x1002011" (16785425)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:160:67: numeric keysym "0x1000140" (16777536)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:160:90: numeric keysym "0x100013f" (16777535)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:170:68: numeric keysym "0x100202f" (16785455)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:173:91: numeric keysym "0x1002026" (16785446)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:174:91: numeric keysym "0x10022c5" (16786117)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:175:91: numeric keysym "0x1002215" (16785941)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1891]: kwin_xkbcommon: XKB: [XKB-489] fr:176:91: numeric keysym "0x1002212" (16785938)
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: The XKEYBOARD keymap compiler (xkbcomp) reports:
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: > Warning:          Unsupported maximum keycode 708, clipping.
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: >                   X11 cannot support keycodes above 255.
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1957]: Errors from xkbcomp are not fatal to the X server
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1958]: Initializing  "/usr/lib/x86_64-linux-gnu/qt6/plugins/plasma/kcms/systemsettings/kcm_fonts.so"
mai 15 20:41:35 thomas-omen kwin_wayland_wrapper[1958]: Initializing  "/usr/lib/x86_64-linux-gnu/qt6/plugins/plasma/kcms/systemsettings/kcm_style.so"
mai 15 20:41:41 thomas-omen kwin_wayland_wrapper[1891]: kwin_core: Failed to open /dev/dri/renderD129 device (No such device)
mai 15 20:41:41 thomas-omen kwin_wayland_wrapper[1891]: kwin_wayland_drm: failed to open drm device at "/dev/dri/renderD129"
mai 15 20:41:41 thomas-omen kwin_wayland_wrapper[1891]: kwin_wayland_drm: failed to open drm device at ""
mai 15 20:41:41 thomas-omen kwin_wayland_wrapper[1891]: kwin_wayland_drm: failed to open drm device at "/dev/dri/card0"
mai 15 20:41:41 thomas-omen kwin_wayland_wrapper[1891]: kwin_wayland_drm: failed to open drm device at ""
mai 15 20:41:42 thomas-omen kwin_wayland_wrapper[1891]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
mai 15 20:41:50 thomas-omen systemd[1742]: Stopping plasma-kwin_wayland.service - KDE Window Manager...
mai 15 20:41:50 thomas-omen kwin_wayland_wrapper[1891]: kwin_scene_opengl: Could not delete render time query because no context is current
mai 15 20:41:50 thomas-omen kwin_wayland_wrapper[1891]: kwin_scene_opengl: Could not delete render time query because no context is current
mai 15 20:41:50 thomas-omen kwin_wayland_wrapper[1891]: kwin_scene_opengl: Could not delete render time query because no context is current
mai 15 20:41:50 thomas-omen systemd[1742]: Stopped plasma-kwin_wayland.service - KDE Window Manager.
mai 15 20:41:50 thomas-omen systemd[1742]: plasma-kwin_wayland.service: Consumed 4.245s CPU time, 139.2M memory peak.
mai 15 20:42:05 thomas-omen systemd[3108]: Starting plasma-kwin_wayland.service - KDE Window Manager...
mai 15 20:42:05 thomas-omen systemd[3108]: Started plasma-kwin_wayland.service - KDE Window Manager.
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: No backend specified, automatically choosing drm
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:127:90: numeric keysym "0x1002014" (16785428)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:128:90: numeric keysym "0x1002013" (16785427)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:129:90: numeric keysym "0x1002011" (16785425)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:160:67: numeric keysym "0x1000140" (16777536)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:160:90: numeric keysym "0x100013f" (16777535)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:170:68: numeric keysym "0x100202f" (16785455)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:173:91: numeric keysym "0x1002026" (16785446)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:174:91: numeric keysym "0x10022c5" (16786117)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:175:91: numeric keysym "0x1002215" (16785941)
mai 15 20:42:05 thomas-omen kwin_wayland_wrapper[3253]: kwin_xkbcommon: XKB: [XKB-489] fr:176:91: numeric keysym "0x1002212" (16785938)
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: The XKEYBOARD keymap compiler (xkbcomp) reports:
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: > Warning:          Unsupported maximum keycode 708, clipping.
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: >                   X11 cannot support keycodes above 255.
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: > Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: > Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3370]: Errors from xkbcomp are not fatal to the X server
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3371]: Initializing  "/usr/lib/x86_64-linux-gnu/qt6/plugins/plasma/kcms/systemsettings/kcm_fonts.so"
mai 15 20:42:06 thomas-omen kwin_wayland_wrapper[3371]: Initializing  "/usr/lib/x86_64-linux-gnu/qt6/plugins/plasma/kcms/systemsettings/kcm_style.so"
mai 15 20:42:07 thomas-omen kwin_wayland_wrapper[3253]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11

Hello,

I’ve seen this to late to edit the first post.

But the second login attempt is at 20:42 not at 21:30 like I said for whatever reason.
Also the Subject is obviously “Kwin_wayland fail to connect” and not “wail” :sweat_smile:

Hi! I’m not currently a Kubuntu user, but I have been in the past, and I do have an AMD+NVIDIA hybrid laptop…just checking, what method did you use to install the NVIDIA drivers?

I wonder if that might be related to issues like this - Flickering issues SDDM on first boot - that was posted back in March, which could be around when software versions would have been frozen for Kubuntu 25.04?

Do you know if you have any specific kernel parameters set, either for the AMD or the NVIDIA GPUs?

And, just checking, is the desktop otherwise behaving normally when you log in the first time - except that you see (through nvidia-smi perhaps?) that everything is using the dGPU?

Hi,

Thank you for your response !

I installed my NVIDIA drivers first by the driver manager that comes with the distribution and later via the ubuntu PPA ( because the one on the driver manager would crash my desktop in less than an hour ) :

  • Driver manager : v570.133
  • Ubuntu PPA : v570.144

I looked at the post you linked but I do not have any flicker on mine.

Also I have no kernel parameters set other than the one by default.
I’m testing linux via Kubuntu so the OS should be clean.
I know though that the NVIDIA driver as activated the nomodeset parameter with the driver installation.

And yes the desktop is behaving correctly with everything run through the dGPU.
A few things to notes though :

  • On the first login the transition screen only appear on the monitor connected to the dGPU, nothing on the internal one.
  • While the internal is set as the primary monitor the cursor will place itself on the dGPU monitor.
  • The internal one will still function even when the dGPU can’t talk to it directly (no dedicated mux switch) , so I suppose the iGPU initialize itself right after the failed attempt from kwin but is somehow still grabbed to be used as a pass-through to the internal monitor.

If you need this :
Kernel : 6.14.0-15-generic
grub boot parameters :
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

I hope that you have everything you need.

Again, to slow to edit the response… sorry.

So,
I just saw on my log in the first post that the card kwin fail to initialize is card0 but when the iGPU is detected and added on the system, it will appear as card2 with the dGPU being the card1.
Is this behavior caused by the failed attempt of kwin or is it maybe the problem that will cause kwin to fail ?

I’m definitely no graphics expert, so I’d defer to any others here with more knowledge on that front :slight_smile:

Just checking then, when you tried using KWIM_DRM_DEVICES, was that using /dev/dri/card0, or /dev/dri/card2?

If trying that with card2 doesn’t work, maybe the general issue is that the AMD iGPU is taking so long to come “online” that it’s not finishing until after you’ve logged in to Plasma? I wonder if it would help to try to use systemd to delay the process until the AMD card is up - maybe something like what’s referenced here, for your graphics device and made something that must come “After” plasma-kwin_wayland.service, might be helpful?

Just some ideas, hopefully something there spurs a better thought for you or others!

Hi,

Thank you for your response !

I did some tests based on your comment.

First of, KWIN_DRM_DEVICES was done on the card2 because at that time that was the only one I saw when I was in my session.

For the rest, It looks like the issue is indeed a problem of delay.
But an override on plasma-kwin_wayland.service does nothing, It’s more complex than that I believe.

I noticed that, if i stay literally 10 seconds on the login screen, SDDM will relaunch itself without any interaction on my end and be on the iGPU this time.
I tried to do an override in /etc/sddm.conf.d/kubuntu.conf telling him to wait on the iGPU but it did not work either…

Like I suspected in my first post, It looks like it’s a race condition and my amd card took way too long to come online.

At this point I don’t know if the issue is on kwin/sddm, amdgpu or my computer…

What do you think ?

If my computer isn’t the problem, I would like to create a bug report on this but for now, I don’t know who the receiver should be.

Ah - probably out of my expertise now, but the only other thing I could think to try is checking if the same issue occurs in a live USB session? It might help to try that with a different distribution as well, just to help rule out any Kubuntu-specific issues with the kernel, or other relevant packages like Mesa?

I will try on a live usb session and on another distribution too, thank you !!

I will not be able to test it right now but I will make different tests and the coming days.

Side note : I really hope that this issue is not Kubuntu-specific as I really liked the combination of KDE with Ubuntu :sweat_smile:

Again thank you and I will come back as soon as I will have done all my tests !

1 Like

Hi,

I’m back after some testings and I think kwin is not the problem.

Keep in mind that I have secure boot enabled on my laptop due to Windows.

Here’s a list of tests I did :

  • Live CD without nvidia driver
    1. Kubuntu : Boot with the iGPU and nouveau for the dGPU + monitor
    2. Fedora KDE : same as Kubuntu
    3. PikaOS : can’t boot due to secure boot
  • Live CD with nvidia driver
    1. Manjaro : Display correctly the internal monitor with the iGPU and external with dGPU
  • Installed distro
    1. Manjaro : Kernel panic due to secure boot
    2. Fedora : Had the same problem as Kubuntu but recover much quicker cf. log

I didn’t have the time to build an entire arch distro myself and the one I wanted to use (EndeavourOS) don’t support secure boot either.

By seeing how Manjaro and Fedora handle this, I believe that Kubuntu just doesn’t prioritize loading the amdgpu driver over the nvidia one.
Or maybe he is much heavier to load ?

Well, at least I don’t think kwin is the problem in the end.
For me, it’s either the amdgpu driver or my computer.

So thank you and if you have other things to tests, I can do it !

Log :

mai 21 22:37:46 fedora sddm-helper-start-wayland[1561]: "kwin_xkbcommon: XKB: [XKB-489] fr:127:90: numeric keysym \"0x1002014\" (16785428)\nkwin_xkbcommon: XKB: [XKB-489] fr:128:90: numeric keysym \"0x1002013\" (16785427)\nkwin_xkbcommon: XKB: [XKB-489] fr:129:90: numeric keysym \"0x1002011\" (16785425)\nkwin_xkbcommon: XKB: [XKB-489] fr:160:67: numeric keysym \"0x1000140\" (16777536)\n"
mai 21 22:37:46 fedora sddm-helper-start-wayland[1561]: "kwin_xkbcommon: XKB: [XKB-489] fr:160:90: numeric keysym \"0x100013f\" (16777535)\nkwin_xkbcommon: XKB: [XKB-489] fr:170:68: numeric keysym \"0x100202f\" (16785455)\nkwin_xkbcommon: XKB: [XKB-489] fr:173:91: numeric keysym \"0x1002026\" (16785446)\nkwin_xkbcommon: XKB: [XKB-489] fr:174:91: numeric keysym \"0x10022c5\" (16786117)\nkwin_xkbcommon: XKB: [XKB-489] fr:175:91: numeric keysym \"0x1002215\" (16785941)\nkwin_xkbcommon: XKB: [XKB-489] fr:176:91: numeric keysym \"0x1002212\" (16785938)\n"
mai 21 22:37:49 fedora sddm-helper-start-wayland[1561]: "kwin_core: Failed to open /dev/dri/renderD129 device (No such device)\nkwin_wayland_drm: failed to open drm device at \"/dev/dri/renderD129\"\n"
mai 21 22:37:49 fedora sddm-helper-start-wayland[1561]: "kwin_wayland_drm: failed to open drm device at \"\"\n"
mai 21 22:37:49 fedora sddm-helper-start-wayland[1561]: "kwin_wayland_drm: failed to open drm device at \"\"\n"
mai 21 22:37:49 fedora sddm-helper-start-wayland[1561]: "kwin_wayland_drm: failed to open drm device at \"\"\n"
mai 21 22:37:54 fedora sddm-helper-start-wayland[1561]: Stopping... "kwin_wayland"
mai 21 22:37:54 fedora sddm-helper-start-wayland[1561]: "kwin_scene_opengl: Could not delete render time query because no context is current\n"
mai 21 22:37:54 fedora sddm-helper-start-wayland[1561]: "kwin_scene_opengl: Could not delete render time query because no context is current\nkwin_scene_opengl: Could not delete render time query because no context is current\n"
mai 21 22:37:55 fedora systemd[1765]: Starting plasma-kwin_wayland.service - KDE Window Manager...
mai 21 22:37:55 fedora systemd[1765]: Started plasma-kwin_wayland.service - KDE Window Manager.
mai 21 22:37:55 fedora kwin_wayland[2064]: No backend specified, automatically choosing drm
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:127:90: numeric keysym "0x1002014" (16785428)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:128:90: numeric keysym "0x1002013" (16785427)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:129:90: numeric keysym "0x1002011" (16785425)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:160:67: numeric keysym "0x1000140" (16777536)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:160:90: numeric keysym "0x100013f" (16777535)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:170:68: numeric keysym "0x100202f" (16785455)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:173:91: numeric keysym "0x1002026" (16785446)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:174:91: numeric keysym "0x10022c5" (16786117)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:175:91: numeric keysym "0x1002215" (16785941)
mai 21 22:37:55 fedora kwin_wayland[2064]: kwin_xkbcommon: XKB: [XKB-489] fr:176:91: numeric keysym "0x1002212" (16785938)
mai 21 22:37:56 fedora kwin_wayland_wrapper[2184]: The XKEYBOARD keymap compiler (xkbcomp) reports:
mai 21 22:37:56 fedora kwin_wayland_wrapper[2184]: > Warning:          Could not resolve keysym XF86RefreshRateToggle
mai 21 22:37:56 fedora kwin_wayland_wrapper[2184]: > Warning:          Could not resolve keysym XF86Accessibility
mai 21 22:37:56 fedora kwin_wayland_wrapper[2184]: > Warning:          Could not resolve keysym XF86DoNotDisturb
mai 21 22:37:56 fedora kwin_wayland_wrapper[2184]: Errors from xkbcomp are not fatal to the X server
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: The XKEYBOARD keymap compiler (xkbcomp) reports:
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: > Warning:          Unsupported maximum keycode 708, clipping.
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: >                   X11 cannot support keycodes above 255.
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: > Warning:          Could not resolve keysym XF86RefreshRateToggle
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: > Warning:          Could not resolve keysym XF86Accessibility
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: > Warning:          Could not resolve keysym XF86DoNotDisturb
mai 21 22:37:56 fedora kwin_wayland_wrapper[2206]: Errors from xkbcomp are not fatal to the X server
mai 21 22:38:01 fedora kwin_wayland[2064]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11