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

Suggestion/Request: Access to vmaCalculateStats #99

Open
Silverlan opened this issue Aug 23, 2018 · 3 comments
Open

Suggestion/Request: Access to vmaCalculateStats #99

Silverlan opened this issue Aug 23, 2018 · 3 comments
Assignees
Labels

Comments

@Silverlan
Copy link
Contributor

Silverlan commented Aug 23, 2018

As far as I can tell, Anvil uses the VMA library, which includes the function vmaCalculateStats, which is handy for determining how much memory is currently in use (approximately) for each memory type.
It would be useful to get access to that function (or something similar) through Anvil, for benchmarking and debugging purposes.

@DominikWitczakAMD
Copy link
Contributor

There's a couple of problems if we were to re-use their implementation:

  1. There's another memory allocator backend supported by Anvil, called "one-shot". It doesn't provide similar functionality
  2. Memory allocators can be released at any time. This means any info gathered by VMA allocator 1 is going to be lost the moment it is destroyed.
  3. What if you had two VMA allocators? vmaCalculateStats() takes VmaAllocator instance. This means we'd need Anvil's memory allocator to sum info returned by the function before passing it down to the app.
  4. VMA does not support mGPU (ie. the device group extensions), while public Anvil is just about to :)

That being said, if you feel like this is something that could come in handy, I believe it shouldn't be a lot of effort to provide memory usage information per each created Vulkan instance. Would that work?

@Silverlan
Copy link
Contributor Author

Absolutely, all I really need is a way to retrieve the total amount of memory my program has allocated on the GPU.
Thank you!

@DominikWitczakAMD
Copy link
Contributor

Does EXT_memory_budget support, which is already implemented in Anvil, address this request? At this point, adding manual tracking of the allocated device-local memory feels like duplicating the functionality provided by the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants