amshafer / nvidia-driver

Fork of the Nvidia FreeBSD driver to port the nvidia-drm.ko module from Linux
44 stars 5 forks source link

Screen glitches in sway on 13.1-STABLE #6

Closed iron-udjin closed 1 year ago

iron-udjin commented 1 year ago

Just tested both branches: 525.53-beta and 525.60.11 with sway. With both versions I experience screen glitches. Here is videos: 525.60.11: https://youtu.be/s5oFoiqOB2g 525.53-beta: https://youtu.be/33-Wn99_TV4

OS: FreeBSD 13.1-STABLE Hardware: NVIDIA GeForce 2080Ti

amshafer commented 1 year ago

This isn't happening on a laptop by chance is it? I assume this is a single-monitor setup? Any other details I should know while trying to reproduce it myself?

This also makes me realize that https://reviews.freebsd.org/D37611 hasn't been backported to 13.1-STABLE, and it needs to be. That should be unrelated to this though.

iron-udjin commented 1 year ago

This is desktop PC and yes, single-monitor.

Should I try to apply patch from the review and test again?

iron-udjin commented 1 year ago

Here is some sway console errors. Possibly could be useful.

00:00:00.008 [wlr] [EGL] command: eglQueryDmaBufModifiersEXT, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In eglQueryDmaBufModifiersEXT: Invalid
 format"
00:00:00.008 [wlr] [render/egl.c:841] Failed to query dmabuf number of modifiers
00:00:00.008 [wlr] [EGL] command: eglQueryDmaBufModifiersEXT, error: EGL_BAD_PARAMETER (0x300c), message: "EGL_BAD_PARAMETER error: In eglQueryDmaBufModifiersEXT: Invalid format"
00:00:00.008 [wlr] [render/egl.c:841] Failed to query dmabuf number of modifiers
2022-12-29 04:06:53 - [main.c:294] Found config * for output DP-3 (Acer Technologies XB271HU #ASOl17fR0Mfd)
amshafer commented 1 year ago

Should I try to apply patch from the review and test again?

No, that patch is for PRIME setups, which is why I was asking about if the machine was a laptop. it shouldn't affect you.

I'll look into reproducing but in the meantime you can try a couple workarounds that are common on Linux:

amshafer commented 1 year ago

Also, can you please run sway with the -d flag and post the full debug output?

amshafer commented 1 year ago

Noting that this does not reproduce on CURRENT, I guess I will actually have to set up a 13.1 install

iron-udjin commented 1 year ago

I have another issue but I'm not sure that it depends on nvidia renderer: In sway config I have: input * xkb_rules evdev but when I start sway I don't see mouse pointer. The same configuration on Intel UHD Graphics 630 works fine. Is it could be related to nvidia-drm?

amshafer commented 1 year ago

Oh yea, you need the WLR_NO_HARDWARE_CURSORS=1 env var.

Interesting that you need that patch, could you please add the debug output from sway startup so I can see what it's doing? You don't happen to have i915kms.ko or another DRM driver loaded do you?

iron-udjin commented 1 year ago

WLR_NO_HARDWARE_CURSORS=1 did a trick. Coursor show up. No, I don't have i915kms.ko loaded. Attached sway debug log. sway.log

iron-udjin commented 1 year ago

Possibly one more related to nvidia-drm issue when I try to use libva VDPAU driver: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268657 Under X11 this VDPAU driver works fine. Does this driver query nvidia-drm module? If yes, then I need to mention it in the bug report.

amshafer commented 1 year ago

Rather annoyingly after I set up my machine as 13.1-STABLE I still can't reproduce this. Tried with both displayport and hdmi, firefox hw acceleration on and off. Single and dual monitor. How are you launching sway? It's also very odd that that patch fixes it for you but the Vulkan renderer does not.

I'm not sure about the VDPAU thing, I'm not sure if that uses DRM off the top of my head. It's probably worth mentioning to them just because this is still beta quality and they should be aware it's in the mix.

iron-udjin commented 1 year ago

I recompilled sway without patch and tested again with vulkan renderer and didn't hit glitches which I had before. Possibly problem was in my buggy video card firmware or somewhere else. Ok, we can close this issue as resolved.

Is there any chance to see nvidia-drm.ko in the official nvidia drivers? In my opinion, this module is stable enough for public testing.

P.S: please make a port for this driver. P.P.S: thanks for your work! Looking forward this module to be a part of official driver.

amshafer commented 1 year ago

So just to be clear the vulkan renderer works without flickering? I'm marking this as closed (since there are two valid workarounds and there are similar flickering reports on linux) but I'll keep an eye out to try to reproduce this. Feel free to respond with more details or open new issues if more problems pop up.

Currently having nvidia-drm.ko in the Nvidia drivers isn't planned, a port is absolutely going to be the next step. Right now I'm focused on stabilizing things and making sure it works on everyone's hardware, so thanks to you (and anyone else reading this) for bravely giving it a spin and helping polish it up!

iron-udjin commented 1 year ago

Yes, let's close it. I'll reopen existing or create a new one issue in case of having the same glitches.