void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

KDE Wayland Broken on Latest Nvidia Driver

Open ElliotLurie opened this issue 4 years ago • 7 comments

Is this a new report?

Yes

System Info

Void 5.19.16_1 x86_64 GenuineIntel uptodate FFFFF

Package(s) Affected

nvidia-515.65.01_2, plasma-wayland-protocols-1.9.0_1

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

The Plasma Wayland session works with nvidia-drm enabled just as other window managers such as Wayfire do.

Actual behaviour

The desktop launches though it is incredibly slow and laggy, making it unusable. According to this comment on Reddit, this does not happen with the 470 series of Nvidia drivers. I think this might be an EGL/GBM issue.

If there is a way to solve this issue without modifying the package, such as an environment variable, I haven't found it and it should be put somewhere in the docs.

Steps to reproduce

  1. Install Nvidia drivers
  2. Enable kernel modesetting (nvidia-drm) on boot
  3. Install kde5 and the various packages required to run a Wayland session in Plasma
  4. Launch the Wayland session from SDDM

ElliotLurie avatar Oct 30 '22 18:10 ElliotLurie

The reddit comment referred to above was mine. I have since installed Void Plasma Wayland with nvidia for myself to investigate (GeForce GTX 1660 Ti), and can confirm this issue with nvidia515.65.01 and kernel 5.19.16_1. If it helps, this is what I have found so far:

  • Does not occur on Plasma X11
  • Occurs with startx as well as SDDM login
  • Downgrading to nvidia470 xbps packages fixes it
  • kwin_wayland takes nearly 100% cpu during this
  • Occurs with more than one theme and icon set
  • A key pressed within both Konsole (wayland) and lxterminal (Xwayland) is sometimes echoed repeatedly to the terminal window.
  • Briefly corrects and lowers CPU usage after showing irq-130nvidia interrupt in top?

Despite very slow startup, the latest version of kwin_wayland initially allows normal mouse cursor movement, but as soon as a cursor mouse-over on a desktop icon occurs, the issue arises. Weirdly, when mousing over certain Panel icons, the problem goes away after the popup notification disappears. Sometimes the popup seems to shift slightly just before disappearing, and then kwin CPU usage drops to normal, until trying to do almost anything but moving the mouse in an empty area of the desktop makes it recur.

EDIT -nvidia515.65.01 FAILS for linux-lts kernel (5.10) as well -nvidia-510.47.03_1 WORKS for linux-lts (won't build dkms module for linux 5.19) This is helpful only because, while nvidia470 may still use EGL_streams?, I presume nvidia510 is using GBM, as is nvidia515.

furryfixer avatar Oct 30 '22 23:10 furryfixer

I'm also having this same issue. I did test Gnome-Wayland out of curiosity and the problem doesn't exist there. If there is any information I can provide to help get this fixed let me know and I'll gladly provide it.

EwolBash avatar Oct 31 '22 17:10 EwolBash

~~There is a workaround for now. Either of two environment variable settings may fix it:~~

~~__GL_MaxFramesAllowed=1~~ ~~__GL_YIELD=USLEEP~~

EDIT: Well, I am embarrassed to say that my "workarounds" do NOT work, because although I was using the latest nvidia drivers, I did not realize that I was running another (non-Void) partition at the time of these experiments, which worked with no modification. I regret the confusion. Still searching for clues in Void. At least my first post here still stands.

furryfixer avatar Nov 01 '22 10:11 furryfixer

After updates to qt5,nvidia,linux kernel,kwin, etc. failed to resolve this bug, I finally bypassed xbps, and manually downloaded and installed the nvidia 515.86.01 driver directly from nvidia. Plasma/Wayland now works perfectly for both kernels linux-lts (5.10) and linux 6.0.9_1. I would hope 1-2 others will confirm this.

I cannot find any reason why the Void build template creates this problem, but I can think of no other explanation. I suggest focusing on how the Void build/install process differs from nvidia's. It is exasperating that the bug only shows up in Plasma/Wayland, but not Gnome/Wayland.

furryfixer avatar Nov 23 '22 16:11 furryfixer

I have hopefully identified the problem. Others please confirm, and if so, create a PR to fix this if you like, since I will be unable for the next several days at least.

The file "15_nvidia_gbm.json" is misplaced. Void's template installs it in the "/usr/share/glvnd/egl_vendor.d/" directory. It should apparently be installed to the "/usr/share/egl/egl_external_platform.d/" directory. Plasma/Wayland becomes fully functional by doing:

sudo mv /usr/share/glvnd/egl_vendor.d/15_nvidia_gbm.json /usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json

A simple change to the vmove target for that file in the template should do it. I remain curious as to why Gnome was not obviously affected, since I thought I was forcing GBM through environment variables, but perhaps it was still using EGL streams on nvidia.

furryfixer avatar Nov 26 '22 02:11 furryfixer

Nice! I tested this fix and it worked for me. I created a pr.

cmhainesii avatar Nov 26 '22 14:11 cmhainesii

furryfixer's suggestion was merged in 4d9de55a669ae42a1612dfd2d363756ddfa4531d.

ghost avatar Nov 26 '22 18:11 ghost