crispyricepc / sway-nvidia

Helper files to make sway a better experience for us poor NVIDIA users.
https://aur.archlinux.org/packages/sway-nvidia
144 stars 5 forks source link

Add XWAYLAND_NO_GLAMOR=1 to wlroots env vars #11

Closed weebney closed 1 year ago

weebney commented 1 year ago

This is literally the only way I've been able to get Xwayland apps to work- after almost a full year of just avoiding the problem, unable to use a huge number of apps, this is all I needed; they work completely fine after disabling Glamor. I nearly shed a tear.

Glamor appears to be both semi-abandoned and completely useless on modern hardware. To prevent anyone else from suffering this same fate I have submitted this PR. This seems to be a common problem with Nvidia+Wayland, so if it belongs anywhere, I figure this project is the place.

What is Glamor? https://www.freedesktop.org/wiki/Software/Glamor/

Issues regarding Glamor/Xwayland https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317 https://gitlab.freedesktop.org/xorg/xserver/-/issues/1288

Blacksmoke16 commented 1 year ago

You are a saint my dude. This is a game changer!

crispyricepc commented 1 year ago

Just so I'm getting this straight, this does not disable 2D acceleration?

weebney commented 1 year ago

It shouldn't, because Nvidia's driver supports 2d & 3d acceleration in Xwayland. I would be fine doing a full x11perf to verify if you think that's necessary. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6429 https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587

crispyricepc commented 1 year ago

Looks like it works fine on my end

joshuamegnauth54 commented 11 months ago

Is this still needed? This issue suggests that a lot of programs work now with the latest comments.

I experienced extremely laggy games till I traced the issue down to XWAYLAND_NO_GLAMOR. I've since stopped disabling Glamor without really experiencing any problems yet.

I'm sure YMMV, but others who are experiencing performance issues may find this info useful.

hashworks commented 11 months ago

I just tested it. You are right, with XWAYLAND_NO_GLAMOR=1 games are laggy and gamescope doesn't work. But without it, Steam is completely unusable - it flickers and menus don't show up. However, it is perfectly fine to set XWAYLAND_NO_GLAMOR=0 for gamescope only, and it works just fine! Just add XWAYLAND_NO_GLAMOR=0 gamemoderun gamescope -W 2560 -H 1440 -f -- %command% to Steam games.

So I think this is still a good default, maybe add some README notes about this?

joshuamegnauth54 commented 11 months ago

Adding a note to the readme is a good idea. I've been messing with combinations of XWAYLAND_NO_GLAMOR a bit more today, and I've come to a similar conclusion. I'm launching my games with the same command too!