Bug 494814

Summary: NVIDIA DRM does not work with kwin_wayland
Product: [Plasma] kwin Reporter: Orfeas Karachalios <orf.sec>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: briguy992, mberezin+bugskde, xaver.hugl
Priority: NOR    
Version First Reported In: 6.2.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Orfeas Karachalios 2024-10-15 13:01:08 UTC
SUMMARY


STEPS TO REPRODUCE
1. Install `kernel 6.11.3-200.fc40.x86_64`
2. Install `nvidia-driver:open-dkms 560.35.03-1.fc39`
3. Reboot

OBSERVED RESULT
Kwin_wayland uses a lot of CPU and performance is slow because DRM is not used.
```
journalctl -b -g kwin_wayland
Oct 15 14:19:27 fedora sddm-helper-start-wayland[1584]: "kwin_wayland_drm: Failed to create framebuffer: Invalid argument\n"
Oct 15 14:19:30 fedora sddm-helper-start-wayland[1584]: "kwin_wayland_drm: Failed to create framebuffer: Invalid argument\n"
Oct 15 14:19:34 fedora sddm-helper-start-wayland[1584]: "kwin_wayland_drm: Failed to create framebuffer: Invalid argument\n"
Oct 15 14:19:34 fedora sddm-helper-start-wayland[1584]: Stopping... "kwin_wayland"
Oct 15 14:19:36 fedora systemd[1797]: Starting plasma-kwin_wayland.service - KDE Window Manager...
Oct 15 14:19:36 fedora systemd[1797]: Started plasma-kwin_wayland.service - KDE Window Manager.
Oct 15 14:19:36 fedora kwin_wayland[2118]: kwin_wayland_drm: Failed to create framebuffer: Invalid argument
Oct 15 14:19:36 fedora kwin_wayland[2118]: kwin_wayland_drm: Failed to create framebuffer: Invalid argument
```
In addition, when I run `kinfo` I got the warning:
```
libEGL warning: MESA-LOADER: failed to open simpledrm: /usr/lib64/dri/simpledrm_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib64/dri, suffix _dri)
```
EXPECTED RESULT
`Kwin` works normally and uses DRM with good performance.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Fedora 40
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
`kinfo` also shows this instead of the NVIDIA GPU
```
Graphics Processor: llvmpipe
```
Comment 1 briguy992 2024-11-22 00:05:20 UTC
Also seeing this. Have been searching to see if it's a setup issue on my side or what.

Operating System: EndeavourOS 
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: llvmpipe

Here's output from nvidia-smi command which has some further details on driver versioning

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01              Driver Version: 565.57.01      CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3080 Ti     Off |   00000000:0A:00.0  On |                  N/A |
|  0%   37C    P5             25W /  400W |     497MiB /  12288MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1090      G   /usr/lib/Xorg                                  33MiB |
|    0   N/A  N/A      1363      G   /usr/bin/ksmserver                              3MiB |
|    0   N/A  N/A      1575      G   /usr/bin/gmenudbusmenuproxy                     3MiB |
|    0   N/A  N/A      1576      G   /usr/bin/kaccess                                3MiB |
|    0   N/A  N/A      1580      G   /usr/bin/xembedsniproxy                         3MiB |
|    0   N/A  N/A      2419      G   ...yOnDemand --variations-seed-version         65MiB |
|    0   N/A  N/A      2680      G   ...local/share/Steam/ubuntu12_32/steam          4MiB |
|    0   N/A  N/A      3304      G   ./steamwebhelper                               30MiB |
|    0   N/A  N/A      3349      G   ....local/share/Steam/logs/cef_log.txt        141MiB |
+-----------------------------------------------------------------------------------------+
Comment 2 Zamundaaa 2024-11-22 00:29:00 UTC
This is a setup issue; simpledrm is controlling your GPU and not the NVidia driver. Fixing this is something you best ask your distribution for assistance with.