#RAM leaking in Vulkan apps

1 messages · Page 1 of 1 (latest)

tiny condor
#

GPU - 9070XT
Driver - 26.3.1
VulkanSDK - 1.4.341.1
OS - Win 11 Pro 25H2, build 26200.8037

I am building a rendering engine using Vulkan. I've noticed a huge RAM leak in my code. It became apparent as I was doing some testing in IMMEDIATE rendering mode. I've tested multiple codebases with Vulkan to make sure that it's not my bug. Some of my tests in immediate mode resulted with the RAM usage spike up to 4GB.

The easiest way to reproduce is to run the "vkcube" application that comes bundled with the VulkanSDK. The longer the app runs the larger the RAM usage becomes and appears to be increasing indefinitely.

I've also done some debugging using my own custom memory allocators in Vulkan with dynamic rendering. I have found out that, in my case, for every queue submission, some allocations are created in the instance scope. 1/3 of the allocations are never released by the Vulkan instance.

golden talon
#

The memory leak you are seeing is likely caused by a combination of new hardware drivers and the high speed of IMMEDIATE mode. Because this mode allows for extremely high frame rates, the driver is forced to create a massive amount of tracking data for every frame you submit. The driver is essentially being "spammed" with so much work that its internal garbage collection cannot keep up or is losing track of the pointers.

Try switching to FIFO mode or limiting your frame rate to see if the leak slows down or stops. If it does, the hardware is fine, but the driver needs a cap on how much metadata it manages at once. You can also use AMD’s specific tools like rocprofv3 to trace exactly which part of the driver is holding onto the RAM, or set your environment variable AMD_LOG_LEVEL to 4 to see detailed debug logs.

A question for you. Does the memory continue to climb if you minimize the window while the app is running in IMMEDIATE mode?
If YES: It is a vkQueueSubmit / Driver leak.
If NO: It is a vkQueuePresent / WSI / Windows 11 25H2 Flip Model leak.

Hope this is helpfull and if you need any further assistance please let me know

tiny condor
#

Thank you very much for the quick response.

I've retested it. If I minimize the window the app is still leaking. I've also tested FIFO mode, it climbs infinitely but at a very slow rate. It takes about an hour to climb to 100MB.

Also, huge thanks for the suggestion for rocprofv3. So far, I don't know what it is but I will look into it.

golden talon
amber ridge