open-gpu-kernel-modules icon indicating copy to clipboard operation
open-gpu-kernel-modules copied to clipboard

wlroots based compositors (including sway) does not work well with NVIDIA

Open ghost opened this issue 3 years ago • 28 comments

NVIDIA Open GPU Kernel Modules Version

525.53

Does this happen with the proprietary driver (of the same version) as well?

Yes

Operating System and Version

Arch Linux

Kernel Release

6.0.8

Hardware: GPU

NVIDIA GeForce GTX 1660 SUPER

Describe the bug

Invisible cursor and flickering in wlroots based compositors.

To Reproduce

Install sway with the latest NVIDIA drivers and run cat /dev/urandom in the terminal to see the artifacts. Also the cursor is invisible.

ghost avatar Jul 05 '22 06:07 ghost

Thank you for the bug report. Tracking internally in bug 3707157.

niv avatar Jul 06 '22 09:07 niv

Me too,my arch upgrade 515.57 vulkan isn't working

uamind avatar Jul 11 '22 23:07 uamind

+1

whoamimrrobotew avatar Jul 13 '22 10:07 whoamimrrobotew

Usage [Linux: OpenSuse Tumbleweed] After updating the NVIDIA open source driver to version 515.57, I immediately had a frozen black screen issue during boot (see illustrative image in the link: https://i0.wp.com/windows11tools.com/wp-content/uploads/2022/01/image-17.png?resize=640%2C254&ssl=1). I even reinstalled Open Suse Tumbleweed, but that didn't help. This is strange, because on 515.48.07 everything worked perfectly.

Hardware GPU: NVIDIA GeForce GTX 1660 SUPER

rsmunix avatar Jul 20 '22 17:07 rsmunix

driver 515.65.01 I haven't tested it yet. Did it really not work for you?

😟

rsmunix avatar Aug 04 '22 02:08 rsmunix

@rsmunix Unfortunately, yes.

ghost avatar Aug 04 '22 07:08 ghost

The flicker seems to disappear when you run the git version of sway with WLR_RENDERER=vulkan. Please fix it. UPDATE: Cursor sometimes freezes with WLR_RENDERER=vulkan UPDATE2: grim is not working:

failed to copy output HDMI-A-1

ghost avatar Sep 05 '22 18:09 ghost

The flicker seems to disappear when you run the git version of sway with WLR_RENDERER=vulkan. Please fix it. UPDATE: Cursor sometimes freezes with WLR_RENDERER=vulkan UPDATE2: grim is not working:

failed to copy output HDMI-A-1

the grim thing is wlroots/vulkan issue https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3290 same with amdgpu if sway use vulkan renderer.

critkitten avatar Sep 15 '22 17:09 critkitten

I found a temporary solution from the hyprland wiki https://wiki.hyprland.org/Nvidia/.

I am now able to run sway with opengl without flicker. I.e., without WLR_RENDERER=vulkan

I am using Arch linux and has a 3080. I cloned wlroots-git from AUR, added a line in build, and then build the package :

build () {
        sed -E -i "s/glFlush/glFinish/" "$srcdir"/wlroots-git/render/gles2/renderer.c
	_meson_setup "${_builddir}"
	meson compile -C "${_builddir}"
}

The code replaces glFlush with glFinish in render/gles2/renderer.c before building. Finally install the package.

It is a hack, but it works so far. Hopefully it gets officially fixed in wlroot soon.

Aero-fish avatar Oct 17 '22 12:10 Aero-fish

Hopefully it gets officially fixed in wlroot soon

It probably won't - here is rejected PR with the same change from mid-august:

Well, as you explained this introduces a blocking call which waits for GPU operations to complete. This is very much a performance regression. There is no reason why this should be necessary, glFlush introduces a synchronization barrier, which is supposed to be waited on by the buffer consumer via implicit synchronization. NACK, sorry, this is a NVIDIA bug.

MahouShoujoMivutilde avatar Oct 17 '22 12:10 MahouShoujoMivutilde

525.53, the problem still remains.

ghost avatar Nov 12 '22 18:11 ghost

525.53, the problem still remains.

Hello, @niv I was wondering if this bug 3707157 is very far at the bottom of NVIDIA priorities, or if there are some investigations already on-going ?

Crystal4276 avatar Nov 20 '22 12:11 Crystal4276

I am on https://github.com/hyprwm/Hyprland/commit/e8b99ae13a0525f9fbd6899fe39fe723879f86b9 (wlroots based compositor, closely follows wlroots git version), and I had random flickering when running without the above mentioned wlroots patch, but since 525.60.11 of proprietary driver I don't need the patch anymore - it works flawlessly even without it.

Can't test on opensource driver (old gpu), but since the readme says

This code base is shared with NVIDIA's proprietary drivers

I thought it might be relevant.

EDIT

I forgot to mention, I run Hyprland with

export WLR_NO_HARDWARE_CURSORS=1

before launch, since its wiki says so.

Without this env variable set there is still no cursor displayed.

MahouShoujoMivutilde avatar Dec 12 '22 23:12 MahouShoujoMivutilde

I am on 525.60.11 with an RTX 2080, the mouse cursor is still disappearing upon opening an app.

Crystal4276 avatar Dec 13 '22 06:12 Crystal4276

@MahouShoujoMivutilde, the flickering has indeed disappeared with wlroots-git (even when using an open source driver), but the mouse cursor is still invisible. Thanks for the report!

ghost avatar Dec 13 '22 13:12 ghost

Same problems with Qtile + Wayland + nVidia 3070Ti. Flickering and no mouse cursor. ( nVidia 525.78.01-2 on Arch Linux )

ghost avatar Jan 12 '23 11:01 ghost

Same issues described here

fxzzi avatar Feb 01 '23 22:02 fxzzi

Nvidia needs to add support for missing GBM protocols to resolve performance issues and adress missing features like 10bit support with wlroots based compositors such as Sway, Hyprland and so on.

I've been using NVIDIA for ages but I'm starting to consider if AMD could be a better choice to get proper hardware acceleration in Wayland since I'm tired of using Windows and Linux is just perfect for work

GrabbenD avatar Mar 23 '23 10:03 GrabbenD

This bug is still not fixed, after almost 1 year. Hopefully nouveau will get GSP firmware support this year...

oifj34f34f avatar Jun 02 '23 15:06 oifj34f34f

This bug is still not fixed, after almost 1 year. Hopefully nouveau will get GSP firmware support this year...

Yep, at this point i'm also considering Nouveau...

Crystal4276 avatar Oct 16 '23 04:10 Crystal4276

Yep, at this point i'm also considering Nouveau...

Here's a better solution

$ glxinfo -B | grep Device
Device: AMD Radeon RX 6800 XT (navi21, LLVM 16.0.6, DRM 3.54, 6.5.7-2-cachyos-lto) (0x73bf)

Bye bye my old RTX 3080 Ti

GrabbenD avatar Oct 23 '23 17:10 GrabbenD

I just switched to using Nouveau driver. Hopefully its performance will improve with the latest news.

UPD: https://www.phoronix.com/news/Nouveau-NVK-One-Win :-)

oifj34f34f avatar Dec 09 '23 14:12 oifj34f34f

stuff's still not working. at this point I'm literally just telling people to stay away from nvidia GPUs....

Sivecano avatar Jan 07 '24 01:01 Sivecano

I just switched to using Nouveau driver. Hopefully its performance will improve with the latest news.

UPD: https://www.phoronix.com/news/Nouveau-NVK-One-Win :-)

Could you test it ? Does it fix the issue with wlroots ?

Crystal4276 avatar Jan 10 '24 09:01 Crystal4276

The problem with nouveau is the lack of hardware acceleration on new cards. I tried it last week, but couldn't retain due to high cpu loads.

you need to install kernel 6.7 when available.

Crystal4276 avatar Jan 10 '24 09:01 Crystal4276

you need to install kernel 6.7 when available.

And if you are using Turing or Ampere, add nouveau.config=NvGspRm=1 to /etc/default/grub (don't forget to run grub-mkconfig -o /boot/grub/grub.cfg) https://nouveau.freedesktop.org/PowerManagement.html

oifj34f34f avatar Jan 10 '24 09:01 oifj34f34f

@Crystal4276 I think it's mainline now. @oifj34f34f You tried it ? How's the performance ?

Well, I haven't tested any games except GZDoom so I can't say anything. However, performance has improved a bit (e.g. in the browser), so there is an improvement

oifj34f34f avatar Jan 10 '24 10:01 oifj34f34f

What about video playback in browser (also in mpv) ?

AFAIK, NVDEC still only works with proprietary drivers

oifj34f34f avatar Jan 10 '24 10:01 oifj34f34f