Skip to content

Large memory usage for variable-count descriptor sets #13667

Description

@baldurk

Environment:

  • OS: Windows 10 (also tested on linux)
  • GPU: nVidia 4070 (AMD 7900 on linux)
  • VVL version (SDK version or commit): c1e7387
  • Additional settings (synchronization, GPU-AV, etc): syncval & GPU-AV enabled

Describe the issue

I have a test VK_Descriptor_Variable_Count that creates many descriptor sets with a descriptor layout that is potentially huge (descriptor with bindingCount=100000) but every descriptor set allocated from it is tiny (bindingCount=2 with one having bindingCount=100 just so they're not all identical). I use this specifically to test RenderDoc to ensure I don't allocate things based on the max declared size but on the real size, since the delta can be large for some applications.

When running this with GPU-AV enabled I see a large amount of memory used, I think because GPU-AV is allocating things based on the larger size.

Test (Reproduce)

For me this reproduces with RenderDoc's demo project when gpu validation is enabled. The project lives on github either demos.sln on windows or demos/CMakeLists.txt for linux (I haven't tested on linux but I have no strong reason to expect that this is platform specific).

Attached is a binary build of the exe for convenience: demo_binary.zip

In either case it needs glslang or glslc in the path. Then run with demos_x64 VK_Descriptor_Variable_Count --debug --gpuva and it will enable the validation layers.

Extra Info

I believe the allocation is coming from DescriptorSetSubState::CreateDescriptorEncodingBuffer(), it sizes the buffer based on base.GetNonInlineDescriptorCount() which looks directly at the descriptor set layout's declared size and that doesn't have the variable-alloc information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GPU-AVGPU Assisted ValidationcurrentIssues currently being worked on

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions