hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.89k stars 911 forks source link

Various issues since the AQ merge #7205

Closed flippette closed 3 months ago

flippette commented 3 months ago

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit b0a70f63e3865eaa77f0b78a04b230aa583bc95c (wayland/compositor: drop pending buffer ref if synchronous). Date: Tue Aug 6 22:08:22 2024 Tag: v0.41.2-169-gb0a70f63, commits: 5055 flags: (if any) System Information: System name: Linux Node name: oyasumi Release: 6.10.2-zen1-2-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Sat, 03 Aug 2024 18:22:59 +0000 GPU information: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 32 [Radeon RX 7700 XT / 7800 XT] [1002:747e] (rev c8) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```

Description

Ever since the AQ merge, I've been experiencing a couple of issues related to render:explicit_sync and render:direct_scanout (since they were still experimental:explicit_sync and misc:no_direct_scanout, yes)

My config now has this:

render {
  explicit_sync = 1
  explicit_sync_kms = 1
  direct_scanout = true
}
  1. vkcube-wayland --present_mode 0 window immediately closes, process still runs.
  2. mangohud vkcube-wayland in fullscreen has corruption artifact at the top of the mangohud UI.
  3. vkcube (the X11 version) just freezes on launch.
  4. ADOFAI freezes if I switch workspaces.
  5. Elden Ring doesn't launch.
  6. Several games' framerate locked at 144fps, but works properly the moment I move my mouse (I can confirm this happening with at least CS2 and Doom Eternal).
  7. Insane mangohud UI flickering when framerate goes beyond monitor refresh rate.
  8. Some games launch fine, but freeze in fullscreen when I switch workspaces (not (4), ADOFAI freezes whether it is in fullscreen or not)

glxgears and glxgears -swapinterval 0 still work, but the background is black so I don't know how to confirm it doesn't have the corruption artifact of (2).

I've attached a video of the corruption seen in (2).

https://github.com/user-attachments/assets/a9608397-a026-4267-a40c-dcc7402d47f6

How to reproduce

All of this started happening since the AQ merge, so just run an AQ build. I guess.

Crash reports, logs, images, videos

No response

zjeffer commented 3 months ago

Your video upload didn't work: image

flippette commented 3 months ago

@zjeffer I've updated the comment with the video.

vaxerski commented 3 months ago

1 is a problem with vkcube using a legacy mesa protocol for dmabuf 2 is a problem with direct scanout, it's disabled by default for a reason 3 doesnt for me? 4 disable ds 5 dunno 6 disable tearing or update aq 7 see 4 8 see 4

ikalco commented 3 months ago

1 and 3 are actually due to explicit sync, disabling it and restarting fixes both

btw 3 looks like xwayland not rendering frames, window only renders when resizing and when mapped

Donty10 commented 3 months ago

I am also experiencing 3 and it only unfreezes upon resizing the window. If I move the window, it freezes again. I also experience the stuttering that was supposed to be fixed with https://github.com/hyprwm/Hyprland/pull/7151. Both of these This started after https://github.com/hyprwm/Hyprland/commit/158bbaaf88764e2a1e19ca1e3a11af541374432e on the explicit-sync branch and for me is still present on main.

Should mention - I'm using an AMD gpu

romanstingler commented 3 months ago

fudge, how does you mangohud even work. It worked for me on some OpenGL game, but crashes on vkcube and vulkan games. What version do you have?

vaxerski commented 3 months ago

I am also experiencing 3 and it only unfreezes upon resizing the window. If I move the window, it freezes again. I also experience the stuttering that was supposed to be fixed with https://github.com/hyprwm/Hyprland/pull/7151. Both of these started after https://github.com/hyprwm/Hyprland/commit/158bbaaf88764e2a1e19ca1e3a11af541374432e on the explicit-sync branch and for me are still present on main.

only time I had that was when I disabled DS while there was a fullscreen game on.

enabling it, unfullscreening the game, and disabling it would not trigger the bug

Donty10 commented 3 months ago

Turns out the stuttering I was having in programs was related to tearing. When a program is tearing prior to https://github.com/hyprwm/Hyprland/commit/158bbaaf88764e2a1e19ca1e3a11af541374432e there would be no stuttering, however after this commit any program that is tearing stutters.

flippette commented 3 months ago

I'd like to add that whenever (3) happened, I could not move, or close the window at all. On some occasions it would even corrupt the entire screen, at which point everything just starts flickering wildly.

flippette commented 3 months ago

I've updated my hyprland-git install to commit fa6ee513678e6e1cfdc575a421c1e0ddf4608994, and setting my config to this:

render {
  explicit_sync = 0
  explicit_sync_kms = 0
  direct_scanout = false
}

Retesting with this config gives these results:

  1. vkcube-wayland --present_mode 0 now works, but switching from windowed to fullscreen sees the framerate go from ~11kfps to ~212fps, with a very thick frametime graph:

212

If I trigger grimblast while still in fullscreen mode, it goes back up to 11kfps as it should (notice the crosshair cursor here):

11k_grimblast

  1. mangohud vkcube-wayland --present_mode 0 no longer has a corrupted UI in fullscreen, regardless of the framerates described in (1).
  2. vkcube now works, but vkcube --present_mode 0 also exhibits the issue described in (1), except that in fullscreen it goes to 144fps, with a normal looking frametime graph.

x11_fullscreen

  1. Doesn't happen anymore, but I've observed the following behavior:

If I set AQ_NO_ATOMIC=1 and render:direct_scanout = true, both ADOFAI and vkcube exhibits extreme buffer corruption whenever VSync is not enabled. (Specifically VSync, capping ADOFAI at my monitor's frame rate still exhibits buffer corruption.)

Now that I don't set AQ_NO_ATOMIC and having render:direct_scanout = false, they don't do that anymore, but ADOFAI is very stuttery, just like CS2 described below.

  1. Elden Ring launches now.
  2. Doesn't happen anymore only in CS2. Doom Eternal still exhibits the same behavior.
  3. Greatly reduced in CS2, but it stutters a lot, like the frames are being presented out of order. Doom Eternal acts just like vkcube-wayland --present_mode 0, except the mangohud UI flickers unlike vkcube-wayland.
  4. Doesn't happen anymore.
vaxerski commented 3 months ago

please don't use AQ_NO_ATOMIC

I see you have an AMD card but are on 6.10.2-zen1-2-zen. 6.10 kernel has a lot of amdgpu regressions. What you are seeing is likely that (wrt. performance)

Downgrade to 6.9.10 and you should be able to safely turn on explicit sync again with no issues (ds will glitch in explicit)

flippette commented 3 months ago

I rolled back to kernel 6.9.10-zen1-1-zen and set my config to this:

render {
  explicit_sync = 1
  explicit_sync_kms = 1
  direct_scanout = false
}

Testing now shows:

  1. vkcube-wayland --present_mode 0 window again immediately closes.
  2. Doesn't occur, I assume due to render:direct_scanout being disabled now.
  3. vkcube still freezes on launch. When I resize the window, it stars rendering, but fullscreening freezes it again.
  4. ADOFAI doesn't seem to freeze on workspace change anymore, but immediately freezes when resized while fullscreen.
  5. Elden Ring no longer launches.
  6. Still happens, at least in CS2.
  7. Still happens, at least in CS2.
  8. Doesn't seem to happen anymore.

I guess it's actually explicit sync's fault?

vaxerski commented 3 months ago

update

flippette commented 3 months ago

I updated Hyprland to commit f36c625e37f8913d8da38365a4783948f2217f02 (compositor: minor cleanups for fading out layers) and everything is still the same compared to my 6.9.10-zen1-1-zen comment. I'll try building from git next.

vaxerski commented 3 months ago

that's far from the latest git. That's 4 hours old.

flippette commented 3 months ago

I built Hyprland from git commit ea728315410e220d73a993f17c83ae9dc9be9015 (wayland/compositor: introduce client commit events).

Testing:

  1. vkcube-wayland --present_mode 0 still immediately closes.
  2. mangohud vkcube-wayland UI still has no corruption.
  3. vkcube doesn't freeze anymore. 3.1. mangohud vkcube --present_mode 0 still exhibit the same framerate capping as this comment, but with render:explicit_sync{_kms} = 1 this time
  4. ADOFAI works flawlessly now.
  5. Elden Ring also works flawlessly.
  6. No longer happens.
  7. Zero flickering now.
  8. No longer happens.

I'll see if 6.10 works now.

flippette commented 3 months ago

Kernel 6.10.3-zen1-1-zen seems to work just fine with Hyprland commit ea728315410e220d73a993f17c83ae9dc9be9015 (wayland/compositor: introduce client commit events), except for (1) and (3.1), which also happened with 6.9.10-zen1-1-zen.

My config as of now:

render {
  explicit_sync = 1
  explicit_sync_kms = 1
  direct_scanout = false
}
vaxerski commented 3 months ago

1 and 3.1 seem pretty minor though :)

flippette commented 3 months ago

Should I go ahead and close the issue then?

vaxerski commented 3 months ago

yeah prolly

flippette commented 3 months ago

Just wanted to chime in, (1) now works with render:explicit_sync{_kms} = 1 as long as render:direct_scanout = false on my system.