Bug 441409 - [wayland] KWIN does not init GPU acceleration (resets to llvmpipe) in multi-gpu setups in case if one gpu does not support GPU acceleration
Summary: [wayland] KWIN does not init GPU acceleration (resets to llvmpipe) in multi-g...
Status: ASSIGNED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: efficiency-and-performance
Depends on:
Blocks:
 
Reported: 2021-08-23 04:48 UTC by Denis Reva
Modified: 2024-10-23 07:22 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
glxinfo-observer (in wayland mode) (115.33 KB, text/plain)
2021-08-23 04:48 UTC, Denis Reva
Details
glxinfo-expected (Xorg) (69.48 KB, text/plain)
2021-08-23 04:48 UTC, Denis Reva
Details
kscreen-console in wayland (10.10 KB, text/plain)
2021-08-23 07:20 UTC, Denis Reva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Reva 2021-08-23 04:48:04 UTC
Created attachment 140965 [details]
glxinfo-observer (in wayland mode)

SUMMARY
I have two GPU's in my server (Dell PowerEdge r720): integrated Matrox MGA200e and discrete nvidia gt 730. Matrox MGA200e does not support any kind of opengl acceleration (it uses LLVMpipe).

In Xorg mode I setting up nvidia as default gpu (matrox disabled).

In Wayland mode both GPU's are active, but KWIN/plasmashell inits LLVMpipe driver instead of proper GPU acceleration (nvidia eglsteams).

Expected is to support GPU acceleration in at least one display.

The issue also reproduced with Matrox + AMD Radeon Rx 560.

STEPS TO REPRODUCE
1. Have Matrox GPU (or any old-gen videocard) without actual GPU acceleration support.
2. Have modern GPU.
3. Start KDE Wayland session.
4. It uses LLVMpipe insead of acceleration of modern GPU.

OBSERVED RESULT
System GPU initialized as LLVMpipe

EXPECTED RESULT
System GPU initialized as (NVIDIA|AMDGPU)

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 5.22.4
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Kernel: 5.13.12-gentoo-dist
Comment 1 Denis Reva 2021-08-23 04:48:37 UTC
Created attachment 140966 [details]
glxinfo-expected (Xorg)
Comment 2 Denis Reva 2021-08-23 06:07:46 UTC
With 
export KWIN_DRM_DEVICES="/dev/dri/card1"
export KWIN_DRM_USE_EGL_STREAMS=1
The second monitor connected to nvidia gt 730 (modern gpu) works just as expected with all hardware accelerations.

With
KWIN_DRM_DEVICES="/dev/dri/card1;/dev/dri/card0"
Plasma crashes on startup
Comment 3 Denis Reva 2021-08-23 06:16:49 UTC
>KWIN_DRM_DEVICES="/dev/dri/card1;/dev/dri/card0"
>Plasma crashes on startup

My typo. With
KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0"
It work just like
export KWIN_DRM_DEVICES="/dev/dri/card1"
So does not recognize monitor connected to Matrox
Comment 4 Denis Reva 2021-08-23 07:20:33 UTC
Created attachment 140968 [details]
kscreen-console in wayland
Comment 5 Zamundaaa 2021-08-24 13:03:57 UTC
>My typo. With
>KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0"
>It work just like
>export KWIN_DRM_DEVICES="/dev/dri/card1"
>So does not recognize monitor connected to Matrox
That is to be expected, atm with a NVidia GPU as priamry you can't have secondary GPUs. It should be fixed by the time 5.23 releases.

Does your BIOS have a primary GPU setting? If that defaults to the Matrox card that would explain the issue, KWin honors that setting. We should probably still switch to a different GPU when we detect that the primary one doesn't have hardware acceleration though.
Comment 6 Denis Reva 2021-08-24 14:07:42 UTC
>If that defaults to the Matrox card that would explain the issue, KWin honors that setting.
Yes, Matrox is primary. I think the same way.
My bios have option to completely disable Matrox, but it likewise completely broken: it gives lack of framebuffer. So I had to use Matrox to boot server.

>switch to a different GPU when we detect that the primary one doesn't have hardware acceleration though

Yes, we should. And also setting (or variable) to override that should exists.
Comment 7 Denis Reva 2021-08-24 14:10:13 UTC
Also I dreamed about something like "GPU's settings" in the Screen tab of KDE SystemSettings :)

Thank you, Zamundaaa!
Comment 8 Denis Reva 2021-08-24 14:20:15 UTC
Also can't wait for Nvidia's Official GBM through mesa instead of Eglstreams.
Comment 9 Zamundaaa 2021-08-24 21:00:22 UTC
> Also I dreamed about something like "GPU's settings" in the Screen tab of KDE SystemSettings :)
Coincidentally I am working on something like that. I don't expect it to be finished soon enough for 5.23 though
Comment 10 Bug Janitor Service 2024-07-02 21:51:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6036