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.88k stars 911 forks source link

Dropped frames in fullscreen games with high GPU usage (NixOS) #8393

Open Pyrolyzed opened 2 weeks ago

Pyrolyzed commented 2 weeks ago

Already reported ? *

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch v0.44.1-b at commit 4520b30d498daca8079365bdb909a8dea38e8d55 (version: bump to 0.44.1). Date: 2024-10-09 Tag: v0.44.1, commits: 4520b30d498daca8079365bdb909a8dea38e8d55 built against aquamarine 0.4.3 flags: (if any) System Information: System name: Linux Node name: overlord Release: 6.11.5-zen1 Version: #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 GPU information: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c5) (prog-if 00 [VGA controller]) os-release: ANSI_COLOR="1;34" BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" BUILD_ID="24.11.20241029.807e915" DOCUMENTATION_URL="https://nixos.org/learn.html" HOME_URL="https://nixos.org/" ID=nixos IMAGE_ID="" IMAGE_VERSION="" LOGO="nix-snowflake" NAME=NixOS PRETTY_NAME="NixOS 24.11 (Vicuna)" SUPPORT_URL="https://nixos.org/community.html" VERSION="24.11 (Vicuna)" VERSION_CODENAME=vicuna VERSION_ID="24.11" plugins: ======Config-Start====== Config File: /home/pyro/.config/hypr/hyprland.conf: Read Succeeded # Monitor and hardware configuration source = ~/.config/hypr/hardware.conf # Keybinding configuration source = ~/.config/hypr/keybindings.conf # Autostart programs exec-once = copyq --start-server & dunst env = QT_QPA_PLATFORM,wayland debug { disable_logs = false } general { gaps_in = 10 gaps_out = 15 border_size = 3 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) resize_on_border = false allow_tearing = true layout = dwindle } decoration { rounding = 10 blur { enabled = true size = 3 passes = 2 vibrancy = 0.1696 } } animations { enabled = true bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } dwindle { pseudotile = true preserve_split = true } windowrulev2 = suppressevent maximize, class:.* Config File: /home/pyro/.config/hypr/hardware.conf: Read Succeeded monitor=DP-3,3840x2160@240,0x0,1.25 # Fix blurry XWayland apps xwayland { force_zero_scaling = true } Config File: /home/pyro/.config/hypr/keybindings.conf: Read Succeeded $terminal = kitty $menu = rofi -show drun $browser = firefox $chat = vesktop --enable-features=UseOzonePlatform --ozone-platform=wayland $mainMod = SUPER bind = $mainMod SHIFT, S, exec, grim -g "$(slurp -d)" - | wl-copy bind = $mainMod, F, exec, $browser bind = $mainMod, Q, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod, X, fullscreen bind = $mainMod, D, exec, $chat # Move focus with mainMod + arrow keys bind = $mainMod, h, movefocus, l bind = $mainMod, l, movefocus, r bind = $mainMod, k, movefocus, u bind = $mainMod, j, movefocus, d # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Resize active windows with arrow keys bind = $mainMod SHIFT, l, resizeactive, 10 0 bind = $mainMod SHIFT, h, resizeactive, -10 0 bind = $mainMod SHIFT, k, resizeactive, 0 -10 bind = $mainMod SHIFT, j, resizeactive, 0 10 ======Config-End======== ```

Description

When in games that have high GPU usage (~95%+), games appear unbearably laggy even though they report a steady FPS and frametimes. This issue does not occur in other desktop environments or window managers. VRR, in-game VSync, and fullscreen or not, this issue occurs. If the game doesn't have high GPU usage, this issue doesn't occur.

And while I marked this as a regression, since the universe hates me, any time I try to log into a older version of hyprland to bisect, it crashes instantly with cryptic errors. However, to explain why this is a regression, It was working just fine with a similar config and the same computer a few months ago (late august of this year). I'm currently trying to get hyprland to work with older versions to find what commit broke it.

Here is a list of things I've tried to fix the issue: Enabling/Disabling VRR Enabling/Disabling in-game Vsync Fullscreen or windowed mode Different kernel versions Using AMDVLK

The issue does not occur on KDE (Wayland and X11 versions), and does not occur in GameScope in Hyprland.

I also think it might be worthwhile to mention that I found a thread of a similar issue someone had on Linux Mint with the cinnamon desktop, also using a AMD card. Their proposed fixes didn't work, but it's strange that they had the exact same issue: https://forums.linuxmint.com/viewtopic.php?t=409548

How to reproduce

Here is my NixOS configuration file that reproduces the issue for me: https://github.com/Pyrolyzed/pyrotechnix

My GPU is a AMD 6700XT.

Crash reports, logs, images, videos

I would put a video here, but it's too big, so I uploaded a video of the issue to YouTube: https://youtu.be/MbYqTnjkuPU

UjinT34 commented 2 weeks ago

Try cursor:no_hardware_cursors = 1 and/or render:explicit_sync = 0

Pyrolyzed commented 2 weeks ago

render:explicit_sync = 0 appears to fix the issue, but causes a sort of jitter if games aren't fullscreen. While this fixes the issue for now, it doesn't seem to fix the actual regression, does it? Thank you though! Now I can actually use Hyprland!

Edit: Upon further use, quite a few games are unplayable without explicit sync, they get horrible "jitters" whether fullscreen or not.

Pyrolyzed commented 2 weeks ago

Yeah, sadly the expedition into getting NixOS to build a working (old) version of Hyprland so I can find the regression via bisecting is proving to be a major pain in the ass.

Hopefully someone else can manage to find where the regression is. Right now all I know is it pretty much has to be after august...

Disabling explicit sync is a "fix", but it produces another graphical issue that is just as bad as having it enabled.

Pyrolyzed commented 2 weeks ago

Hmmm, upon further inspection it appears this might be a duplicate of #7643 . Not 100% sure though.

Edit: I definitely did not accidentally hit the close button. That didn't happen.

Pyrolyzed commented 1 week ago

Still looking for a fix to Hyprland crashing when I try older commits so I can successfully bisect, but adding some things here: I found this reddit thread that describes what seems to be the same issue, on KDE and with an AMD gpu as well. Strange that it happens on KDE for them but not for me, and happens on Hyprland for me.

Not sure how much can be done until I can successfully bisect. If anyone wants to help getting older Hyprland commits running just message me on Discord (pyrolyzed).

UjinT34 commented 1 week ago

Older HL versions might crash if they are compiled with incompatible AQ versions. wlroots based versions will not work with WLR_RENDERER=vulkan (and maybe other WLR_ stuff which is ignored in recent versions) Try allow_tearing = false

Pyrolyzed commented 6 days ago

I genuinely don't know how but the issue seems to have resolved itself? Strange. I genuinely didn't do anything and it just works now.

Pyrolyzed commented 5 days ago

Well, what the actual. It's started happening again. I didn't even change anything.

Pyrolyzed commented 5 days ago

I don't think the issue ever went away actually, I think for some reason it just didn't happen. I've made a new development though, it only happens in fullscreen games, when Red Dead 2 is fullscreen, it drops frames and is basically unplayable, but when I take it out of fullscreen with my keybind it runs super smooth. Windowed fullscreen works as well. Just not exclusive fullscreen