• Advertisement
Sign in to follow this  

Monitor GPU memory usage

This topic is 744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been thinking awhile to write a GPU memory monitor for my 3d application (basically it tracked how much gpu memory my application committed). The most straight forward way I can think of is tracking the API calls to CreateCommitedResource, and for every call to that function, I added the buffer size to a global variable (of course decrease as resource been released). The problem with this method is that it's hard to calculated the right buffer size, since there are so called subresources (especially for texture buffer), so we cannot just do the calculation based on width, height and format.... (also for pure gpu buffer resource, can we trust the buffersize we provided as real GPU mem usage?) 

 

So how do you guys track the gpu memory usage? How could we calculate the right buffer size from GPU point of view? do you guys use such functions like GetRequiredIntermediateSize to help calculate the actual needed memory?

 

Thanks

Share this post


Link to post
Share on other sites
Advertisement

Sounds like you want to call IDXGIAdapter3::QueryVideoMemoryInfo and look at the CurrentUsage across both the LOCAL and NON_LOCAL pools.

 

ID3D12Device::GetResourceAllocationInfo will tell you how much memory a particular resource uses after all hardware specific padding / alignment has been taken into account.

 

Thanks Adam, that exactly what I want (my bad, should have looked through APIs before asking...) 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement