NVIDIA (495) on sway tutorial + questions (Arch-based distros)

@qumaciel Yes I have MOZ_WAYALND=1 set in my /etc/envornment and have gfx.webrender.all=true, layers.acceleration.force-enabled=true and frame-rate set to 144 Firefox confirmed running in wayland in about:support.

And yea on my 3080 with the aur nvidia drivers it auto detected both my monitors I just had to type output DP-3 position 2560,0 mode 1920x1080@144.001Hz. Both monitors on DP cable

Side not I am new to sway but I bound output DP disable and enable to turn off and on the second monitor from keyboard

Maybe should be noted, I am running on a desktop with outputs directly from graphics card

maybe I will try building wlroots and sway from source without the assertion

@user4109 @qumaciel I think I see what may contribute to a majority of the flickering. When testing out a game such as stardew valley at 144hz (game runs at 60Hz) there is mad artifacting and flickering, however, if the monitors refresh-rate is set to 60, no flickering at all. The issue might lead to the driver handling multiple windows at different refresh rates. Gsync and vrr support in the driver for wayland may help, but I am unsure. Let me know if you find a similar result, but if the game is locked to 60 there is no flickering, same on a game running at 144, it only flickers once the frame-rate does not match the monitors refresh rate.

To validate, run a game that you can run at a locked 60fps. With the refresh rate at 144hz, you should notice significant flickering. While the game is still running update your config to run at 120hz, half refresh rate, still flickering, again update and reload (mod+shift+c) at 60hz, all flickering in game is gone. Very interesting

1 Like

I think @0ojqr also had troubles with multiple monitors, but now I think this might be a hybrid setup issue.

@jrgiacone , what about mpv? Locking everything to 60Hz solved mpv issues?!

Now that we are all roughly at the same page here, It would be nice hearing some thoughts from NVIDIA (@nadeemm or @amrits ).

@qumaciel add --gpu-context=waylandvk for mpv, hella buggy but works. x11vk works for xwayland too

adding flags --hwdec=nvdec --gpu-context=x11vk (no artifacts)

Locking fps changes nothing in this case, seemed to work for steam games though

Also @sheepymeh that assertion fix was causing me issues, doing this works too:

diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c
index 31bb3908..0740d77c 100644
--- a/render/gles2/pixel_format.c
+++ b/render/gles2/pixel_format.c
@@ -108,10 +108,10 @@ bool is_gles2_pixel_format_supported(const struct wlr_gles2_renderer *renderer,
            && !renderer->exts.OES_texture_half_float_linear) {
        return false;
    }
-	if (format->gl_format == GL_BGRA_EXT
+	/*if (format->gl_format == GL_BGRA_EXT
            && !renderer->exts.EXT_read_format_bgra) {
        return false;
-	}
+	}*/
    return true;
}

However, even still I cannot launch games from steam with the sway-git and wlroots-git

Unable to get my external HDMI monitor working on an hybrid system too.
As soon as I have the nvidia driver loaded, the output is missing in sway.

I’d double check your setup, you should definitely get the output listed in sway with swaymsg -t get_outputs.

Already tried a lot of combinations (modesetting or not nvidia_drm, changing mkinitcpio, etc…).
As I am on an hybrid system I think there is something wrong with PRIME offloading and I guess the HDMI and DP ports are plugged on the i915 chip somehow. Got this behaviour on two machines, a HP Zbook and a XMG Fusion 15.

As Sway dev won’t support using nvidia closed proprietary drivers anytime soon even with GBM support and Nvidia not going to open their source either, I guess it will take quite some time to fix this…

@0ojqr did you get it working with an external monitor ?

I see, I think you have the exact opposite of my setup, as I have the output wired to the dGPU instead.
So far, I was able to get Sway to detect my monitor, but not enable it. I’m not going to investigate it much further though at this stage.
I have the feeling this is not something I can fix myself, but I’d need some feedback from nvidia at this point.

Yup I think that we have to wait their feedback or do as Sway devs advocate for “my next GPU won’t be nvidia”…

Thought I’d just share my experience with the beta driver, as I seem to have had more luck than others here

system is an R9 3900x + Titan X Pascal

these are my env variables from my launch script

export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export GDK_BACKEND=wayland
export XDG_CURRENT_DESKTOP=sway

export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export MOZ_ENABLE_WAYLAND=1
export WLR_NO_HARDWARE_CURSORS=1

current packages regarding wayland:

sway-git r6798.0c210a5e-1
wayland-git 1.19.0.r75.gd564823-1
nvidia-egl-wayland-tkg 495.29.05-183
wlroots-eglstreams-git 0.14.1.r5146.8073eb71-1
lib32-nvidia-utils-tkg 495.29.05-183
lib32-opencl-nvidia-tkg 495.29.05-183
nvidia-dkms-tkg 495.29.05-183
nvidia-settings-tkg 495.29.05-183
nvidia-utils-tkg 495.29.05-183
opencl-nvidia-tkg 495.29.05-183

sway command is sway --my-next-gpu-wont-be-nvidia

Most things have been working fine. VKCube works for me along with steam games. Have a multi monitor setup via 2 Displays Ports, one 1080@60hz and another 1080@144hz. Once setting then up to their proper settings they haven’t caused an issue. running obs by default results in the error:

error: eglChooseConfig failed
error: device_create (GL) failed
error: Failed to initialize video.  Your GPU may not be supported, or your graphics drivers may need to be updated.
Cannot find EGLConfig, returning null config
error: obs_display_init: Failed to create swap chain

If I run obs -platform xcb to force it through xwayland it starts, but trying to record any x11 window results in a crash with error libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

I have played about 10 hours of rocket league through proton without an issue, and some battlefield 4 through origin via lutris, also working well

I also seem to be having an issue with firefox and a memory leak, it will quite often take up about 12gb’s and causes massive slowdowns once it starts hitting the swap file. video playback has been fine but as it isn’t hardware accelerated I don’t see that it would be an issue anyway. If anyone has any more questions or wants any logs I’m happy to provide

The wlroots-eglstreams fork of wlroots works quite well on NVIDIA hardware, but does not use GBM, which is what we are talking about here. GBM is the industry standard that should replace EGLStreams.

whoops, sorry about that. yes just tried the wlroots-git package and can confirm i’m getting the ARGB8888 and XRGB8888 error.

@Bumbizzled look at my assertion above to comment out lines in wlroots when building from source! will get you in!

@qumaciel I am going to try and mess with this later :[ANNOUNCE] xwayland 21.1.2.901

@qumaciel 495 stable released today, wonder if it has any fixes

Nice, @jrgiacone , let us start testing again!

The README looks pretty much the same, as far as I could see.
From the 495.44 release notes, it seams we have lots of fixes.

Nothing mentioning ARGB8888 and XRGB8888 formats, though.

It is sad that we are all here willing to provide quality feedback, but we’ve got not even a single response from NVIDIA.

ARGB still fails, and opengl and chrome are still just as buggy. Mainly when in fullscreen though.

Major note, when running stardew valley (open gl) and valheim (vulkan) in windowed mode there was no flickering.

It appears in fullscreen the flickering occurs, maybe something is going on with the compositor during fullscreen causing the issues

Still no luck with external monitor on hybrid laptop

I’ve upgraded to 495.44, it runs a bit smoother, although it still has OpenGL flickering. OBS crashes upon initialization with eglChooseConfig error aka EGL_NATIVE_RENDERABLE missing.

Any luck with mpv or hardware cursor @jrgiacone @0ojqr @mikhail.krassavin ?

For me, it is also running smoother in windowed mode, still flickering when in fullscreen though.

@qumaciel

mpv --hwdec=nvdec --gpu-context=x11vk

@qumaciel @jrgiacone

the config below works great for me, nv12 is reported in the mpv’s output, I’ve also tried gpu-context=waylandvk, and it was as bad as before

profile=gpu-hq
gpu-api=vulkan
gpu-context=wayland
spirv-compiler=shaderc
hwdec=nvdec-copy