pop-os / cosmic-workspaces-epoch

GNU General Public License v3.0
17 stars 11 forks source link

Repeated drag-and-drop causes out-of-memory error in wgpu #40

Open ids1024 opened 2 months ago

ids1024 commented 2 months ago
thread 'main' panicked at /home/ian/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/20fda69/wgpu/src/backend/wgpu_core.rs:2990:5:
wgpu error: Validation Error

Caused by:
    In Device::create_buffer
      note: label = `image upload buffer`
    Not enough memory left.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I guess iced_sctk is not destroying the drag surface buffers properly? Though looking at it I don't see anything obviously wrong...

ids1024 commented 2 months ago
sudo bpftrace -p $(pidof cosmic-workspaces) -e 'uprobe:libvulkan:vkCreateWaylandSurfaceKHR { @ptr = arg3; } uretprobe:libvulkan:vkCreateWaylandSurfaceKHR { printf("Create Vulkan surface %d\n", *@ptr); }  uprobe:libvulkan:vkDestroySurfaceKHR { printf("Destroy Vulkan surface %d\n", arg1) }'

It seems all the Vulkan surfaces are being destroyed correctly, at least...

ids1024 commented 2 months ago

renderdoc doesn't seem to recognize the API being used by cosmic-workspaces, so I'm not sure it can help.

cat /proc/$(pidof cosmic-workspaces)/maps | grep i915 | wc -l seems to suggest that showing and hiding workspaces sometimes, at least, also leaks buffers.

ids1024 commented 2 months ago

Ah, the same thing seems to happen with upstream Iced in the multi_window example. So it's presumably an iced_wgpu bug and not related to iced-sctk.