yshui / picom

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

picom + kwin_x11 and shadows enabled ( -c ) leaks huge amounts of VRAM after resizing windows #993

Open clapbr opened 1 year ago

clapbr commented 1 year ago

Platform

Arch Linux

GPU, drivers, and screen setup

glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 24576 MB
    Total available memory: 24576 MB
    Currently available dedicated video memory: 22910 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3090/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 525.78.01
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 525.78.01
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 525.78.01
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

kwin_x11 + picom-git

picom version

vgit-60ac2

Diagnostics **Version:** vgit-60ac2 ### Extensions: * Shape: Yes * XRandR: Yes * Present: Present ### Misc: * Use Overlay: Yes * Config file used: None ### Drivers (inaccurate): NVIDIA ### Backend: glx * Driver vendors: * GLX: NVIDIA Corporation * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2 ### Backend: egl * Driver vendors: * EGL: NVIDIA * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2

Configuration:

Configuration file ``` --backend glx --inactive-opacity 1 --vsync -c ```

Steps of reproduction

  1. Run picom on kwin_x11 and enable shadows with -c flag
  2. Open a konsole window and resize it a few times.
  3. Check VRAM usage with nvidia-smi

Expected behavior

Normal VRAM usage from picom (~80-200MB)

Current Behavior

More than 2GB VRAM used up from my total of 24 on RTX 3090.

absolutelynothelix commented 1 year ago

if you prepend --config=/dev/null to the provided command line arguments, does it still happen? also, kwin_x11 is a part of the kwin package on arch linux, i assume?

update: can't reproduce.

clapbr commented 1 year ago

if you prepend --config=/dev/null to the provided command line arguments, does it still happen? also, kwin_x11 is a part of the kwin package on arch linux, i assume?

update: can't reproduce.

Yeah still happens with null config, although I just tested a bit more and after like a minute it eventually got purged, but still, spiked up to ~2GB really quick.

I just triggered it a couple of times and slowly see it being purged.

Actually found this by accident while reproducing another unrelated bug, shouldn't affect too much people I suppose. May also be a Nvidia bug...

Edit: Recorded it https://user-images.githubusercontent.com/6379485/211984855-4a25ca8f-8cf1-42dd-a0d1-a470b6165832.mp4

absolutelynothelix commented 1 year ago

Edit: Recorded it https://user-images.githubusercontent.com/6379485/211984855-4a25ca8f-8cf1-42dd-a0d1-a470b6165832.mp4

unfortunately, the video doesn't play for me neither on arch linux, nor on windows, nor on ios.

what's your screen resolution?

clapbr commented 1 year ago

2560x1080 @75hz - I will try to record in another format and repost tomorrow.

clapbr commented 1 year ago

sorry for the delay, uploaded it to youtube: https://www.youtube.com/watch?v=6NPeTQNCXdw

TheRealMothebad commented 10 months ago

I think I have this same problem using picom on arch with i3 and a minimal config

shadow = true;
#backend = glx;

inactive-dim = 0.02;

vsync = true;

opacity-rule = [
    "92:class_g = 'Alacritty'",
];

It will fill up my swap fast if I change window size Video attached https://github.com/yshui/picom/assets/43652625/c382d330-36da-4832-bb35-9a4908f33c0d

absolutelynothelix commented 10 months ago

@TheRealMothebad, try picom built from the latest commit in the next branch.

yshui commented 8 months ago

@clapbr hey, can you record a trace of picom? we might be leaking textures, a trace might help us find out.