hyprwm / hyprlock

Hyprland's GPU-accelerated screen locking utility
BSD 3-Clause "New" or "Revised" License
718 stars 53 forks source link

[nvidia] Intermittently freezing for few seconds after lock #128

Open brettalcox opened 6 months ago

brettalcox commented 6 months ago

Building at commit 19d7844f040c0290e23efc2e756ff75ce844248e

GPU: NVIDIA GeForce RTX 4090 WM: Hyprland Resolution: 2560x1440 (1x scale), 3840x2160 (1.5x scale)

Added the logs below of when this happens. The screen is still a bit transparent so i can still things occurring, and the last log before the freeze is the [ERR] Invalid key down event (stray release event?). The screen will go slightly transparent, and freeze for 3-5 seconds before finally finishing the lock. Other times, it doesn't happen and its a nice smooth transition/fade out.

Weirdly, I can't get this to actually reproduce when running hyprlock --verbose, only simply when running hyprlock, so not sure if this is a race condition.

gentoo :: ~ » hyprlock
[LOG]   | got iface: wl_shm v1
[LOG]   | got iface: wl_drm v2
[LOG]   | got iface: zwp_linux_dmabuf_v1 v4
[LOG]    > Bound to zwp_linux_dmabuf_v1 v4
[LOG]   | got iface: wl_compositor v6
[LOG]    > Bound to wl_compositor v6
[LOG]   | got iface: wl_subcompositor v1
[LOG]   | got iface: wl_data_device_manager v3
[LOG]   | got iface: zwlr_export_dmabuf_manager_v1 v1
[LOG]   | got iface: zwlr_data_control_manager_v1 v2
[LOG]   | got iface: zwp_primary_selection_device_manager_v1 v1
[LOG]   | got iface: wp_viewporter v1
[LOG]    > Bound to wp_viewporter v1
[LOG]   | got iface: zwlr_gamma_control_manager_v1 v1
[LOG]   | got iface: zwlr_output_power_manager_v1 v1
[LOG]   | got iface: xdg_wm_base v6
[LOG]   | got iface: wl_seat v9
[LOG]    > Bound to wl_seat v9
[LOG]   | got iface: wp_presentation v1
[LOG]   | got iface: ext_idle_notifier_v1 v1
[LOG]   | got iface: zwlr_layer_shell_v1 v4
[LOG]   | got iface: org_kde_kwin_server_decoration_manager v1
[LOG]   | got iface: zxdg_decoration_manager_v1 v1
[LOG]   | got iface: zwlr_output_manager_v1 v4
[LOG]   | got iface: zwp_keyboard_shortcuts_inhibit_manager_v1 v1
[LOG]   | got iface: zwp_pointer_constraints_v1 v1
[LOG]   | got iface: zwp_relative_pointer_manager_v1 v1
[LOG]   | got iface: zwp_virtual_keyboard_manager_v1 v1
[LOG]   | got iface: zwlr_virtual_pointer_manager_v1 v2
[LOG]   | got iface: zwlr_foreign_toplevel_manager_v1 v3
[LOG]   | got iface: wp_drm_lease_device_v1 v1
[LOG]   | got iface: zwp_tablet_manager_v2 v1
[LOG]   | got iface: zwp_idle_inhibit_manager_v1 v1
[LOG]   | got iface: zxdg_exporter_v1 v1
[LOG]   | got iface: zxdg_importer_v1 v1
[LOG]   | got iface: zxdg_exporter_v2 v1
[LOG]   | got iface: zxdg_importer_v2 v1
[LOG]   | got iface: zwp_pointer_gestures_v1 v3
[LOG]   | got iface: zwp_text_input_manager_v3 v1
[LOG]   | got iface: zwp_input_method_manager_v2 v1
[LOG]   | got iface: xdg_activation_v1 v1
[LOG]   | got iface: ext_session_lock_manager_v1 v1
[LOG]    > Bound to ext_session_lock_manager_v1 v1
[LOG]   | got iface: wp_cursor_shape_manager_v1 v1
[LOG]    > Bound to wp_cursor_shape_manager_v1 v1
[LOG]   | got iface: wp_tearing_control_manager_v1 v1
[LOG]   | got iface: wp_single_pixel_buffer_manager_v1 v1
[LOG]   | got iface: xwayland_shell_v1 v1
[LOG]   | got iface: hyprland_toplevel_export_manager_v1 v2
[LOG]   | got iface: wp_fractional_scale_manager_v1 v1
[LOG]    > Bound to wp_fractional_scale_manager_v1 v1
[LOG]   | got iface: zwp_text_input_manager_v1 v1
[LOG]   | got iface: hyprland_global_shortcuts_manager_v1 v1
[LOG]   | got iface: zwlr_screencopy_manager_v1 v3
[LOG]    > Bound to zwlr_screencopy_manager_v1 v3
[LOG]   | got iface: zxdg_output_manager_v1 v3
[LOG]   | got iface: wl_output v4
[LOG]    > Bound to wl_output v4
[LOG]   | got iface: wl_output v4
[LOG]    > Bound to wl_output v4
[LOG] [core] dmabufFeedbackMainDevice
[LOG] output 49 make LG Electronics model 27GN950
[LOG] output 49 name DP-2
[LOG] output 49 description LG Electronics 27GN950 102NTHMB3033 (DP-2)
[LOG] output 49 done
[LOG] output 51 make LG Electronics model LG ULTRAGEAR
[LOG] output 51 name DP-3
[LOG] output 51 description LG Electronics LG ULTRAGEAR 108MXNU4B199 (DP-3)
[LOG] output 51 done
[LOG] Running on Hyprland
[LOG] Locking session
[LOG] onLockLocked called
[LOG] got fractional 1
[LOG] got fractional 1.5
[LOG] configure with serial 10533
[LOG] Configuring surface for logical [Vector2D: x: 2560, y: 1440] and pixel [Vector2D: x: 3840, y: 2160]
[LOG] got fractional 1
[LOG] got fractional 1
[LOG] configure with serial 10534
[LOG] Configuring surface for logical [Vector2D: x: 2560, y: 1440] and pixel [Vector2D: x: 2560, y: 1440]
[ERR] Invalid key down event (stray release event?)
[LOG] Authenticating
[LOG] auth: authenticated for hyprlock
[LOG] Unlocking session
[LOG] Unlocked, exiting!
[LOG] Reached the end, exiting
[1]    74955 segmentation fault (core dumped)  hyprlock

EDIT: here is my hyprlock.conf

background {
    monitor =
    #path = /home/brettalcox/Pictures/Wallpapers/synthwave_palm_blur.png
}

input-field {
    #monitor = DP-3
    size = 200, 50
    outline_thickness = 3
    dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
    dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
    dots_center = false
    outer_color = rgb(151515)
    inner_color = rgb(200, 200, 200)
    font_color = rgb(10, 10, 10)
    fade_on_empty = true
    placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
    hide_input = false

    position = 0, -20
    halign = center
    valign = center
}

label {
    #monitor = DP-3
    text = Hi there, $USER
    color = rgba(200, 200, 200, 1.0)
    font_size = 25
    font_family = Noto Sans

    position = 0, 80
    halign = center
    valign = center
}

general {
    #disable_loading_bar = true
    #no_fade_in = true
}
NoisyFlake commented 6 months ago

Same issue here with an RTX 2070 Super. Sometimes it locks perfectly, sometimes it kinda "lags" for 2-3 seconds before the lockscreen appears. This can usually be sped up when e.g. moving the mouse.

gekoke commented 5 months ago

I'm experiencing similar behaviour on an RTX 1080. Most animations freeze or are laggy, can be sped up by moving the mouse. This makes Hyprlock completely unusable, which is a shame since it is by far the nicest and most featureful option available for Wayland locking. An option to disable hardware acceleration would be nice, but I understand if this isn't feasible / is too much work.

NoisyFlake commented 5 months ago

I'd really love a workaround for NVIDIA. So far there's no other Wayland lockscreen that compares to Hyprland, but the constant lag and labels not updating makes it basically unusable :/

vaxerski commented 5 months ago

update periodically and check back. I can't make any fixes specifically for nvidia without someone from nvidia themselves pointing out the issues:

gekoke commented 5 months ago

Next GPU gonna be red for sure

barbiefan commented 4 months ago

same here with rtx 3060, --verbose doesn't change it

IOKernel commented 4 months ago

Facing the same issue, hyprlock seems to run very slow (and gets slower the longer it is on). The animations feel like they're running on less than 10 frames per second.

Can confirm that moving the mouse while launching and typing the password results in smooth animations

IOKernel commented 4 months ago

I fixed the issue for my case by changing the polling rate from 5 seconds to 4ms (or 16ms) to poll on every monitor refresh rate. Created a pullrequest for a quick fix, though it might not be a good fix. https://github.com/hyprwm/hyprlock/pull/283

If you are on NixOS

{ pkgs, ... }:
{
  programs.hyprlock = {
    enable = true;
    package = pkgs.hyprlock.overrideAttrs (old: {
      version = "git";
      src = pkgs.fetchFromGitHub {
        owner = "hyprwm";
        repo = "hyprlock";
        rev = "2bce52f";
        sha256 = "36qa6MOhCBd39YPC0FgapwGRHZXjstw8BQuKdFzwQ4k=";
      };
      patchPhase = ''
        substituteInPlace src/core/hyprlock.cpp \
        --replace "5000" "16"
      '';
      });
...
}
serpens-ignis commented 4 months ago

I fixed the issue for my case by changing the polling rate from 5 seconds to 4ms (or 16ms) to poll on every monitor refresh rate. Created a pullrequest for a quick fix, though it might not be a good fix. #283

Thanks for the workaround. Arch users can apply it by adding this to the PKGBUILD:

prepare() {
    cd "${srcdir}/${_pkgname}"
    sed -i -e "s/5000/16/g" src/core/hyprlock.cpp
}
WyattBreitner commented 3 months ago

Confirmed still a bug, running on Arch. I havn't tried the polling workaround yet. hyprland-git: 0.3.0.r30.gc5b8ad03-1 Nvidia Driver: 550.78 GPU: 1060 6GB

BenTowali commented 1 month ago

Still a bug for me too on arch, I tried to print logs but the only thing it tells me is Invalid key down event (stray release event?) which is not that helpful

Hyprland: 0.41.2-3 Hyprlock: 0.4.1-1 Drivers: 555.58 GPU: 1070 Ti

UltraViolet43 commented 1 month ago

Still an issue for me, but using the polling workaround fixed it.

Hyprland 0.41.2-3 Hyprlock-git 0.4.1.r4.g5e8f12c2-1 Nvidia-dkms Driver 555.58.02-1

Edit: specified hyprlock-git instead of hyprlock