yshui / picom

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

Noticable performance hit, input lag and high cpu usage on using with intel iGPU #585

Open pvonmoradi opened 3 years ago

pvonmoradi commented 3 years ago

When I enable picom, my T450s's fans start up regulary and I notice a discernable lag on even keyboard input on terminals.
It doesn't matter which backend I use or what blur method (or none).

Platform

Xubuntu 18.04 + i3-gaps wm

GPU, drivers, and screen setup

Intel Corporation HD Graphics 5500, single 14" FHD IPS, T450s

glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 5500 (BDW GT2) (0x1616)
    Version: 20.0.8
    Accelerated: yes
    Video memory: 3072MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 5500 (BDW GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.8
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: 3.0 Mesa 20.0.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
cat ~/.Xresources 
Xft.dpi: 157
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

Environment

i3-gaps. Had to do this to fix tearing:

cat /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"  "true"
EndSection

picom version

vgit-d9743

./build/src/picom --diagnostics
[ 01/25/2021 14:34:40.725 get_cfg WARN ] Dual-kawase blur is not implemented by the legacy backends, you must use the `experimental-backends` option.
[ 01/25/2021 14:34:40.803 init_render WARN ] Old backends only support blur method "kernel". Your blur setting will not be applied
**Version:** vgit-d9743

### Extensions:

* Shape: Yes
* XRandR: Yes
* Present: Present

### Misc:

* Use Overlay: Yes
* Config file used: /home/pooya/.config/picom/picom.conf

### Drivers (inaccurate):

Intel

### Backend: glx

* Driver vendors:
 * GLX: Mesa Project and SGI
 * GL: Intel Open Source Technology Center
* GL renderer: Mesa DRI Intel(R) HD Graphics 5500 (BDW GT2)
* Accelerated: 1

Configuration:

# Shadow
shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
log-level = "warn";
# log-file = "/path/to/your/log/file";
# shadow-opacity = 0.7;
# shadow-red = 0.0;
# shadow-green = 0.0;
# shadow-blue = 0.0;
shadow-exclude = [
    "name = 'Notification'",
    "class_g = 'Conky'",
    "class_g ?= 'Notify-osd'",
    "class_g = 'Cairo-clock'",
    "_GTK_FRAME_EXTENTS@:c"
];
# shadow-exclude = "n:e:Notification";
# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

# Opacity
# inactive-opacity = 0.8;
# active-opacity = 0.8;
# frame-opacity = 0.7;
inactive-opacity-override = false;
# inactive-dim = 0.2;
# inactive-dim-fixed = true;
# blur-background = true;
# blur-background-frame = true;
# blur-kern = "3x3box";
# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
# blur-background-fixed = true;
# blur-background-exclude = [
#   "window_type = 'dock'",
#   "window_type = 'desktop'",
#   "_GTK_FRAME_EXTENTS@:c"
# ];
# opacity-rule = [ "100:class_g = 'Alacritty'" ];

blur-background = true;
blur-method = "dual_kawase";
blur-strength = 3;

# Fading
fading = false;
# fade-delta = 30;
fade-in-step = 0.03;
fade-out-step = 0.03;
# no-fading-openclose = true;
# no-fading-destroyed-argb = true;
fade-exclude = [ ];

# Other
# backend = "xrender";
backend = "glx";
mark-wmwin-focused = true;
mark-ovredir-focused = true;
# use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 60;
vsync = true;
# sw-opti = true;
# unredir-if-possible = true;
# unredir-if-possible-delay = 5000;
# unredir-if-possible-exclude = [ ];
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
# resize-damage = 1;

# GLX backend
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
# xrender-sync-fence = true;
use-damage = false

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
  dock = { shadow = false; }
  dnd = { shadow = false; }
  popup_menu = { opacity = 0.95; }
  dropdown_menu = { opacity = 0.9; }
};
M4he commented 3 years ago

Try using the following options in your /etc/X11/xorg.conf.d/20-intel.conf

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod" "sna"
   Option      "DRI" "3"
EndSection

If this doesn't perform well, try using "uxa" instead of "sna".

The TearFree option shouldn't be necessary with picom's vsync = true and may reduce performance a lot. Also may introduce issues with multiple screens. It will not work with uxa either. I suggest to remove it entirely in any case.

Also, use-damage = false of your picom config might have a negative impact on performance as well.

ypnos commented 3 years ago

I suggest you deinstall xorg intel driver; Xorg will then fallback to modesetting driver. This driver works better than intel driver on many systems, including mine which are a T440s and a Core i5 6600 desktop.

StoicIndividual commented 3 years ago

Option "AccelMethod" "sna"

Isn't "sna" used by default?

M4he commented 3 years ago

Option "AccelMethod" "sna"

Isn't "sna" used by default?

Probably (at least Arch wiki says so).
I carried this config file around for years on many Intel iGPUs of different generations. My experience is that every generation had its own quirks and usally only one constellation specific to this generation actually worked and performed well with compton/picom. For some it had to be uxa and sna for others, where the performance could be abysmal if the wrong one was used. I kept this config file and only adjusted the values each generation, so that's why sometimes it matches the defaults.
On the Intel Core 10th generation machines I currently don't need this config file at all, seems to be fine out of the box with defaults for this generation, which is a first for me.

So far I had no luck with the modesetting driver (at least on Ubuntu 20.04, kernel 5.8) which @ypnos mentioned, because I can't seem to get any VSync to work with picom when using the modesetting driver on my Intel Core 10th gen machines.

agenbite commented 2 years ago

I suggest you deinstall xorg intel driver; Xorg will then fallback to modesetting driver. This driver works better than intel driver on many systems, including mine which are a T440s and a Core i5 6600 desktop.

This worked beautifully for me. Thanks.

ce7elem commented 2 years ago

For me the fix was to update my kernel, apparently my GC was not used by default. Hope that will help some other poor souls :crossed_fingers:

agenbite commented 2 years ago

It'd be more helpful if you could specify both old and new kernels... :)

ce7elem commented 2 years ago

It'd be more helpful if you could specify both old and new kernels... :)

Right, my bad: Updated kernel Linux 5.10.113 → 5.17.6 on Debian

Gavin152 commented 8 months ago

Try using the following options in your /etc/X11/xorg.conf.d/20-intel.conf

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod" "sna"
   Option      "DRI" "3"
EndSection

If this doesn't perform well, try using "uxa" instead of "sna".

The TearFree option shouldn't be necessary with picom's vsync = true and may reduce performance a lot. Also may introduce issues with multiple screens. It will not work with uxa either. I suggest to remove it entirely in any case.

Also, use-damage = false of your picom config might have a negative impact on performance as well.

Thanks! Solved the issue for me on my Lenovo X1 running Arch!