-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor movement starts to lag after prolonged execution of a browser app #1037
Comments
Could you please record a Tracy profile? You'll need to build and run niri with When the cursor is laggy enough, attach it to niri, record a few seconds of moving the cursor around, then save the recording and upload it somewhere here. |
I added this feature to the package.nix of nixpkgs but i'm getting the following errors:
Can you help me with that? My knowledge about that is very limited. |
Do not run tests with that feature flag. |
When i launch |
I think if you run it a few times it'll launch |
It's not working unfortunately, no matter how often i try |
Strange. Could you try a blanket |
It makes no difference |
Are you using fractional scale? Maybe if you set scale = 1 then it will work. Strange because I can run Tracy fine, if it errors it's usually only once. It's some race condition in how it handles OpenGL probably. |
scale = 1 is a good idea but doesn't work either. I'm sorry that i can't be of more help regarding this issue. I'll leave this issue open and update it, if the problem goes away, if that's ok. |
Could you try something different then? Record a profile with perf like I described here: #602 (comment) |
I added
What is meant by |
It just means not stripping out debug information. It shouldn't be specific to niri. |
@sodiboo hey do you know how to do this on nix, or does it already do the right thing? |
set |
In this time frame, the mouse was laggy. Brave was still running with an instance of www.lstsim.de running for about an hour and a youtube video playing in the background. |
Edit: also happens on River |
Wtf, this is really weird. I wonder if something regressed in |
Then i'll rephrase my statement as "i never noticed it before 25.01 and i'm pretty sure that i would have".
I was thinking the same thing but i checked with
I'm using niri in a pure wayland environment. |
Updated the above comment, seems like my issue is not directly related to Niri as it also happens on River. Not sure if OP's issue is the same one. |
I'll try to find time to look into this further, but reducing the polling rate of my mouse to 500Hz from 1000Hz helped dramatically reduce the CPU usage of niri while moving the cursor, which mostly prevented the lag from occurring. |
It makes sense that this would improve this issue but it would be really good to get to the bottom of this |
Are you on a high refresh rate monitor? Moving the mouse on my 144hz shows around 10% CPU usage, with around 4-6% on the 60hz. I can imagine how on 240hz or higher it could become problematic. |
Also to reiterate: that flame graph is very strange. That unregister function absolutely should not dominate it, regardless of mouse Hz or monitor refresh rate. So if this is some kind of leak in calloop then it should be fixed |
I'm on a 60hz 4k scaled 1.5 and my mouse is set to 1000hz indeed but this wasn't a problem so far. |
Some additional observations on an Intel UHD 770 iGPU with 3440x1440@100Hz monitor:
Flame graph after a couple seconds of minor movement with |
Again this |
Not positive I built niri-flake correctly, but it seems similar to calloop 0.14.2 with the same performance characteristics: ~/.dev/niri/Cargo.toml
~/.dev/niri/Cargo.lock
~/.dev/niri-flake/flake.nix
/etc/nixos/flake.nix
|
Thanks. Let's assume the problem isn't in the calloop updates then. Maybe someone manages to run Tracy and record a Tracy profile? It would be very helpful in diagnosing this. |
Actually, you don't even need to run the profile UI to capture. There's a separate |
Hi! I've had the same issue. It my case it comes up playing Overwatch in Wine, and things start getting laggy after around 10 minutes. I first ran into this problem around June when I upgraded to NixOS 24.05. There was no problem in NixOS 23.11 even with the same niri version in both OS versions. I explained my findings at that point in the Matrix chat, and I kept a copy of what I wrote: https://gist.github.com/hallettj/f68ae8fc9dccbdc709f6cce75fdd4cfb Eventually the problem went away for a long time. I wish I had paid more attention to exactly when it got better. But now I've been seeing the problem again starting sometime in the last month I think. It's hard to pin down because I had a separate issue with gamescope that discouraged me from playing games in Niri until I found a workaround a couple of days ago. My hunch is there's an issue with some non-Rust system dependency that somehow affects Niri but not Gnome or Sway, and the problem has more to due with a high rate of mouse events over a prolonged period of time than graphics or system load. I also tested building niri v25.01 with calloop downgraded to 0.14.0, and I'm certain I built correctly, and I agree that the issue is still present. I did notice that there are two copies of calloop present - 0.13.0 is also in there. I downgraded the one that niri references directly, the one that was at 0.14.2. I can work on a Tracy profile when I next have a bit of time. |
Thanks. Interesting. Unfortunately, this makes it less clear if anything, heh. But yeah, a Tracy profile could maybe shed more light on this. |
When playing the browser sim/game www.lstsim.de for a long time (about an hour at least), the cursor movement becomes more and more laggy (like a game with 10 fps or something like that). Closing the browser doesn't help, i have to restart niri for it to work normally again (logout and login again, or reboot of course).
This started happening with niri 25.01 and didn't happen before. It happens both with
librewolf
andbrave
.System Information
The text was updated successfully, but these errors were encountered: