Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Cursor lag when moving external mouse

Open dementive opened this issue 9 months ago • 17 comments

Already reported ? *

  • [x] I have searched the existing open and closed issues.

Regression?

Definitely a regression - something broke after update (requires bisect)

System Info and Hyprland Version

Hyprland 0.47.2 built from branch at commit 882f7ad7d2bbfc7440d0ccaef93b1cdd78e8e3ff (version: bump to 0.47.2). Date: Sun Feb 2 00:47:17 2025 Tag: v0.47.2, commits: 5767 built against: aquamarine 0.7.2 hyprlang 0.6.0 hyprutils 0.5.0 hyprcursor 0.1.11 hyprgraphics 0.1.1

no flags were set

System Information: System name: Linux Node name: arch Release: 6.13.1-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Sun, 02 Feb 2025 01:02:29 +0000

GPU information: 0000:00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c) (prog-if 00 [VGA controller]) 0000:01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104 [Geforce RTX 3070 Ti Laptop GPU] [10de:24a0] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX x86_64 Kernel Module 570.86.16 Fri Jan 24 21:25:51 UTC 2025

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

After updating from v0.46.2 to v0.47 I started to get really bad lag whenever I move my cursor anywhere in hyprland, like it just constantly stutters whenever I move the cursor anywhere even with no windows open. I've tried with 2 different usb mouses and my laptop trackpad and they all have the same cursor lag problem. This also doesn't happen on X11, I was using awesome wm for a bit hoping this would magically go away like every other problem I've ever had with hyprland but it hasn't (and awesome decided to completely stop working so I have to use hyprland with the cursor lag ahahah)

I found this old issue and tried everything mentioned here but had no luck, https://github.com/hyprwm/Hyprland/issues/4523.

How to reproduce

  1. Start hyprland and move the cursor with a external mouse plugged in.

Attach not paste

  • [x] I understand that all text files must be attached, and not pasted directly. If not respected, this issue will likely get closed as spam

Checklist of files to include below

  • [x] Hyprland config - hyprctl systeminfo -c (always include)
  • [ ] Crash report (always include in case of crash)
  • [ ] Video (always include in case of a visual bug)
  • [x] Logs (might contain useful info such as errors)

Additional info & File uploads

hyprland_config_dump.txt

hyprland.log

I would take a video but OBS also broke recently somehow and no longer has an option to screen capture :(

dementive avatar Feb 04 '25 18:02 dementive

Well I got OBS working to try to take a video of the problem but somehow OBS fixes the cursor lag I guess? Literally just opening OBS and selecting a screen to capture with the pipewire record feature fixed it and the second I close OBS or remove the screen capture source the cursor lag comes back. Seems like I have Schrödinger's cursor lag. I don't have to start a recording or anything literally just opening OBS fixes it. No idea what OBS is doing but every other app doesn't fix it so I guess im just never closing OBS lol.

dementive avatar Feb 04 '25 19:02 dementive

Seems like i'm not the only one having strange cursor issues haha

I have had issues for a while now, cursor randomly begins to be kind of slow and laggy, it becomes difficult to accurately move the mouse over a button. I use a touchpad mainly, but the few times I tried with a mouse it was more or less the same.

It does magically go away sometimes but the most efficient way to get rid of it for me is to restart hyprland. Hardware / no hardware cursors does not change anything.

This is definitely a regression, i used hyprland for almost 2 years now on this laptop and this issue is fairly recent.

Having an external mouse plugged in is not mandatory to trigger the issue for me

Intel Iris Xe, no discrete gpu, no tlp. Gpu clock does not drop when the cursor decides to enter glitched state

I don't really have time to bisect for now, but i will probably do it if we don't find the root cause

FlashOnFire avatar Feb 04 '25 20:02 FlashOnFire

I'm experiencing the same error. It's really strange that OBS seems to fix it. Should we expect a fix from Hyprland or is there something that can be resolved with a simple change?

CronoxJC avatar Feb 05 '25 02:02 CronoxJC

Same here - cursor lagging and opened OBS fixing the lags. Also lags happen only on second monitor (first one is laptop's).

aldarg avatar Feb 05 '25 15:02 aldarg

Same here, seems like anything which captures your screen seem to fix it. E.g. discord screen share. What's interesting I have also unrelated different issue with black flickering on the bottom on my screen in some games with direct_scanout option. Which obs/screenshare also fixes. Nvidia GPU, single screen, vrr on.

Skidamek avatar Feb 05 '25 15:02 Skidamek

Same here - cursor lagging and opened OBS fixing the lags. Also lags happen only on second monitor (first one is laptop's).

In my case, I have three monitors: one from the laptop, one via HDMI, and another via a USB-C cable (I use a USB-C to HDMI adapter). The error only occurs with this third monitor. Additionally, there’s lag only when using the mouse; if I use the touchpad, it works fine.

CronoxJC avatar Feb 05 '25 19:02 CronoxJC

I solved it by writing in the hyprland.conf file:

cursor { no_hardware_cursors = true }

It's that simple.

CronoxJC avatar Feb 05 '25 20:02 CronoxJC

I've also noticed yesterday in the middle of the day that Hyprland process eats up to 3.4 GB RAM, but now after reboot the numbers are about 300 mb. Memory leak?

aldarg avatar Feb 06 '25 01:02 aldarg

probably

ghost avatar Feb 06 '25 07:02 ghost

Can confirm, that when moving mouse on specific screen (in my case DP-5), cursor is laggy and hyprland eats up ~300MB / min. Also looks like no_hardware_cursors = true fixes it.

Aiq0 avatar Feb 06 '25 08:02 Aiq0

I assume all of you are on nvidia - we've recently enabled nvidia hw cursors, so that might be your problem. I have no clue why it happens, but it could be a prime nvidia moment

vaxerski avatar Feb 06 '25 12:02 vaxerski

Coming from #4523; I have a 3060 and I have hardware cursors on, previously I would experience tiny lags as my cursor crossed window boundaries & I'm pretty sure OGL_DEDICATED_HW_STATE_PER_CONTEXT=ENABLE_ROBUST (https://github.com/hyprwm/Hyprland/issues/4523#issuecomment-1926460314) solved it for me. Knowing myself it could also just be the placebo effect, but it's definitely worth trying for those who still want hardware cursors on

It looks like nvidia added an application profile within their driver package to set this envvar for Kwin when they released beta 550.40.07 (link). I wouldn't be surprised if this has performance gains across Wayland compositors

ewancg avatar Feb 06 '25 20:02 ewancg

@vaxerski I'm not. I'm on AMD. no_hardware_cursors = true doesn't fix it for me either. Not sure yet what's going on.

xorander00 avatar Feb 11 '25 13:02 xorander00

@vaxerski Oh, and one more potential point of interest. I have an Apple Magic Trackpad connected to this system as well. When using it to move the cursor around, there are no issues. It's only when using my mouse that the issue shows up. I'm trying to figure out if there are any specific conditions to reliably reproduce it.

xorander00 avatar Feb 11 '25 18:02 xorander00

I'm experiencing the same error. It's really strange that OBS seems to fix it. Should we expect a fix from Hyprland or is there something that can be resolved with a simple change?

Wild, OBS also prevents the issue for me. ~~no_hardware_cursors didn't seem to work.~~ I'm on a Lenovo P1 with hybrid graphics.

edit: What's even more wild is I swear my whole hyprland desktop is more snappy than I remember it being ever. It could just be placebo, or the relative change from when I was getting cursor lag. I think it's using less CPU too, I think hyprland was consuming quite a bit of CPU time before, not so much that I was sure it was a bug, but still more than now. I'll try and get hard metrics when I can.

hyprland_config_dump.txt

edit: I was mistaken to say that the no hardware cursors setting didn't work. I hadn't properly reapplied the correct config. The following dump is the case without lag.

hyprland_config_dump.txt

cscutcher avatar Feb 13 '25 11:02 cscutcher

It's happening to me too. I recorded a video showing that the CPU usage increases just by moving the mouse on the external monitor. However, at times, it gets much more laggy, but I couldn't capture it in the video.

I know it happened during the transition from 0.47.0 to 0.47.2.

Video

err0x1a avatar Feb 14 '25 20:02 err0x1a

I am experiencing a similar issue, however, it's happening only when hovering a window. I had cursor:no_hardware_cursors set to 2 for ages, setting it to 1 fixed it. And yeah, I am on nvidia.

nnra6864 avatar Feb 17 '25 06:02 nnra6864

I am experiencing cursor lag as well, but only when there is a high CPU process (eg java compiling or kernel build).

Hyprland config

ivanp avatar Mar 04 '25 11:03 ivanp

Hyprland config

I am positive that's normal when using software cursors but feel free to correct me if I am wrong.

nnra6864 avatar Mar 04 '25 13:03 nnra6864

Hyprland config

I am positive that's normal when using software cursors but feel free to correct me if I am wrong.

Using hardware cursor is similar or even worse, and the cursor is invisible on some apps such as JetBrains IDEs.

ivanp avatar Mar 04 '25 14:03 ivanp

Using hardware cursor is similar or even worse, and the cursor is invisible on some apps such as JetBrains IDEs.

And I am guessing you also have an nvidia gpu, right?

nnra6864 avatar Mar 04 '25 14:03 nnra6864

Using hardware cursor is similar or even worse, and the cursor is invisible on some apps such as JetBrains IDEs.

And I am guessing you also have an nvidia gpu, right?

That's right.

ivanp avatar Mar 04 '25 15:03 ivanp

That's right.

There's your answer.

nnra6864 avatar Mar 04 '25 15:03 nnra6864

Hello there!

This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.

Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)

Thank you for your understanding!

vaxerski avatar Apr 05 '25 19:04 vaxerski