-
Notifications
You must be signed in to change notification settings - Fork 500
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
Compton w/ glx-backend causes lags in xterm, urxvt and dmenu when using xft-fonts #152
Comments
Sorry if the stuffs below looks disorganized. I'm tired today...
|
First of all, thank you very much for your verbose support efforts!
To me, this issue looks like compton (or the driver or something else) just "forgets" for a few seconds to update the screen in the affected applications. So this is just a status update; it might take me a few days to answer your other questions since I don't have that much time during the week and all this testing stuff takes quite a while… |
Your diagnostics went much further than what I expected, with my extremely brief and abstract instructions. :-D
If simply disabling VSync, without touching anything else, actually fixes the issue, it's almost certainly a problem of the driver. The core VSync function calls are only a few lines long, and it's almost impossible that we made a mistake in it. You may try different combinations of enabling/disabling driver VSync and compton VSync options (the various By the way, you may use Update: SlackBox reported X Render backend +
When Xft struck updates of a window, are other windows around affected? Like, your conky window in the background. Even though this is probably not a bug in compton, investigating with other compositors may help, to find... Perhaps workarounds or something. |
Hey, these are the first rather good news today, thanks guys! Xrender and just OpenGL (w/o any appendix) actually seem to work here, too (must have somehow missed that combo in my previous tests…) So let me see if I got this right:
Besides, Conky doesn't seem to be affected and neither seem to be applications that use pango instead of xft. |
The default, unless your distro installs a configuration file that states otherwise.
|
Sorry if I didn't express myself clearly enough concerning the "just opengl" thing (englisch isn't my native language, I never grew roughly fluent in it). I just ment that I used "opengl" for vsync an not "opengl-swc" or "opengl-oml" or something like that… I will absolutely analyze explicitly which combinations work and which results in the issue described above before reporting this to nvidia; weekend's near, so there will be time for testing. :) Anyway, thanks for your explanations regarding xrender which sound to me like: If there aren't any cruel performance issues and the CPU-load stays normal, you can use xrender without bad conscience. But what's about that "smaller tearing line on the top of the screen" you mentioned? I really can't image how this looks… |
Oh... I see.
Neither it is for me. :-)
They described the tearing on the top of the screen a lot in #7, before I introduced GLX backend and opengl-swc VSync:
|
thank you for your hard work to such an excellent compositor at first. but i still meet a small trouble when using it together with dmenu. i find it that compton always make the dmenu transparent as it does on other inactive windows. is there any way to solve it? my wm is herbstluftwm. |
|
@richardgv |
Hey, thank you very very much for But why is it spelt that way ("hybird" instead of "hybrid")? o.O Anyway, I'll now run a couple of tests with various driver settings and see if the lagging comes back… But if it doesn''t, this ought to be a really happy christmas. 😄 Once again: thanks for your great work, no matter if JFYI: Meanwhile, I run a few tests w/ nouveau, but it turned out that this caused quite annoying stuttering by scrolling in vim/ranger/urxvt/… This is obviously caused by activating nouveau's |
Fix a spelling mistake (xr_glx_hybird -> xr_glx_hybrid). Thanks to cju for reporting.
Thanks, since I don't like branch-hopping that much: when is this going to hit the master branch? |
Well, I can't believe I've been spelling it incorrectly for years... Thanks! :-)
Heh, that sucks, though probably it has something to do with your model.
In a few days, if I still remember this at the time. :-D |
So it seems that the hybrid backend actually does the trick w/ nvidia & xft. :-D Just for clarification: When using the hybrid backend, I can/should/must specify all glx-options as well as all xrender-options in my .compton.conf, right? Does that mean that I can now use e. g. I also think you should probably understand the hybrid backend not just as a tricky workaround for driver-caused problems, but as a real alternative to the two common backends. Why? Because my tests w/ hybrid shown a performance increase not only w/ nvidia, but also on an intel-driven machine, even though the glx backend worked there virtually perfect before; for example dragging windows around is muuuch smoother w/ hybrid than w/ glx and temperature seems to stay lower for about 1-2 degrees. I literally don't know anything about the technical background of the different backends, but you once said that xrender tends to use more CPU and glx more GPU, so is it possible that hybrid causes some sort of "load balancing" between CPU and GPU? Would be a nice side-effect imho… Merry Christmas. |
Usually you can combine X Render and GLX options, but there's nothing absolute. Generally speaking, X Render options will affect all the window image blending while GLX options will affect the last step of rendering the blended image to root window or X composite overlay.
I guess it still sounds like a bad idea to combine those two options and it's unlikely to bring you much benefits (unless you set
Thanks for telling me about it. :-) It's hard to say. GPU is typically vastly superior in graphic operations (if you follow its rules, of course), but the cost of utilizing it is not cheap (all those RAM <-> VRAM transfers, so many layers of abstractions, and probably some design issues in X) and the quality depends on the drivers. It becomes the prominent factor under light load (like compositing). Only through experiments could one tell which is faster on a specific system, and it's good if and only if it's suitable for you. :-)
Only the last paint in a frame uses OpenGL, which I suppose won't do much balancing but actually wastes some time rendering a
Merry Christmas. :-) |
I'm having the same issue with urxvt and compton but I can't install the drivers since I'm using a laptop I use for work and I run linux as a virtual machine and windows as a host...It's very painful for me because even vim and neovim are not working correctly and I really need to use that editor. I don't know what to do, sorry, I'm still a noob, could you help me with this issue? I can't install Nvidia drivers inside my virtual machine. |
Interestingly enough I have the same issue now, but with intel, not nvidia. I'll see if I can reproduce it with repaint debugging stuff enabled. |
I was having the same issue a week ago on Intel Video using the I should also probably add that the hybrid compton backend didn't work well on my laptop. It was very sluggish. |
Some quick tips that are not mentioned in the previous discussion:
If anybody still experiences the issue and the methods above do not help, please leave a comment with more detailed description of the hardware, drivers, and symptoms, and I will provide more instructions for diagnostics.
There are some synchronization issues in the backend: We probably failed to wait until X Render operations complete before starting GLX operations. I will unfortunately need more knowledge about the operation of X Render and OpenGL to fix it. |
--xrender-sync and --xrender-sync-fence seems to have fixed it for me. I had not enabled the two other options. |
Hell yeah! Dat helps, thanks! |
|
I have a command line that works well for me on Intel (Skylake) plus Nvidia bumblebee config:
Performance is much snappier and I'm not seeing any of the redraw artifacts I was getting on the pure GLX backend. |
I have a Kaby Lake Intel, and the only thing that has worked for me was switching to DRI2. I'm using Compton with GLX backend, without vertical sync (I'm witnessing no tearing), with Intel drivers (modesetting driver didn't help, even though it's DRI2-only), on 4.10 kernel. Neither XRender nor the hybrid backend helped, nor did XSync (the EDIT Scratch that, XTerm issues came back after I fiddled with my monitor setup. What's currently working for me is disabling Compton altogether, and using these driver options instead:
|
This changes the compton backend from gfx to the xrender-glc-hybrid backend. This is done by the advice over on chjj/compton#152.
This was a dubious "fix" for a Nvidia driver problem. The problem was never fully understood, and the then developers took a shotgun approach and implemented xsync fences as a fix. Which somehow fixed the problem. Again, I don't see any indication that the developers understood why this "fix" worked. (for details, see chjj/compton#152 and chjj/compton#181) The driver problem should have been fixed almost 5 years ago. So this shouldn't be needed anymore. In addition the way compton uses xsync fences is apparently wrong according to the xsync spec (fences are attached to screen, but compton uses them as if they were attached to drawables). So, I will try removing it and see if anyone will complain. If there are real concrete reasons why fences are needed, it will be brought back. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
When I run compton with the glx-backend, I get visual hangs/lags/glitches in xterm, urxvt and dmenu – but ONLY when I use xft respectively a xft-font!
For example:
As soon as I switch back to a bitmap font, the problem seems to be gone!
I am running the latest version of compton under i3 with a nvidia chipset and the nvidia-driver. If there is any additional information that might by helpful, please let me know.
TIA
P.S. Obviously, this isn't happening in VTE-based applications by using xft-fonts there, though.
The text was updated successfully, but these errors were encountered: