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
19.71k stars 837 forks source link

Random flickering/artifacting when opengl introspection is not needed #3962

Closed brettalcox closed 9 months ago

brettalcox commented 9 months ago

Hyprland Version

Hyprland, built from branch main at commit 99ca26d4eb84e0071264713902e5b287fcab392e (hooksystem: fix missed log include). Tag: v0.32.3-84-g99ca26d4

flags: (if any) debug

Bug or Regression?

Regression

Description

Similar to #3952. Weird flickering artifacts in lower right quadrant of screen. Bisected to commit aedcade68dd0615fd919a7249633a554d0accd81

System:
  Host: gentoo Kernel: 6.6.2-gentoo arch: x86_64 bits: 64 Desktop: Hyprland
    Distro: Gentoo Base System release 2.14
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: TUF GAMING Z790-PLUS WIFI v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 1220
    date: 07/28/2023
CPU:
  Info: 24-core (8-mt/16-st) model: 13th Gen Intel Core i9-13900KS bits: 64
    type: MST AMCP cache: L2: 32 MiB
  Speed (MHz): avg: 837 min/max: 800/5600:6000:4300 cores: 1: 1100 2: 800
    3: 800 4: 800 5: 800 6: 800 7: 1100 8: 800 9: 1100 10: 1100 11: 800 12: 800
    13: 800 14: 800 15: 800 16: 800 17: 800 18: 800 19: 800 20: 801 21: 800
    22: 800 23: 800 24: 800 25: 800 26: 800 27: 800 28: 800 29: 800 30: 800
    31: 800 32: 800
Graphics:
  Device-1: NVIDIA AD102 [GeForce RTX 4090] driver: nvidia v: 545.29.06
  Display: wayland server: Xwayland v: 21.1.99 compositor: Hyprland driver:
    X: loaded: nvidia gpu: nvidia,nvidia-nvswitch resolution: 1: 2560x1440~165Hz
    2: 3840x2160~160Hz
  API: EGL v: 1.5 drivers: nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 vendor: nvidia v: 545.29.06 renderer: NVIDIA GeForce
    RTX 4090/PCIe/SSE2
  API: Vulkan v: 1.3.268 drivers: nvidia surfaces: xcb,xlib,wayland
debug:disable_logs = false

exec-once = waybar & swaybg -o \* -i ~/Pictures/Wallpapers/forest_sunset_pink.jpg -m fill & swayidle -w
exec-once = /usr/libexec/polkit-gnome-authentication-agent-1
exec-once = udiskie -t
exec-once = foot spotify_player & foot nvtop & foot btop

exec-once = wl-paste --type text --watch cliphist store
exec-once = wl-paste --type image --watch cliphist store

monitor=DP-3,3840x2160@159.975,2560x0,1.5
monitor=DP-2,2560x1440@164.958,0x0,1

# NVIDIA 
env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DEKSTOP,Hyprland
# try again when latest gamescope works with 535/545
#env = XWAYLAND_NO_GLAMOR,1 # with this you'll need to use gamescope for gaming

xwayland {
    force_zero_scaling = true
}
env = GDK_SCALE,1.5
env = QT_SCALE_FACTOR,1.5
env = ELM_SCALE,1.5
env = XCURSOR_SIZE,24
env = XCURSOR_THEME,Sunity-cursors

env = TERM,foot
env = TERMINAL,foot

input {
    follow_mouse = 1
    kb_options=ctrl:nocaps
}

general {
    gaps_in = 8
    gaps_out = 15
    border_size = 2
    col.active_border = rgb(cdd6f4)
    col.inactive_border = rgb(11111b)
    layout = master
}

decoration {
  rounding = 5
}

animations {
    enabled = yes
    #easeOutExpo
    bezier = myBezier, 0.22, 1, 0.36, 1

    animation = windows, 1, 7, myBezier, slide
    animation = windowsOut, 1, 7, myBezier, slide
    animation = border, 1, 7, myBezier
    animation = fade, 1, 1, myBezier
    animation = fadeDim, 0
    animation = workspaces, 1, 5, default
    animation = specialWorkspace, 1, 5, default, slidefadevert 50%
}

master {
}

misc {
  force_default_wallpaper = 0
  vrr = 1
  allow_session_lock_restore = true
}

workspace=1,monitor:DP-2,default:true,persistent:true
workspace=2,monitor:DP-3,default:true,persistent:true
workspace=3,monitor:DP-3,default:true,persistent:true
workspace=special, gapsin:70, gapsout:120, on-created-empty:foot
windowrule = float, Rofi
windowrule = noborder, Rofi
windowrule = workspace 3 silent, ^(steam)$
windowrule = workspace 3 silent, ^(discord)$
windowrule = fullscreen,title:^(Steam Big Picture Mode)$
windowrule = tile,title:^(Old School RuneScape)$

$mainMod = SUPER

# keybind for Master layout
bind = SUPER_SHIFT, SPACE, layoutmsg, orientationnext
bind = $mainMod, comma, layoutmsg, addmaster
bind = $mainMod, period, layoutmsg, removemaster
bind = $mainMod, SPACE, layoutmsg, swapwithmaster

bind = $mainMod, RETURN, exec, foot
bind = $mainMod SHIFT, C, killactive
bind = $mainMod SHIFT, Q, exit,
bind = $mainMod, R, exec, sh $HOME/.config/rofi/bin/launcher
bind = $mainMod SHIFT, R, exec, sh $HOME/.config/rofi/bin/runner
bind = $mainMod, P, exec, sh $HOME/.config/rofi/bin/powermenu
bind = $mainMod, V, togglefloating, 
bind = $mainMod, F, fullscreen
bind = $mainMod, W, exec, pkill -SIGUSR1 '^waybar$'
bind = $mainMod, C, exec, cliphist list | sh $HOME/.config/rofi/bin/clipboard | cliphist decode | wl-copy

# volume control
bind = $mainMod, MINUS, exec, amixer sset Master 5%-;
bind = $mainMod, EQUAL, exec, amixer sset Master 5%+;

# screenshot
bind = $mainMod, A, exec, shotname=$(date '+%Y-%m-%d-%H:%M:%S').png && grim ~/Pictures/Screenshots/$shotname && dunstify -u low --replace=699 "Screenshot ${shotname} Saved."
bind = $mainMod, S, exec, shotname=$(date '+%Y-%m-%d-%H:%M:%S').png && grim -o "$(hyprctl activeworkspace | grep -m1 "DP-" | cut -d' ' -f7 | sed s/://g)" ~/Pictures/Screenshots/$shotname && dunstify -u low --replace=699 "Screenshot ${shotname} Saved."
bind = $mainMod SHIFT, S, exec, shotname=$(date '+%Y-%m-%d-%H:%M:%S').png && grim -g "$(slurp)" ~/Pictures/Screenshots/$shotname && dunstify -u low --replace=699 "Screenshot ${shotname} Saved."

bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

#vim bindings for move focus
bind = $mainMod, H, movefocus, l
bind = $mainMod, L, movefocus, r
bind = $mainMod, K, movefocus, u
bind = $mainMod, J, movefocus, d

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, Z, togglespecialworkspace

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, Z, movetoworkspace, special

bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d

#vim bindings for move window
bind = $mainMod SHIFT, H, movewindow, l
bind = $mainMod SHIFT, L, movewindow, r
bind = $mainMod SHIFT, K, movewindow, u
bind = $mainMod SHIFT, J, movewindow, d

exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

How to reproduce

Most easily reproduce with 2 windows in master/slave layout -- in my case, Firefox as master and foot as slave. Do something in the master window like play a video, change tabs, etc.

Crash reports, logs, images, videos

hyprland.log

brettalcox commented 9 months ago

https://github.com/hyprwm/Hyprland/assets/7462622/6da60d73-5fde-4b0b-b21c-48da5dbcf9d4

imxyy1soope1 commented 9 months ago

latest commit should solve the problem

brettalcox commented 9 months ago

@imxyy1soope1 it's still persistent--that's why I opened this issue since the original issue was closed out.

vaxerski commented 9 months ago

if you float a window with blur, does the issue go away?

brettalcox commented 9 months ago

@vaxerski yep that fixes it if i do that

BendTheKn33 commented 9 months ago

What does floating a window with blur mean exactly? I have the same issue and it is driving me insane!

brettalcox commented 9 months ago

@BendTheKn33 floating it instead of tiling the window and blur meaning the blur window effect

2023-11-28-12:30:07

BendTheKn33 commented 9 months ago

Thanks, that's what I thought but when I for example toggle a terminal window, which has blur, to float the issue remains. Yes there is less flicker but still it's clearly there and annoying.

Guess I'll wait for the next update and use another WM for the time being.

brettalcox commented 9 months ago

@BendTheKn33 for me the last usable commit is e40e486f61f2643578b9977b86f408799dbc75fd, so you may try rolling back to that for time being unless there are things in later commits you absolutely need. (Technically, 802ab58f8a129b42d61ec13898fd978e0920f7d8 doesn't have the issue, but it does have the black cursor issue / resolution issue)

vaxerski commented 9 months ago

you're saying 802ab58 doesn't have the issue? Can you bisect it then after that commit?

brettalcox commented 9 months ago

@vaxerski Correct--https://github.com/hyprwm/Hyprland/commit/aedcade68dd0615fd919a7249633a554d0accd81 is where it appears

vaxerski commented 9 months ago

roight. That doesn't help. :/

vaxerski commented 9 months ago

can any one of you add a glFlush() as a first thing in beginRender()?

vaxerski commented 9 months ago

actually glFinish() for nvidia

brettalcox commented 9 months ago

@vaxerski doesn't seem to make any difference

What i applied for reference:

index e058f1c7..8b163b21 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -2281,6 +2281,7 @@ CRenderbuffer* CHyprRenderer::getOrCreateRenderbuffer(wlr_buffer* buffer, uint32
 }

 bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode mode, wlr_buffer* withBuffer) {
+    glFinish();

     if (eglGetCurrentContext() != wlr_egl_get_context(g_pCompositor->m_sWLREGL))
         eglMakeCurrent(wlr_egl_get_display(g_pCompositor->m_sWLREGL), EGL_NO_SURFACE, EGL_NO_SURFACE, wlr_egl_get_context(g_pCompositor->m_sWLREGL));
@@ -2356,4 +2357,4 @@ CRenderbuffer* CHyprRenderer::getCurrentRBO() {

 bool CHyprRenderer::isNvidia() {
     return m_bNvidia;
-}
\ No newline at end of file
+}
vaxerski commented 9 months ago

:(

vaxerski commented 9 months ago

patch.txt ?

vaxerski commented 9 months ago

renamed cuz it's not limited to nv, please test the patch above

brettalcox commented 9 months ago

@vaxerski no dice

andresilva commented 9 months ago

Didn't work for me either.

vaxerski commented 9 months ago

:(

vaxerski commented 9 months ago

I assume wlroots with nvidia patches + sway-git does not exhibit this issue?

vaxerski commented 9 months ago

what about d2c3b23ace745d3f79926c71d4cb3c481a394841

brettalcox commented 9 months ago

hyprlandCrashReport135341.txt

@vaxerski it goes poopy now

vaxerski commented 9 months ago

see #3998 already fixed in head

brettalcox commented 9 months ago

@vaxerski that seems to have fixed it!!

vaxerski commented 9 months ago

the crash or the artifacts?

brettalcox commented 9 months ago

@vaxerski both :D

vaxerski commented 9 months ago

oke, great, closing then :)

andresilva commented 9 months ago

Issue seems to be solved for me as well on amdgpu 🥳.