vulkano icon indicating copy to clipboard operation
vulkano copied to clipboard

Some examples leaking memory on resize

Open Saetch opened this issue 3 years ago • 10 comments

Info

  • Version of vulkano: latest/0.29.0
  • OS: Windows 11 Home (10.0.22000)
  • GPU (the selected PhysicalDevice): NVIDIA GeForce RTX 3060
  • GPU Driver: 511.79 (DCH)

Issue

Some examples, including the one in the vulkano.rs guide slowly leak memory if resized. Memory usage is constant if the window is not resized but will steadily increase the more I resize the window. This occurs in the image examples, as well as some others like texture_array and runtime_array, but not in all examples. The ones like teapot and referred do not leak at all for me.

Saetch avatar May 22 '22 20:05 Saetch

I can confirm that this is an issue, I have had it happen with the triangle example, I thought it was just the fact that I typed it out myself instead of copy and pasting because I was trying to learn how it worked, but after noticing the issue I just copy and pasted it to find it still happens.

Astralchroma avatar May 23 '22 12:05 Astralchroma

@Peter-Crawley what are your system and driver details?

Rua avatar May 23 '22 12:05 Rua

@Rua

Vulkano 0.29.0 OS: Arch Linux x86_64 Kernal: 5.17.9-zen1-1-zen Window Manager: i3wm (X11) GPU: AMD RX580 CPU: Ryzen 2200G Driver: Whatever the latest driver on the Arch repository is.

Astralchroma avatar May 23 '22 12:05 Astralchroma

Tried to reproduce on Windows 10 with NV 1080 Ti (driver 527.56), but on my machine using https://github.com/vulkano-rs/vulkano/commit/10d734955633aad8fe816d5cd12e6f3728749539 I do not experience a memory leak running either image or texture_array.

I tried both resizing through multiple "resize motions" (with mouse up) and frantically dragging the mouse all over the place to no avail.

trevex avatar Dec 10 '22 21:12 trevex

Me and @YouSafe have just observed this on Linux and Windows both using NVIDIA, but only in the teapot example when resizing.

@Saetch @Astralchroma could you please confirm whether this issue still occurs in the latest master with the examples you mentioned or the teapot example?

marc0246 avatar Oct 14 '23 12:10 marc0246

Never expected I would be mentioned in a PR a year later heh. Anyway, just checked and yes it is still memory leaking on resize in the teapot example. Details below:

  • Version: Git Commit 9d1251e
  • OS: Arch Linux x86_64
  • Kernel: 6.5.6-zen2-1-zen
  • Compositor: Hyprland (Wayland)
  • CPU: AMD Ryzen 3 2200G
  • GPU: AMD Radeon RX580
  • Driver: Mesa 23.2.1-arch1.2

Astralchroma avatar Oct 16 '23 07:10 Astralchroma

Thanks a lot! So the issue has been solved for the other examples then?

marc0246 avatar Oct 16 '23 08:10 marc0246

I only checked the teapot example, I can check others if that would be helpful.

Astralchroma avatar Oct 16 '23 11:10 Astralchroma

Indeed that would be appreciated. The original issue was about examples other than teapot, which seems to have been fixed at some point.

marc0246 avatar Oct 16 '23 14:10 marc0246

False alarm, I can still observe the leaks as well on Windows (but not on Linux), in these examples:

  • image
  • image-self-copy-blit
  • immutable-sampler
  • push-descriptors
  • runtime_array
  • runtime-shader
  • texture_array
  • async-update
  • buffer-allocator
  • clear_attachments
  • indirect
  • instancing
  • multi-window
  • tessellation
  • triangle
  • triange-v1_3

In other words, the examples which draw to a surface and don't leak for me are:

  • deferred
  • interactive_fractal
  • multi_window_game_of_life
  • teapot (this wasn't leaking at all in 0.29, and so is unrelated, bisection needed)
  • occlusion-query
  • simple-particles (this one is leaking without doing anything, so probably unrelated; unfortunately this example didn't exist in 0.29 so hard to test)

@YouSafe are you sure these don't leak for you on Windows?

This is going to be tricky to debug, especially since there seem to be 3 unrelated leaks going on. Just a heads up: if anyone tests the examples around 0.29, there was a 4th unrelated leak which is now fixed, in the indirect and interactive_fractal examples.

marc0246 avatar Oct 16 '23 17:10 marc0246