Open ProgrammingRainbow opened 1 month ago
For my system with 4500U xrender outright freezes the screen on start and then it starts lagging and glitching
Yes it freezes for like 1 or 2 seconds. but then every interaction also causes it. so running glxgears and then simply changing focus will cause it to not even render. Glxgears with go form 5000 fps to 50. but it doesn't actually show anything. And Firefox is unusable because each interaction takes a second or more. I thought my SSD was dieing.
Seeing this on NixOS as well.
Versions: Picom: 12.1 xorg-server: 21.1.13 i3wm: 4.23 kernel: 6.6.53 GPU: AMD Radeon RX 6800 XT (radeonsi, navi21, LLVM 18.1.8, DRM 3.54, 6.6.53) (0x73bf)
Switching backend to glx seems to fix things.
Probably also worth noting that the freezing seems to be CPU-bound - I see the X process' CPU spiking in the time between trying to open a new terminal and seeing it actually render.
I can confirm this on both Artix Linux and FreeBSD running on Intel (using the GPU of the processor). A lot of lagging, especially running stuff in xterm, like looking through directories with Midnight Commander. Also using Vim/Neovim causes lagging, opening a file, nothing happens until after a lag.
This is using Picom 12.1 on i3.
Oh, this problem is on glx as well on my systems.
increasingly slow as in 1 to 2 second lag
do you happen to use wezterm?
Yeah my CPU hits 100% when interacting with a window or switching. It's not terminal specific. My firefox did it with each interaction. I thought my computer was broken. Also glx doesn't seem to be as good. There is some stuttering too. But no where near the issues with xrender.
the xrender backend is slow by itself. it should be gpu-accelerated but it's still quite heavy on the cpu. there are optimization possibilities but this is not in the priority. officially it's set as the default backend in the example configuration file because it was considered to be a safe fallback a long time ago. we were discussing making the glx backend the new default a while ago so maybe it's time to finally do this. i don't see issues with the xrender backend other than this from my short test run.
Prior to picom 12, I used xrender for years without issue. It was as slow as grease lightning. Its only an issue in picom 12. Its not slow it hangs the sysyem. That's what we mean by slow. It freezes and unfreezes the sysyem over and over making it unusable. Glx almost works as fast but it is slower and also seems to stutter the system.
On Tue, 8 Oct 2024, 14:52 Maxim Solovyov, @.***> wrote:
the xrender backend is slow by itself. it should be gpu-accelerated but it's still quite heavy on the cpu. there are optimization possibilities but this is not in the priority. officially it's set as the default backend in the example configuration file because it was considered to be a safe fallback a long time ago. we were discussing making the glx backend the new default a while ago so maybe it's time to finally do this. i don't see issues with the xrender backend other than this from my short test run.
— Reply to this email directly, view it on GitHub https://github.com/yshui/picom/issues/1349#issuecomment-2399911088, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGC7QTOYMO6KVBBCWE4MM5LZ2PPQPAVCNFSM6AAAAABPOWDGVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJZHEYTCMBYHA . You are receiving this because you authored the thread.Message ID: @.***>
@ProgrammingRainbow i feel you didn't answer my question?
I am experiencing this exact same problem with xrender
set as the backend. I'm using Arch with AwesomWM and Alacritty. I can confirm at least on my end that the CPU spike happens with any window. I've got a Radeon RX 580 as my GPU.
Setting the backend to glx
fixed it. I've also used xrender
for months at this point without issue until now.
@Cyan903 thanks for the info. do you use blur with xrender? and the CPU spike is from Xorg, right?
@Cyan903 thanks for the info. do you use blur with xrender? and the CPU spike is from Xorg, right?
I don't use blur with xrender
, but I do use transparency. The CPU spike is from Xorg. Here's my exact config if it helps. Thanks for your reply, let me know if you need any more information.
https://github.com/user-attachments/assets/55c00741-999e-4ae3-8291-e03934018a02
Seeing the same issue here (with Openbox and a Radeon RX Vega 56 GPU). Also seeing the CPU spikes from Xorg.
Here my picom configuration, if it can help answer whether blur is used.
Switching to the glx backend seems like a good solution.
Having this problem too, switching backend to glx fixed it for me.
Picom: v12.1 (/startdir/picom revision c321da4) xorg-server: 21.1.13-1 wm: dwm (w/ various patches)
OS: Arch Linux Kernel: 6.11.2-arch1-1 CPU: AMD Ryzen 9 6900HS Creator Edition IGPU: AMD ATI Radeon 680M
Config: https://github.com/Tigermouthbear/dwm/blob/flexipatch/picom.conf
can you try disabling shadow as well?
I'm not using shadows.
On Thu, 10 Oct 2024, 08:50 Yuxuan Shui, @.***> wrote:
can you try disabling shadow as well?
— Reply to this email directly, view it on GitHub https://github.com/yshui/picom/issues/1349#issuecomment-2404338184, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGC7QTMSUXLQU5Q7ECNZWJTZ2YWWFAVCNFSM6AAAAABPOWDGVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBUGMZTQMJYGQ . You are receiving this because you were mentioned.Message ID: @.***>
hmm, which xf86-video driver do you use? is it modesetting or amdgpu?
there really isn't enough info to work off of. if you can, try profiling the X server and see what's using so much CPU in there.
For my part I'm using xf86-video-amdgpu as the driver.
Deactivating shadows makes the lag disappear.
Attempting to profile CPU usage with Sysprof indicates that most time is spent by Xorg in libpixman-1.so
.
I don't know how to get or view the debug symbols though.
hmm, conflicting information here. is this actually related to shadows or not? :thinking:
I'm sorry i did not understand before about the shadowing. I'm not using any thing that looks like shadows but yes it is enabled in the config. I went back to picom 11 with shadow enabled and xrender is fine. in picom 12 all versions shadow is still on but xrender causes the issue. With shadow off and xrender it is fast again yes. I am using amdgpu no special settings just default out of the box archlinux.
try profiling the X server and see what's using so much CPU in there.
Certainly. Uh, but how? In htop it was xorg that was taking 100% cpu. There is actually14 xorg running but just 1 spikes to 100% and the whole system freezes.
perf record -p <Xorg's pid>
perf report
you might need sudo. more resources on how to perf: https://www.brendangregg.com/perf.html, https://perf.wiki.kernel.org/index.php/Tutorial
A whole lot of this.
14.57% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012328 ◆ 1.97% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012325 ▒ 1.31% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c69 ▒ 1.30% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000006e42 ▒ 1.28% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c6b ▒ 1.26% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012367 ▒ 1.20% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c85 ▒ 1.16% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012361 ▒ 1.13% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012365 ▒ 1.09% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000006e53 ▒ 0.99% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019cab ▒ 0.98% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122e6 ▒ 0.96% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c89 ▒ 0.96% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122f3 ▒ 0.94% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019cb4 ▒ 0.94% Xorg libpixman-1.so.0.43.4 [.] 0x000000000001230a ▒ 0.94% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019cb9 ▒ 0.93% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c97 ▒ 0.92% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122e0 ▒ 0.91% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122e4 ▒ 0.91% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122e9 ▒ 0.90% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012302 ▒ 0.90% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122f7 ▒ 0.90% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c9b ▒ 0.89% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019cbc ▒ 0.86% Xorg libpixman-1.so.0.43.4 [.] 0x00000000000122f0 ▒ 0.83% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012323 ▒ 0.83% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000012320 ▒ 0.79% Xorg libpixman-1.so.0.43.4 [.] 0x0000000000019c7a
so same story as https://github.com/yshui/picom/issues/1349#issuecomment-2405547061 but i do need to see the function names though... maybe you need to install debug symbols for pixman?
i also wonder if the modesetting driver will help. if you can, try just remove xf86-video-amdgpu
?
Do i need to recompile pixman? I'm just using the arch package. is there an aur that debuging or a switch i can use?
it's a bit complicated. you are using X & pixman from archlinux repo, right? in that case, upload your perf.data
, i should be able to look at it.
Does this help?
47.58% Xorg libpixman-1.so.0.43.4 [.] bits_image_fetch_general 39.17% Xorg libpixman-1.so.0.43.4 [.] fetch_pixel_general_32 6.42% Xorg libpixman-1.so.0.43.4 [.] fetch_pixel_a8.lto_priv.0 0.32% Xorg libpixman-1.so.0.43.4 [.] store_scanline_a8.lto_priv.0 0.19% Xorg libpixman-1.so.0.43.4 [.] fetch_scanline_a8.lto_priv.0 0.12% Xorg libpixman-1.so.0.43.4 [.] sse2_combine_over_u.lto_priv.0 0.08% Xorg:cs0 [kernel.kallsyms] [k] amdgpu_cs_ioctl 0.08% Xorg:cs0 [kernel.kallsyms] [k] amdgpu_sync_resv 0.06% Xorg [kernel.kallsyms] [k] srso_return_thunk 0.05% Xorg:cs0 [kernel.kallsyms] [k] srso_return_thunk 0.05% Xorg [kernel.kallsyms] [k] srso_safe_ret 0.05% Xorg:cs0 [kernel.kallsyms] [k] memset_orig 0.05% Xorg [kernel.kallsyms] [k] unix_stream_sendmsg 0.04% Xorg [kernel.kallsyms] [k] _regmap_read 0.04% Xorg [kernel.kallsyms] [k] memset_orig 0.04% Xorg:cs0 [kernel.kallsyms] [k] sort_r 0.04% Xorg [kernel.kallsyms] [k] select_task_rq_fair 0.04% Xorg:cs0 [kernel.kallsyms] [k] srso_safe_ret 0.03% Xorg [kernel.kallsyms] [k] try_to_wake_up 0.03% Xorg [kernel.kallsyms] [k] syscall_exit_to_user_mode 0.03% Xorg [kernel.kallsyms] [k] x86_indirect_thunk_rax 0.03% Xorg:cs0 [kernel.kallsyms] [k] amdgpu_vm_bo_update 0.03% Xorg libc.so.6 [.] 0x000000000016d089 0.03% Xorg:cs0 [kernel.kallsyms] [k] amdgpu_cs_parser_bos.isra.0 0.03% Xorg [kernel.kallsyms] [k] read_tsc 0.02% Xorg:cs0 [kernel.kallsyms] [k] drm_exec_lock_obj 0.02% Xorg:cs0 [kernel.kallsyms] [k] __check_object_size 0.02% Xorg:cs0 [kernel.kallsyms] [k] amdgpu_bo_list_create 0.02% Xorg libc.so.6 [.] 0x000000000016d093
there is a debug companion debug for all packages i found for archlinux.
This is with the xf86-video-amdgpu removed and modesetting set. It doesn't freeze the system. But this is me switching windows as fast as possible with a key binding. So although it shows CPU usage it was still acting fluidly.
48.18% Xorg [kernel.kallsyms] [k] copy_page 5.48% Xorg [kernel.kallsyms] [k] shmem_get_folio_gfp 5.28% Xorg [kernel.kallsyms] [k] filemap_get_entry 3.25% Xorg [kernel.kallsyms] [k] shmem_read_mapping_page_gfp 2.60% Xorg [kernel.kallsyms] [k] ttm_tt_swapout 2.13% Xorg [kernel.kallsyms] [k] folio_mark_accessed 1.78% Xorg [kernel.kallsyms] [k] clear_page_rep 1.59% Xorg [kernel.kallsyms] [k] srso_safe_ret 1.55% Xorg [kernel.kallsyms] [k] srso_return_thunk 1.33% Xorg [kernel.kallsyms] [k] noop_dirty_folio 1.11% Xorg [kernel.kallsyms] [k] x86_indirect_thunk_rax 0.89% Xorg [kernel.kallsyms] [k] rcu_read_lock 0.81% Xorg [kernel.kallsyms] [k] ttm_bo_swapout 0.80% Xorg [kernel.kallsyms] [k] mark_page_accessed 0.68% Xorg [kernel.kallsyms] [k] rep_movs_alternative 0.50% Xorg [kernel.kallsyms] [k] folio_mapping 0.44% Xorg [kernel.kallsyms] [k] get_page_from_freelist 0.40% Xorg [kernel.kallsyms] [k] rmqueue_pcplist 0.37% Xorg [kernel.kallsyms] [k] read_hpet 0.28% Xorg [kernel.kallsyms] [k] shmem_add_to_page_cache 0.25% Xorg [kernel.kallsyms] [k] __mod_memcg_lruvec_state 0.25% Xorg [kernel.kallsyms] [k] lruvec_stat_mod_folio 0.23% Xorg [kernel.kallsyms] [k] shmem_alloc_and_add_folio
@ProgrammingRainbow so it works normally with modesetting? i think we can pin the blame on xf86-video-amdgpu
and say "not our problem" then :smiling_imp:
But why is this issue only showing up with picom? In kde there is no issue with amdgpu. It seems specific to picom. Is there a specific setting in KDE i could check for the equivalent shadow? Because in the default KDE with all it's normal drop shadows and transparency it has no issue. I had to switch to KDE before i figured out picom was an issue. Also why is it specific to picom 12? I think to say it's xf86-video-amdgpu the issue is not accurate. To say it's "picom 12" + amdgpu would be correct. And then again the question as to why picom 12 what changed in picom? The amdgpu also has not been changed for over a year and a half. So it seem extremely unlikely that a bug suddenly showed up in a driver that has been the same since the beginning of 2023.
it's just how picom does things triggered bad behavior in amdgpu. kde/kwin doesn't even have a xrender backend anymore, so if you are comparing with them, you should be comparing them against picom's glx backend.
the fact everything works fine with modesetting proves picom is not doing anything wrong. most likely amdgpu just implemented certain operations used by picom v12 very very inefficiently. nowadays modesetting is the recommended driver anyways.
i will pin this issue so people with the same problem know what to do.
Again it seems the only isolated variable here is picom 12. It seems very strange to pass the blame when causing the bug requires 1 specific thing, is required picom 12. not other version of picom. How did amdgpu know to make it work with picom 11 and not 12. It reads a like attempting to pass the issue when the bug is specific to a specific version of a specific piece of software. Would the xf86-video-amdgpu not just state to obvious that nope the bug is not on there end?
Again it seems the only isolated variable here is picom 12.
no? you forgot xf86-video-amdgpu vs. modesetting.
my reasoning it very clearly explained in my previous comment, and i think you are missing some of the points there. i don't have anything to add in that regard.
For people reading this issue, the current recommendation is this:
xf86-video-amdgpu
and use the modesetting driver.@ProgrammingRainbow, practice shows that all the xf86-video drivers are evil and we advise to use the modesetting one. if we spent time figuring out all the bugs caused by xf86-video drivers picom would stuck at v10.
ok, i think this is it.
turns out i am both right and wrong. i was right that xf86-video-amdgpu does certain operations picom needs (specifically convolution filters) rather inefficiently. i was wrong in the sense that, modesetting isn't any better either. we just had a workaround for it in place:
I just saw all these replies today. But my thought is as i originally said the issue was specific to picom 12 and there was an attempt to shift the blame. I'm not a driver developer but when taking the scientific approach you should remove any variables possible and picom specifically could not be removed as a variable. The issue required a specific version of picom not a specific version of xf86-video-amdgpu. If that helps in the future. Also it was stated above that although glx seemed to mitigate most of the issue there was or is still micro freezing. Something i have never seen in the past.
tl;dr use the modesetting ddx driver instead of the intel's one.
we have two paths of generating and rendering shadows in the xrender backend: 1) performed by the ddx driver using the x render extension's convolution picture filter that's supposed to be accelerated thus supposed to be fast - let's call it the "fast" path; 2) performed by us thus supposed to be slow - let's call it the "slow" path.
we used to assume that all the vendors' ddx drivers have a proper accelerated convolution filter but this assumption turned to be wrong. we started to assume that the intel's ddx driver has it but this assumption turned to be wrong as well - it indeed has an accelerated convoltion filter but it's quite limited and isn't enough for picom's needs. in the end it turned that the "fast" path is actually slow and the "slow" path is actually fast.
the "fast" path also has a rendering issue that may be a bug on our side.
for now the issues mentioned above affect only the intel's ddx driver. it's advised to use the modesetting ddx driver instead of the intel's one simply because of the latter being abandoned and instead of all the vendors' ddx drivers in general because they're all cursed ahh.
an update on artifacts: there are indeed artifacts but they're only present when the intel's ddx driver is used so the situation for it is: 1) the convolution filter is accelerated for 0 < shadow radius <= 15; 2) the convolution filter generates artifacts for 1 < shadow radius <= 15; 3) the convolution filter isn't accelerated for shadow radius > 15.
so the only usable shadow radius for it is 1 😂
i pushed a (hopefully temporary) workaround for all the issues with shadows in the xrender backend to the next
branch. now they should work well no matter what ddx driver is used.
leaving this open until we decide what to do with everything we learned about ddx drivers.
i pushed a (hopefully temporary) workaround for all the issues with shadows in the xrender backend to the
next
branch. now they should work well no matter what ddx driver is used.leaving this open until we decide what to do with everything we learned about ddx drivers.
I just test your last commit, yes artifacts and poor performance are gone (In my case). I tested with big shadow radius like 20 and with the default one.
Update: There is still a little bad performance with big shadow radius like 20 for example. The defaults works fine or at least is not notorious.
Running Archlinux and updated my system running Xmonad. The system because increasingly slow as in 1 to 2 second lag. I found the Xorg was running 100% just changing focus or transitioning. Even firefox wasn't resounding properly. Killing picom fixed it. So i started trying different backends and also different versions. It seems Picom-11 used xrender backend and that worked find. But Picom-12 it doesn't work with xrender. Some of the packages had it set to xrender in /etc/xdg/picom.conf and some had it set to glx. The latest is xrender which slowed me down. So for now switching to glx is working. but it seems xrender is bugged and set as the default in archlinux. I am using an AMD 5700u APU if that helps with the latest archlinux packages using the standard mesa open source drivers.