yshui / picom

A lightweight compositor for X11
Other
3.92k stars 576 forks source link

High CPU usage if vsync is disabled #1248

Open XoDefender opened 2 months ago

XoDefender commented 2 months ago

Noticed it started happening after frame pacing and vblank additions

GPU, drivers, and screen setup

``` name of display: :0 display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Intel (0x8086) Device: Mesa Intel(R) Graphics (ADL GT2) (0x4626) Version: 22.3.6 Accelerated: yes Video memory: 15697MB Unified memory: yes Preferred profile: core (0x1) Max core profile version: 4.6 Max compat profile version: 4.6 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.2 OpenGL vendor string: Intel OpenGL renderer string: Mesa Intel(R) Graphics (ADL GT2) OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.6 OpenGL core profile shading language version string: 4.60 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.6 OpenGL shading language version string: 4.60 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.6 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 ```

picom version

v11.2

Configuration:

Configuration file ``` shadow = true; shadow-radius = 30; shadow-opacity = 1; shadow-offset-x = -10; shadow-offset-y = -7; shadow-exclude = [ "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'", "class_g = 'fly-notify-osd-service'", "class_g = 'firefox' && (window_type = 'popup_menu' || window_type = 'utility')", "_GTK_FRAME_EXTENTS@:c" ]; fading = false; fade-in-step = 0.03; fade-out-step = 0.03; enable-transparency = false; inactive-opacity = 1.0; inactive-opacity-override = false; focus-exclude = [ "class_g = 'Cairo-clock'" ]; opacity-rule = [ "0:_NET_WM_STATE@[0]:32a *= '_NET_WM_STATE_HIDDEN'", "0:_NET_WM_STATE@[1]:32a *= '_NET_WM_STATE_HIDDEN'", "0:_NET_WM_STATE@[2]:32a *= '_NET_WM_STATE_HIDDEN'", "0:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_HIDDEN'", "0:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_HIDDEN'" ]; corner-radius = 10; rounded-corners-exclude = [ "window_type = 'dock'", "window_type = 'desktop'", "class_g ?= 'Firefox'" ]; blur-kern = "3x3box"; blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'", "class_g = 'firefox' && (window_type = 'popup_menu' || window_type = 'utility')", "_GTK_FRAME_EXTENTS@:c" ]; backend = "glx"; vsync = false; dbus = false; mark-wmwin-focused = true; mark-ovredir-focused = true; detect-rounded-corners = true; detect-client-opacity = true; use-ewmh-active-win = true; unredir-if-possible = true; detect-transient = true; detect-client-leader = true; glx-no-stencil = true; glx-no-rebind-pixmap = true; use-damage = true; xrender-sync-fence = false; no-ewmh-fullscreen = false; log-level = "warn"; frame-opacity = 1.0; ```

Steps of reproduction

  1. Disable vsync through the config
  2. Launch picom

Expected behavior

Picom takes not so much of CPU

Current Behavior

(292 root children) Picom takes up to 80% of CPU - vsync disabled Picom takes 30% of CPU - vsync enabled

killertofus commented 2 weeks ago

image can confirm https://github.com/killertofus/awesome/blob/main/config/picom.conf

yshui commented 1 week ago

This is expected: disabling vsync makes picom render new frames as fast as possible, which means a really high fps, which means high CPU usage.

maybe I ask why you chose to disable vsync? If there's a compelling use case, we can consider adding a frame rate limiter.