Distribution
Mint 22.3
Package version
6.6.9
Graphics hardware in use
NVIDIA GeForce RTX 3070 Mobile Max-Q
Frequency
Always
Bug description
[ Note: I have only attempted this via CJS, so perhaps it is an issue there? ]
ClutterShaderEffects allocate VRAM for an offscreen buffer when applied to a ClutterActor. However, once the effect and actor are both dereferenced and destroyed, the buffer's VRAM remains allocated indefinitely.
Steps to reproduce
Here is a minimal Cinnamon extension to reproduce the issue:
const Clutter = imports.gi.Clutter;
const Main = imports.ui.main;
function init() {}
function enable() {
// Create dummy Actor with a reasonable texture size
this.actor = new Clutter.Actor({ width: 1920, height: 1080 });
Main.uiGroup.add_child(this.actor);
// Add 100 ShaderEffects to the dummy Actor
for (let i = 0; i < 100; i++) {
let effect = new Clutter.ShaderEffect();
effect.set_shader_source('void main() { cogl_color_out = vec4(0); }');
this.actor.add_effect(effect);
}
}
function disable() {
// Remove all ShaderEffects and delete actor
this.actor.clear_effects();
Main.uiGroup.remove_child(this.actor);
delete this.actor;
}
Before enabling the extension:
After enabling the extension:
After disabling the extension:
Each subsequent enable/disable cycle leaks an additional ~1GB of VRAM until it overflows and Cinnamon crashes.
Expected behavior
Buffer VRAM allocated by a ClutterShaderEffect should be freed when the object allocating it is dereferenced.
Additional information
I have already ensured that the ClutterShaderEffect/ClutterActor objects are being properly dereferenced by storing them all in an array, explicitly calling unref() on each, ensuring ref_count drops to 0, and setting each object to null before deleting the array.
This issue also appears when using currently published and popular extensions such as "Blur Cinnamon" that make use of ClutterShaderEffect, and can destabilize the entire desktop environment in a matter of minutes.
This occurs on both the dGPU (RTX 3070 Max-Q; VRAM) and the iGPU (TigerLake-H GT1 UHD; system RAM) of my laptop, so it is not an issue with the NVIDIA graphics driver.
Distribution
Mint 22.3
Package version
6.6.9
Graphics hardware in use
NVIDIA GeForce RTX 3070 Mobile Max-Q
Frequency
Always
Bug description
[ Note: I have only attempted this via CJS, so perhaps it is an issue there? ]
ClutterShaderEffects allocate VRAM for an offscreen buffer when applied to aClutterActor. However, once the effect and actor are both dereferenced and destroyed, the buffer's VRAM remains allocated indefinitely.Steps to reproduce
Here is a minimal Cinnamon extension to reproduce the issue:
Before enabling the extension:
After enabling the extension:
After disabling the extension:
Each subsequent enable/disable cycle leaks an additional ~1GB of VRAM until it overflows and Cinnamon crashes.
Expected behavior
Buffer VRAM allocated by a
ClutterShaderEffectshould be freed when the object allocating it is dereferenced.Additional information
I have already ensured that the
ClutterShaderEffect/ClutterActorobjects are being properly dereferenced by storing them all in an array, explicitly callingunref()on each, ensuringref_countdrops to 0, and setting each object tonullbefore deleting the array.This issue also appears when using currently published and popular extensions such as "Blur Cinnamon" that make use of
ClutterShaderEffect, and can destabilize the entire desktop environment in a matter of minutes.This occurs on both the dGPU (RTX 3070 Max-Q; VRAM) and the iGPU (TigerLake-H GT1 UHD; system RAM) of my laptop, so it is not an issue with the NVIDIA graphics driver.