yshui / picom

A lightweight compositor for X11 with animation support
https://picom.app/
Other
4.07k stars 584 forks source link

High CPU usage when screen is off #1288

Open desbma opened 2 months ago

desbma commented 2 months ago

Platform

Arch Linux x86-64, up to date.

GPU, drivers, and screen setup

NVidia GTX 980, with nvidia-dkms 555.58.02-1

$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3158 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 980/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 555.58.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 555.58.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 555.58.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

Xmonad

picom version

$ picom --version
vgit-89c2c
$ picom --diagnostics
**Version:** vgit-89c2c

### Extensions:

* Shape: Yes
* RandR: Yes
* Present: Present

### Misc:

* Use Overlay: No
  (Another compositor is already running)
* Config file used: /home/maxime/.config/picom/picom.conf

### Drivers (inaccurate):

NVIDIA

### Backend: glx

* Driver vendors:
 * GLX: NVIDIA Corporation
 * GL: NVIDIA Corporation
* GL renderer: NVIDIA GeForce GTX 980/PCIe/SSE2

### Backend: egl

* Driver vendors:
 * EGL: NVIDIA
 * GL: NVIDIA Corporation
* GL renderer: NVIDIA GeForce GTX 980/PCIe/SSE2

~/.config/picom/picom.conf:

#
# Backend
#
backend = "glx";
xrender-sync-fence = true;
vsync = true;

#
# Shadows
#

shadow = true;
shadow-radius = 12;
shadow-offset-x = -12;
shadow-offset-y = -12;
shadow-opacity = 0.75;
# Solarized base02 #073642
shadow-red = 0.02734375;
shadow-green = 0.2109375;
shadow-blue = 0.2578125;
shadow-exclude = [
    "! name~=''",
    "name = 'Notification'",
    "class_g = 'Polybar'",
    "class_g = 'Firefox' && argb",
    "class_g = 'Dunst'",
    "class_g = 'albert'",
    "class_g = 'mpv'",
    "class_g ?= 'Notify-osd'",
    "_GTK_FRAME_EXTENTS@:c",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
    # https://github.com/chjj/compton/issues/167#issuecomment-31932159
    "(_NET_WM_STATE@[0]:a = '_NET_WM_STATE@_MAXIMIZED_VERT' || _NET_WM_STATE@[1]:a = '_NET_WM_STATE@_MAXIMIZED_VERT' || _NET_WM_STATE@[2]:a = '_NET_WM_STATE@_MAXIMIZED_VERT' || _NET_WM_STATE@[3]:a = '_NET_WM_STATE@_MAXIMIZED_VERT' || _NET_WM_STATE@[4]:a = '_NET_WM_STATE@_MAXIMIZED_VERT') && (_NET_WM_STATE@[0]:a = '_NET_WM_STATE@_MAXIMIZED_HORZ' || _NET_WM_STATE@[1]:a = '_NET_WM_STATE@_MAXIMIZED_HORZ' || _NET_WM_STATE@[2]:a = '_NET_WM_STATE@_MAXIMIZED_HORZ' || _NET_WM_STATE@[3]:a = '_NET_WM_STATE@_MAXIMIZED_HORZ' || _NET_WM_STATE@[4]:a = '_NET_WM_STATE@_MAXIMIZED_HORZ')",
    "y = 26 && y2 = 1200",
    "y = 26 && y2 = 1080"
];

#
# Opacity
#

inactive-opacity-override = false;
opacity-rule = [
    "94:class_g = 'Alacritty' && focused",
    "90:class_g = 'Alacritty' && ! focused",
    "60:class_g = 'KeePassXC' && ! focused"
]

#
# Blur
#

blur-background = true;
blur: {
    method = "gaussian";
    size = 4;
    deviation = 5.0;
};
blur-background-exclude = [
    "window_type = 'dock'",
    "window_type = 'desktop'",
    "class_g = 'Alacritty' && ! focused",
    "! class_g = 'Alacritty'"
];

#
# Fading
#

fading = true;
fade-delta = 6;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [
    "class_g = 'Alacritty'",
    "class_g = 'Rofi'"
];

#
# Corners
#

corner-radius = 6
rounded-corners-exclude = [
  "window_type != 'dialog'"
];

#
# Other
#

mark-wmwin-focused = true;
mark-ovredir-focused = true;
use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
detect-client-leader = true;

#
# Window type settings
#

wintypes:
{
    dropdown_menu = { shadow = false; };
    popup_menu    = { shadow = false; };
    utility       = { shadow = false; };

    tooltip =
    {
        # fade: Fade the particular type of windows.
        fade = true;
        # shadow: Give those windows shadow
        shadow = false;
        # opacity: Default opacity for the type of windows.
        opacity = 0.85;
        # focus: Whether to always consider windows of this type focused.
        focus = true;
    };
};

Steps of reproduction

  1. Turn screens off with xset dpms force off (my lock screen does this)
  2. Listen to the CPU fans speeding up, or monitor CPU usage of picom process to see it goes out of control

Expected behavior

CPU usage should remain low, or lower than when screens are active.

Current Behavior

CPU usage is high when screens are off, and goes back to normal when screens are active.

Stack trace

N/A

OpenGL trace

N/A

Other details

N/A

yshui commented 2 months ago

is this new? did this happen with older nvidia drivers?

desbma commented 2 months ago

It seems recent, but I'm not exactly sure when it first occurred, a few weeks ago, a few months at most I'd say.

yshui commented 2 months ago

@absolutelynothelix has a nvidia GPU and is able to reproduce this.

nvidia's glXWaitVideoSyncSGI has awful behavior when screen is off, and has caused us many headaches. maybe we should let them know.