Open xiaopengli89 opened 2 months ago
Is this a new leak?
Is this a new leak?
No, it can be reproduced on older versions of wgpu, but there is no leak on the 27.x.x.x driver, maybe it's a driver bug.
I understand that the water example is a reproducer, so that's in principle all we need to look into this. But if you're able to, it would be nice to get a smaller test case, since water is one of the most complex of the examples.
I have the same problem, but I'm using wgpu-native.
Specs:
RTX 3090 TI
WGPU version: 22.1.0.5
Backend: Vulkan, DX12 (doesn't depend on particular backend)
It looks like wgpu-core\src\device\queue.rs::PendingWrites::temp_resources
was not released somewhere. I don't know rust and can't tell the reason.
Allocation stack trace:
I made reproduction example in rust https://github.com/cprkv/wgpu_mem_leak (in wgpu-native I do same things, so it has no difference, situation reproduces).
My guess is that uniform buffer is being used by GPU when I write to it. I took this approach from wgpu examples, and there is no comment if it does something wrong. I don't know if there is a correct example of how to do queue_write_buffer
right.
I have to add this after some experiments:
It happens to both backends (Vulkan and DX12) in wgpu-native, but for some reason everything is fine for DX12 in wgpu (rust). Only Vulkan backend has noticeable leakage. I also tried using triple buffering technique (create 3 buffers and use it in round-robin manner), it doesn't help.
Description DX12 backend has memory leaks on some Intel drivers.
Repro steps
Extra materials
Platform Windows 10, wgpu 22.0