Skip to content
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

Maybe a leak in wgpuQueueSubmit() or wgpuSurfacePresent() on Windows #457

Open
friflo opened this issue Feb 12, 2025 · 0 comments
Open

Maybe a leak in wgpuQueueSubmit() or wgpuSurfacePresent() on Windows #457

friflo opened this issue Feb 12, 2025 · 0 comments

Comments

@friflo
Copy link

friflo commented Feb 12, 2025

I am currently implementing a C# wrapper on top of wgpu-native.
It works as expected. Like wgpu-native - very reliable!

Now I checked if there are any memory leaks.
To simplify observing leaks I disabled VSync by setting presentMode = WGPUPresentMode_Immediate.
Doing this will make leaks easier to observe as they grow faster.

A simple C# triangle example renders with ~11000 FPS (Vulkan) on Windows 11 with Nvidia RTX 4070.
I use the Task Manager and watch the "Memory" column to look for leaks.

In this case the memory grows ~100kb/sec. Which means ~8 byte/frame.

I made the same test on macOS with Mac Mini M2. The same application has no leak. Memory stays constant.
I am also sure the C# layer does not allocate anything.

So I decided to run the triangle example in wgpu-native.
After painful :) setup as a VS solution I got the example running.
(I failed to setup the make environment successful).

What I observed:
If I comment out either wgpuQueueSubmit() or wgpuSurfacePresent() there is no leak anymore.
It could be also the case that there is a leak is in the GPU driver.

Maybe someone else could confirm or disprove this behavior on Windows 11 with Nvidia driver.

WGPUAdapterInfo - Vulkan

description: 572.16
vendor: NVIDIA
architecture:
device: NVIDIA GeForce RTX 4070 SUPER
backend type: 6
adapter type: 0
vendorID: 10de
deviceID: 2783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant