8000 Video Memory Leak · Issue #1179 · pop-os/cosmic-comp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Video Memory Leak #1179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gasquid opened this issue Jan 28, 2025 · 30 comments
Open

Video Memory Leak #1179

gasquid opened this issue Jan 28, 2025 · 30 comments
Milestone

Comments

@gasquid
Copy link
gasquid commented Jan 28, 2025

After starting, cosmic-comp gradually consumes more and more vmem. Eventually, I will have to logout and back in or restart in order to clear it. GPU is an AMD Radeon RX 6750 XT

Image

@feikedonia
Copy link
Contributor
feikedonia commented Jan 30, 2025

On which version of Cosmic are you?

How can I reproduce the issue?

@gasquid
Copy link
Author
gasquid commented Jan 30, 2025

I'm on alpha5 (openSUSE cosmic-comp-1.0.0~alpha5.1+13-19.1.x86_64). As far as reproducing the leak, it doesn't seem to be tied to anything particular that I'm doing. It starts when cosmic starts and leaks about 1GB per day.

@feikedonia
Copy link
Contributor

I'm on alpha5 (openSUSE cosmic-comp-1.0.0~alpha5.1+13-19.1.x86_64). As far as reproducing the leak, it doesn't seem to be tied to anything particular that I'm doing. It starts when cosmic starts and leaks about 1GB per day.

Does the leak effect any real life workflows?

  • Do processes randomly crash;
  • Can you not start new processes because of this;
  • Do you keep your computer running for days, with the 1 GB building up each day, causing the things mentioned above; or
  • Could you name any other reason for the Cosmic team to take action?
    Because 1 GB isn't much...

Sorry

@Drakulix
Copy link
Member

It does affect usage, if the compositor continuously leaks more. Is this on mesa or amdgpu pro drivers?

@gasquid
Copy link
Author
gasquid commented Jan 31, 2025

It does affect usage, if the compositor continuously leaks more. Is this on mesa or amdgpu pro drivers?

Yep, it does leak continuously. The screenshot I provided above shows cosmic-comp running at almost 5GB of vmem. IIRC, when it gets to about 8 or 9GB, the desktop will crash.

I restarted COSMIC yesterday and it's up to 2.5GB today.

Image

I'm using the in-kernel amdgpu drivers and not amdgpu pro.

04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
	Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3991
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu

I've seen this on 6.12 and 6.13, I believe also 6.6 (openSUSE longterm) but I'd have to verify again. Mesa is 24.3.3.

❯ rpm -qa | grep -i -e kernel-default -e kernel-longterm
kernel-default-devel-6.12.9-1.1.x86_64
kernel-default-6.13.0-1.1.x86_64
kernel-longterm-6.6.71-1.1.x86_64
kernel-default-6.12.9-1.1.x86_64
kernel-default-devel-6.13.0-1.1.x86_64
kernel-longterm-6.6.72-1.1.x86_64

❯ rpm -qa | grep -i mesa
Mesa-24.3.3-1699.403.pm.1.x86_64
Mesa-libglapi0-24.3.3-1699.403.pm.1.x86_64
Mesa-dri-32bit-24.3.3-1699.403.pm.3.x86_64
libOSMesa8-24.3.3-1699.403.pm.1.x86_64
Mesa-gallium-24.3.3-1699.403.pm.3.x86_64
libOSMesa8-32bit-24.3.3-1699.403.pm.1.x86_64
Mesa-libva-24.3.3-1699.403.pm.3.x86_64
Mesa-libGL1-32bit-24.3.3-1699.403.pm.1.x86_64
Mesa-demo-x-9.0.0-3.4.x86_64
Mesa-vulkan-device-select-24.3.3-1699.403.pm.3.x86_64
Mesa-demo-egl-9.0.0-3.4.x86_64
Mesa-gallium-32bit-24.3.3-1699.403.pm.3.x86_64
Mesa-libglapi0-32bit-24.3.3-1699.403.pm.1.x86_64
Mesa-dri-24.3.3-1699.403.pm.3.x86_64
Mesa-libEGL1-24.3.3-1699.403.pm.1.x86_64
Mesa-libGL1-24.3.3-1699.403.pm.1.x86_64
Mesa-32bit-24.3.3-1699.403.pm.1.x86_64
Mesa-vulkan-device-select-32bit-24.3.3-1699.403.pm.3.x86_64

@gasquid
Copy link
Author
gasquid commented Feb 2, 2025

Image

I rebooted to the 6.6 kernel and confirmed cosmic-comp leaks vmem with it.

@GallowsDove
Copy link

Might be related to Smithay/smithay#1562

it would be nice if you could test other compositors or notice when the VRAM usage increases.

@gasquid
Copy link
Author
gasquid commented Feb 24, 2025

It could be, I have tested Niri, which is also based on Smithay, and did not experience the same memory leaking issue. I do see a big increase in VRAM when I open the workspaces overview. However after opening the overview several times, it will drop back down.

It leaks continuously even if all I do is log into COSMIC and leave it sit without opening any windows and effectively not interacting with it, so not sure what I can "notice" with it.

edit: I also have not experienced this on either Hyprland or Plasma

@gasquid
Copy link
Author
gasquid commented Feb 24, 2025

Well, I 8000 can confirm opening and closing windows does leak video memory. I tested kitty, alacritty, COSMIC termial, konsole, and xterm, all of which leaked when opening and closing. I also tested COSMIC Files to see what a non-terminal application does and it behaves the same way. This doesn't explain the memory leak when idle/no windows open, but certainly an issue.

Image

Image

@ids1024
Copy link
Member
ids1024 commented Feb 27, 2025

I don't know how best to examine VRAM usage on Intel graphics, since nvtop doesn't support it, but I can reproduce this on AMD. VRAM usage goes up when I open vkgears (as expected) but doesn't go down quite to the previous level after closing. And starting more instances increases this. Which presumably shouldn't be happening.

Interestingly, looking at /proc/$(pidof cosmic-comp)/fdinfo/* it's not leaking dmabuf fds (or any other fds), and the fd count goes back to the previous value when opening and closing a window. So we're not leaking references to the client buffers, as we had an issue with at one point due to a circular reference.

I guess intel_gpu_top can work on Intel...

Edit: intel_gpu_top doesn't seem to list the compositor.

@ids1024
Copy link
Member
ids1024 commented Feb 27, 2025

Even spawning 100 instances of vkgears on anvil (with for i in $(seq 1 100); do vkgears& done and then killing them brings Anvil's VRAM usage back down, so this appears to be related to something cosmic-comp is doing.

Edit: Or maybe I was looking at the wrong number, and there's a slight increase. Regardless, need to find a way to look at where exactly the VRAM allocations are.

@ids1024
Copy link
Member
ids1024 commented Feb 28, 2025

I've tried testing with this script:

while true
do
	for i in $(seq 1 100)
	do
		vkgears&
	done
		
	sleep 2

	killall vkgears

	sleep 2
done

I did see the compositor grind to a halt after maybe a couple hours, which is likely I sign of running out of memory. Though I re-ran it a while, and saw no issue. This is on an AMD APU; not sure if an RDNA GPU would be different.

VRAM usage does seem to slowly go down after a window is closed. I guess something is running a garbage collector?

There may be better test clients that just plain vkgears, as well.

@peterkrull
Copy link
Contributor
peterkrull commented Mar 4, 2025

Happens on Nvidia as well. The increase in VRAM seems to correlate with the size of the window. On my machine, a tiled window taking up the entire screen leaks ~14 MB of VRAM. A smaller window will leak less.

2025-03-04.16-41-30.mp4

Edit: Tried this with no luck, and Gnome does not exhibit the same behavior.

@AlexeyMatskevich
Copy link
AlexeyMatskevich commented Mar 14, 2025

I use nixos 25.05 and Cosmis 1.0.0 epoche 6 unstable from 12.03.25
My cosmic-comp always leak vram.
For me, this only leads to two problems - I have to reboot to free up space, and I don't have enough memory to load ollama llm after leak.
My gpu nvidia rtx 4090.

I noticed that memory leaks when opening and closing windows, for example when working with rubymine I lost 400mb after open/close.

I usually leak 5-6gb of vram in a work day.

nvidia-smi
Fri Mar 14 08:40:24 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   37C    P0             59W /  450W |    1908MiB /  24564MiB |      2%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                             115MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             28MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       26MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        424MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        239MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        286MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 08:48:21 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   41C    P0             69W /  450W |   21734MiB /  24564MiB |      1%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                             205MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             28MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       26MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        370MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        231MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        286MiB |
|    0   N/A  N/A            8784      C   ...ama-0.6.0/bin/.ollama-wrapped      19794MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 08:58:57 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   40C    P0             61W /  450W |    2706MiB /  24564MiB |      3%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                             404MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             28MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       26MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        482MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        231MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        260MiB |
|    0   N/A  N/A            9923      G   telegram-desktop                        458MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 10:28:02 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   37C    P0             60W /  450W |    3225MiB /  24564MiB |      1%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                             712MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             28MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       26MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        499MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        245MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        279MiB |
|    0   N/A  N/A            9923      G   telegram-desktop                        506MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version        105MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 10:55:35 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   40C    P0             61W /  450W |    2886MiB /  24564MiB |      4%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                             944MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             28MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       26MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        470MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        237MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        269MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version         96MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 11:13:01 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   44C    P0             62W /  450W |    3793MiB /  24564MiB |      3%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                            1335MiB |
|    0   N/A  N/A            4358      G   Xwayland                                  8MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             30MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       84MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        431MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        221MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        251MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version         96MiB |
|    0   N/A  N/A           38374      G   telegram-desktop                        466MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 11:20:36 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   40C    P0             62W /  450W |    3702MiB /  24564MiB |      2%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                            1793MiB |
|    0   N/A  N/A            4358      G   Xwayland                                 14MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             30MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       84MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        411MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        221MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        251MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version        100MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 11:57:11 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   39C    P0             60W /  450W |    4890MiB /  24564MiB |      7%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                            2359MiB |
|    0   N/A  N/A            4358      G   Xwayland                                 13MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             30MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       84MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        464MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        255MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        258MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version         96MiB |
|    0   N/A  N/A           44736      G   telegram-desktop                        514MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 13:15:53 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   39C    P0             61W /  450W |    6314MiB /  24564MiB |      1%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                            3631MiB |
|    0   N/A  N/A            4358      G   Xwayland                                 13MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             30MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       84MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        438MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        226MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        331MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version        107MiB |
|    0   N/A  N/A           58385      G   telegram-desktop                        638MiB |
+-----------------------------------------------------------------------------------------+
nvidia-smi
Fri Mar 14 18:20:36 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:2D:00.0  On |                  Off |
|  0%   40C    P0             61W /  450W |    6662MiB /  24564MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            4345      G   cosmic-comp                            4596MiB |
|    0   N/A  N/A            4358      G   Xwayland                                 13MiB |
|    0   N/A  N/A            4404      G   cosmic-panel                             32MiB |
|    0   N/A  N/A            4406    C+G   cosmic-app-library                       84MiB |
|    0   N/A  N/A            4410    C+G   cosmic-workspaces                        26MiB |
|    0   N/A  N/A            4420    C+G   cosmic-files-applet                     106MiB |
|    0   N/A  N/A            4424    C+G   ...bin/xdg-desktop-portal-cosmic         26MiB |
|    0   N/A  N/A            5164      G   kitty                                    66MiB |
|    0   N/A  N/A            5204      G   ...-136.0.1/bin/.firefox-wrapped        463MiB |
|    0   N/A  N/A            5538      G   ...ess --variations-seed-version        261MiB |
|    0   N/A  N/A            5589      G   ...and --variations-seed-version        273MiB |
|    0   N/A  N/A           15098      G   ...ess --variations-seed-version        117MiB |
|    0   N/A  N/A          125149      G   telegram-desktop                          6MiB |
+-----------------------------------------------------------------------------------------+

@wramalho
Copy link

Same issue for me. Through nvidia-smi it always start with 150mb VRAM usage (nice) and after 1-2 hours, it is up to 1.5GB

@WatchMkr WatchMkr moved this to Beta in COSMIC Epoch 1 Apr 2, 2025
@WatchMkr WatchMkr added this to the beta milestone Apr 2, 2025
@CarsonBurke
Copy link
CarsonBurke commented May 18, 2025

I believe this is still happening. 12 GB is pretty ridiculous (It's eating into my RAM that the iGPU shares with the cpu)

Image

About an hour later, another 1GB used.

Image

@Kvikal
Copy link
Kvikal commented May 29, 2025

Just chiming in as this affects me quite heavily as well.

VRAM usage starts low as expected but grows quite quickly, especially when entering/exiting workspace view (as mentioned in another issue), which can easily be 100MB+ for each enter/exit. VRAM seems to be exclusively allocated by cosmic-comp.

Image

GPU: AMD Radeon RX 9070 XT
Mesa: 25.0.5-1pop1~1747633989~24.04~be49689
Cosmic-comp: Latest as of right now (commit c5708cd)
OS: Pop-Os 24.04 Alpha7 (updated everything to the latest version as of today)

If there is anything that I could add to help debug this, let me know. Would really like to get this resolved as one of the bigger issues with current Alpha 7 for me.

@Drakulix
Copy link
Member
Drakulix commented Jun 3, 2025

Likely fixed by #1442

@grellanl
Copy link
grellanl commented Jun 3, 2025 9E81

Still seems to be happening, unfortunately.

cosmic-comp 0.1174888352924.04~4fa3113

Fresh boot, cosmic-comp at ~34mb VRAM
Accelerate the process by using workspace switcher (Super+W) a bunch of times (without running anything else) - cosmic-comp at ~800mb.

It builds up more gradually if I don't use workspace switcher, and instead just switch workspaces by shortcut.

@Kvikal
Copy link
Kvikal commented Jun 3, 2025

Can confirm that this is still happening at cosmic-comp 4fa3113 on my system. The allocation rate hasn't improved either it seems (at least for the enter/exit workspace view).

@ids1024
Copy link
Member
ids1024 commented Jun 3, 2025

@Kvikal Is that a single-GPU system, or do you also have an iGPU?

Does the memory usage rise caused by opening and closing cosmic-workspaces go back down if you killall cosmic-workspaces, or does it seem to be leaked in the compositor if when the client isn't running anymore?

@grellanl
Copy link
grellanl commented Jun 3, 2025

@ids1024 just tried killall cosmic-workspaces, and it freed up a chunk of VRAM immediately, down to about ~450mb... then brought usage up to a gig again (with Super+W) and then killall cosmic-workspaces brought it back down to the same number again.

@Kvikal
Copy link
Kvikal commented Jun 3, 2025

@ids1024 I have iGPU (AMD 9800X3D) + dGPU (AMD 9070 XT). Killing cosmic-workspaces does seem to free up the VRAM every time I have tried it.

@peterkrull
Copy link
Contributor
peterkrull commented Jun 3, 2025

Can confirm it still happens, Nvidia GTX 1060 (driver 570.153.02) single GPU setup (amd iGPU disabled in bios)

Running killall cosmic-workspaces does drop the cosmic-comp video memory consumption back where it was before opening the workspace view a bunch of times. However the increase that results from opening and closing a bunch of windows still remain.

@Kvikal
Copy link
Kvikal commented Jun 3, 2025

Also to note regarding single-GPU, this issue doesn't seem to occur on my other device which is a laptop with just iGPU.

@grellanl
Copy link
grellanl commented Jun 3, 2025

@Kvikal I have this on multiple machines with only a single desktop Nvidia GPU

@peterkrull
Copy link
Contributor

Tested on laptop with single iGPU (UHD Graphics 620), issue is still present

@ids1024
Copy link
Member
ids1024 commented Jun 3, 2025

Ah, ls /proc/$(pidof cosmic-workspaces)/fd | wc -l shows that there does seem to be a fd leak on showing and hiding cosmic-workspaces (on both AMD and Intel), so that's probably related here.

@ids1024
Copy link
Member
ids1024 commented Jun 3, 2025

Seems our subsurface supported in iced (or how cosmic-workspaces is using it) is leaking some SubsurfaceBuffers for some reason. And thus dmabuf fds.

@ids1024
Copy link
Member
ids1024 commented Jun 4, 2025

pop-os/cosmic-workspaces-epoch#193 seems to fix one issue there (I really should have done that already), and there also appears to be an issue to fix in our Iced fork to make sure that closing a window will free all the subsurface buffers.

If there's a completely unbounded VRAM leak (at least on some systems), that may be a third issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Beta
Development

No branches or pull requests

0