I am trying to get a Wayland session running with as few bugs as possible using the nvidia proprietary drivers (I am aware this is a tall order).
Things seem to be working mostly perfectly for me, with the exception of apps running in Xwayland.
In particular, these apps stutter / display previously rendered frames (particularly when typing). This is a known bug, and tracked at https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317.
For chromium apps, I have noticed that adding --use-gl=egl
as a command line argument nearly completely fixes this issue. However, not all Xwayland apps support this argument, so I cannot simply add it to everything that causes problems.
From the help page for Xwayland
, I learned about the option -eglstream
, which encourages Xwayland to "use eglstream backend for nvidia GPUs". This sounds like exactly what I want. My problem is that I have not found any way to pass the -eglstream
argument to the default Xwayland
instance used on the wayland session of Gnome.
Immediately after a fresh login, ps aux | grep Xwayland
shows that Xwayland
is not running yet.
If I then start an app that runs through Xwayland
, I see a process:
/usr/bin/Xwayland :1 -rootless -noreset -accessx -core -auth /run/user/1000/.mutter-Xwaylandauth.0GRD41 -listen 4 -listen 5 -displayfd 6 -initfd 7
The parent process ID points towards gnome-shell
, leading me to believe that this is what is responsible for auto-starting Xwayland
.
If I try to run my own Xwayland instance with the new arg, I get the following:
$ /usr/bin/Xwayland :1 -rootless -eglstream -noreset -accessx -core -auth /run/user/1000/.mutter-Xwaylandauth.0GRD41 -listen 4 -listen 5 -displayfd 6 -initfd 7
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
Failed to initialize glamor, falling back to sw
(EE)
Fatal server error:
(EE) Cannot write display number to fd 6
(EE)
Aborted (core dumped)
I get the same output whether I run the above command before Xwayland
has been autostarted (i.e. just after a fresh login, before running any apps) or after, with the other instance already running.
Is there a way to configure gnome-shell
to add the argument I want? Or perhaps to replace a running instance of Xwayland
?
Specs:
- Ubuntu 22.04.2
- NVIDIA RTX 3050 using the
nvidia-driver-530-open
drivers