NVIDIA / open-gpu-kernel-modules

NVIDIA Linux open GPU kernel module source
Other
15.05k stars 1.25k forks source link

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

Open ghost opened 2 years ago

ghost commented 2 years ago

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.

niv commented 2 years ago

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

uamind commented 2 years ago

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

whoamimrrobotew commented 2 years ago

+1

rsmunix commented 2 years ago

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 commented 2 years ago

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

😟

ghost commented 2 years ago

@rsmunix Unfortunately, yes.

ghost commented 2 years ago

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
critkitten commented 2 years ago

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.

Aero-fish commented 1 year ago

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.

MahouShoujoMivutilde commented 1 year ago

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.

ghost commented 1 year ago

525.53, the problem still remains.

Crystal4276 commented 1 year ago

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 ?

MahouShoujoMivutilde commented 1 year ago

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.

Crystal4276 commented 1 year ago

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

ghost commented 1 year ago

@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 commented 1 year ago

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

Fxzzi commented 1 year ago

Same issues described here

GrabbenD commented 1 year ago

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

oifj34f34f commented 1 year ago

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

Crystal4276 commented 11 months ago

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...

GrabbenD commented 11 months ago

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

oifj34f34f commented 9 months ago

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 :-)

Sivecano commented 8 months ago

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

foxjaw commented 8 months ago

I have the same gpu as author (GTX 1660S). No flicker issues for me. But cursor visibility issue still there though.
System: archlinux (early KMS loaded) Packages: sway-git, nvidia Followed installation from here.

Crystal4276 commented 8 months ago

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 ?

foxjaw commented 8 months ago

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.

Crystal4276 commented 8 months ago

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.

oifj34f34f commented 8 months ago

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

foxjaw commented 8 months ago

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

oifj34f34f commented 8 months ago

@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

foxjaw commented 8 months ago

What about video playback in browser (also in mpv) ? Last time I've tried vulkan playback & it was fine.

oifj34f34f commented 8 months ago

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

AFAIK, NVDEC still only works with proprietary drivers

foxjaw commented 8 months ago

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

AFAIK, NVDEC still only works with proprietary drivers

I mean't vulkan playback btw.

oifj34f34f commented 8 months ago

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

AFAIK, NVDEC still only works with proprietary drivers

I mean't vulkan playback btw.

Ah, haven't tried it yet. But thanks for the link

foxjaw commented 8 months ago

Forget btw. The documentation says prop ones needed (Drivers >= 535.xx).
Nouveau Feature Matrix Reference charts.

foxjaw commented 8 months ago

On archlinux, sway-git uses master branch of wlroots-git, meanwhile sway uses wlroots0.16.
Literally, every wayland compositor on arch repository seems to use 0.16 branch. Not sure why.

As far as my noob observations go, flickering exists with wlroots0.16 on certain applications that use opengl backend, such as all chrome based browsers, gpu accelerated terminals like alacritty, kitty, etc. But not on the latest master branch at all.
You can solve this by early KMS loading the nvidia drivers (just follow the archwiki guide) & it'll solve flickers on gpu accelerated terminals. But still won't fix chromium based browsers. Here, if you're a firefox user, just don't bother about it at all. Caz it doesn't have any sort of flickers. I think it's wayland ozone layer backend on chrome which is buggy.

You actually don't need WLR_RENDERER=vulkan via vulkan-validation-layers btw. mesa works fine too.

PS

Also, drm modesetting via modprobe is not recommended. Please use kernel boot parameters.
https://github.com/korvahannu/arch-nvidia-drivers-installation-guide/issues/14

TL;DR

If you're on arch: