Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flickering persists on Sway Atomic (sericea-nvidia) with 555 driver #260

Open
bonsairobo opened this issue Jul 2, 2024 · 8 comments
Open

Comments

@bonsairobo
Copy link

Symptoms

I've recently started using the sericea-nvidia image, and I experience frequent flickering in compositor redraw areas. Pretty much any window seems impacted.

System Info

~> nvidia-smi
Tue Jul  2 00:19:28 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.58                 Driver Version: 555.58         CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1080        Off |   00000000:01:00.0  On |                  N/A |
|  0%   46C    P8             13W /  200W |     579MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      4318      G   /usr/bin/sway                                 234MiB |
|    0   N/A  N/A      4537      G   Xwayland                                        2MiB |
|    0   N/A  N/A      5028      G   /usr/lib64/firefox/firefox                    273MiB |
+-----------------------------------------------------------------------------------------+
OS: Fedora Linux 40 (Sway Atomic) x86_64
Kernel: Linux 6.9.6-200.fc40.x86_64
Display (DEL41D9): 2560x1440 @ 165Hz
~> rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/sericea-nvidia:latest
                   Digest: sha256:42ddeea1941da8d977d98ebaae6608d104173b98844450f33a2fb66dd73ad7fa
                  Version: 40.20240702.0 (2024-07-02T03:43:25Z)

Speculation

When I've researched this issue, I notice many people mentioning the "explicit sync" issue in Nvidia drivers. I've also seen that the 555 driver is supposed to implement explicit sync and solve the flickering problem. It seems that this is not the case for me, so I am puzzled.

@m2Giles
Copy link
Member

m2Giles commented Jul 3, 2024

@gerblesh you use sway right? Any hints on this?

@bonsairobo
Copy link
Author

It might be a Sway bug. I've noticed the same issue exists on NixOS with Sway + Nvidia 555.58.

@bonsairobo
Copy link
Author

I discovered that setting WLR_RENDERER=vulkan solves the flickering in my terminal and browser. It didn't solve it for the Spotify app though. Perhaps has something to do with whether apps are running in Xwayland.

@gerblesh
Copy link

gerblesh commented Jul 4, 2024

Hi, sorry for being late to the party here. Yeah the vulkan renderer should get you better results, the flickering is likely the result of sway not currently supporting explicit sync, PR is here: swaywm/sway#8156. I believe both KDE and GNOME support explicit sync by default, and I've switched off of sway on my main nvidia desktop, only using it on my AMD framework. There's this project: https://github.com/crispyricepc/sway-nvidia that might help, be aware that by default it disables hardware acceleration for XWayland applications. I would recommend switching to KDE or GNOME until sway gets support unfortunately, unless you're ok with the flickering

@bonsairobo
Copy link
Author

recommend switching to KDE or GNOME until sway gets support unfortunately

At this point, the flickering is entirely gone for the software I use, as I've switched to just opening spotify and discord in firefox. The WLR_RENDERER=vulkan seems to have taken care of everything else, including e.g. steam and blender.

PR is here: swaywm/sway#8156

Well hopefully it gets merged soon. Not sure why there seems to be no activity in that PR.

@gerblesh
Copy link

gerblesh commented Jul 4, 2024

awesome! I'll start drafting up a PR to get the renderer switched to vulkan then, and yeah, sway development moves pretty slowly and it's largely made up of volunteers. I'll leave this issue open as you still needed to switch to firefox as a workaround but it's good to know everything is usable on your end now

gerblesh added a commit to ublue-os/akmods that referenced this issue Jul 6, 2024
Recently flickering on sericea-nvidia was reported in the HWE repo: ublue-os/hwe#260. A workaround or "fix" for a large amount of the flickering on sway is to switch to the vulkan renderer, the nvidia GPUs we support also support the vulkan required extensions and version.
I also added an environment variable that fixes some java applications: _JAVA_AWT_WM_NONREPARENTING=1
@zhjihuang
Copy link

zhjihuang commented Jul 13, 2024

I just want to chime in after the latest PR. WLR_RENDERER=vulkan seems to be causing flickering on my end, but I have a 3070. Rolling back to from before the variable is set solves it for me. I'm also on Sway Atomic.

@gerblesh
Copy link

uh oh, yeah I've had better luck with my 2070 in the vulkan renderer. Likely best to wait for explicit sync, things are so variable without it unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants