one descriptorPool per DescriptorSet cause high cpu and gpu memory consumption in version 1.51
yaoyao-cn opened this issue · 5 comments
after i update to v1.51, the memory consumption of cpu and gpu become incredible high, and vkCreateDescriptorPool returns VK_ERROR_OUT_OF_DEVICE_MEMORY
and i found the difference here:
The-Forge/Common_3/Renderer/Vulkan/Vulkan.cpp
Line 4892 in da36bb4
am i missing somthing?
How many DescriptorSet structs do you have?
about 20k DescriptorSet used for per draw word matrix and texture params, i use the-forge for a CAD program, 20k drawcalls is very common.
when use version 1.5 there seems no problem. but now the 8G gpu shared memory can be used up and vkCreateDescriptorPool return VK_ERROR_OUT_OF_DEVICE_MEMORY
i know i can use a storge buffer for my matrix and use dynamic descripor set, but what about the texture param if bindless is not support on target device
thank you(^_^)
If all the 20k descriptor sets are using the same root signature, you can allocate just one DescriptorSet struct with mMaxSets=20k. We will take a look on our side as well if this doesn't resolve your issue
@manas-kulkarni it works !
thank you very much! your idea makes gpu memory usage even lower than version 1.5, now it only takes about 100M shared gpu memory. i think i shoud matain a descriptor set list created with large mMaxSets per root signature and create new descriptor set on demand.
and here:
https://github.com/ConfettiFX/The-Forge/blob/master/Common_3/Renderer/Vulkan/Vulkan.cpp#L4877
i use tf_malloc instead alloca in case of stack overflow when mMaxSets is too big
thank you again! and merry christmas !
Glad that it worked. We will fix that alloca call in next release. Happy Holidays!