Open zsolt-donca opened 4 years ago
It might be useful to get a trace of picom with apitrace
, and use the profile feature of apitrace
to measure the frame timings.
See https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown for how to do this, esp. https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown#profiling-a-trace
qapitrace
can generate frame timing graphs as well. It's in Trace -> Profile
Maybe also capture traces of both the experimental and the old glx backends, and compare them.
i feel like the root cause of the problem is
Intel HD Graphics P630 4K display
Thanks for the reply, @yshui!
I will get back to you with the results of the apitrace
investigation.
@mighty9245 What do you mean? The GPU is not something that I can easily replace (other than by replacing the laptop). It seems to work fine with the old backends, so there is some proof that the GPU is capable (enough). I'd also rather not use the dedicated nvidia GPU all the time, as it my laptop is already hot enough as is (and the CPU thermal throttling often kicks in).
I've created some traces for two scenarios. I've uploaded the .trace files here - I will let the experts analyze them. I repeated both scenarios two times, trying to repeat them as close as possible, once with the old backend, and once with the new backend.
For tracing the old backend, I used:
apitrace trace --api gl /usr/bin/picom
For tracing the new backends, I used:
apitrace trace --api gl /usr/bin/picom --experimental-backends
After all, I created the following structure:
├── run1
│ ├── picom-new-backend.trace
│ └── picom-old-backend.trace
└── run2
├── picom-new-backend.trace
└── picom-old-backend.trace
The scenarios:
run1
, I've started with a Chrome window and 3 additional termite windows, in the i3 split layout; this means that all the 4 windows in total were resized to fit the screen. In Chrome, I had https://www.vsynctester.com/ open. I've kept this layout for 30 seconds, then switched to tabbed layout while focusing Chrome; this meant that the termite windows went into background, and Chrome was maximized (the termite windows also being maximized in the background). At this phase while on the new backends, the vsynctester clearly showed that my overall FPS rate fell down to around 30 FPS, because the VSYNC label was almost constantly cyan or red, changing colors every 2-3 seconds only. However, the graphs on the page claimed 60 FPS; this makes me think that it's the compositor that's not performing. I've kept this also for 30 seconds, then ended the profiling.run2
, I've started with a Chrome window and a termite window in tabbed layout (both maximized, one occluding the other), and progressively increased the load by opening new termite windows every 10 seconds. I did this test also for 60 seconds. When on the new backends, the performance got progressively worse, with the entire system lagging heavily towards the end (when I had 8 windows open in total). When the system was lagging, the VSYNC label was flashing and the animation was heavily stuttering.If you'd like, I can also make a 60 FPS video of reproducing these scenarios with my phone, to demonstrate the issue.
@zsolt-donca Hi, can you do the profiling on your setup and post the result? If I do the profiling using your apitrace recording, what I will get is how well picom performance on my machine. So you have to do it.
@yshui I've uploaded the results of the profiling here for the above traces.
I hope I used the correct command. I executed the following for both runs:
apitrace replay --pgpu --pcpu --ppd picom-old-backend.trace > picom-old-backend.profile
apitrace replay --pgpu --pcpu --ppd picom-new-backend.trace > picom-new-backend.profile
My screen changed for the duration of the "replays" for approximately the same duration as I recorded them, but it wasn't actually replaying everything, it was only showing a couple of still frames.
I hope it was okay; if you guys need more data to work with, let me know.
This sounds like a very similar issue I'm having. I run i3wm and generally have a lot of tabbed windows.
Running default config, only changing the flag to run experimental backends, I'm getting a noticeable lag and jitter effect on picom with Intel UHD gfx (using an X1 Carbon Gen 7)
I've tried changing just about every variation in the config file to try to diagnose, but the only thing I can pinpoint is running with the experimental backends feature, which ultimately I want to do anyways because of kawase blur.
If there's anything I can provide to help diagnose this let me know - happy to help wherever I can.
I have very bad performance with the experimental glx backend when having several tabbed windows (using i3wm). I get a noticeable input lag if I have multiple, large windows on top of another, such when using the i3 tabbed layout. The performance impact can be shown by https://www.vsynctester.com/; when I have multiple large windows open, I can see that the compositor drops frames (the framedrops not always visible in vsynctester's graphs).
I don't have the same issue when having open only a single window, or when using the "old" backends (without the
--experimental-backends
flag). I also don't have the issue when using the experimental xrender backend, which actually works way faster for me than the experimental glx backend.Besides changing backends, I have noticed several ways to mitigate the issue:
--transparent-clipping
makes the issue disappear (after switching to a newer build: picom-git), at least in case when I have multiple windows in top of each other (in the tabbed layout); however, I don't like this feature because breaks some visual effects in some applications (e.g. dragging a selected text in the browser appears to opens a rectangular "window" to the wallpaper);Note that I have the same performance issue when using GNOME also, making GNOME practically unusable for me in 4K resolution. Not sure if it is relevant, but I noticed that when using KWin, I have a significantly worse performance when using their OpenGL 3.x backend, and much better on OpenGL 2.0.
Platform
Arch Linux x86_64
GPU, drivers, and screen setup
GPU: Intel HD Graphics P630 Drivers:
Screen setup: single 4K display 3840x2160 @ 60Hz
Note that I have an Optimus setup with an NVIDIA Quadro M1200 Mobile, with nvidia-lts 1:440.64-9, using optimus manager, but I have the performance issue when using the Intel GPU only (which I do most of the time), with the nvidia GPU powered off.
Environment
I am on i3-gaps, but I had the same fundamental performance issue also on Gnome (obviously not while using picom/compton).
picom version
Configuration:
I am starting picom with
picom --experimental-backends --no-fading-openclose
.Steps of reproduction
Expected behavior
Having a handful of background windows open shouldn't make the entire desktop feel laggy. Also, I am expecting the experimental backends to have at least the performance of the old backends.
Current Behavior
My system feels much slower on the experimental glx backend, not just when having multiple windows open.