I would like to grab the GPU memory usage (dedicated and shared) from my C# code. Are there any chances to get these infos via WDDM or performance counter? How does the Taskmanager get these infos?
Since I also need the usage of AMD cards in particular, I can unfortunately not use NVAPI for this.
There are 2 types of GPU memory - Dedicated Memory & Shared Memory. Dedicated memory remains smaller in size but GPU gives preference to this memory to do its operations. In C#, I have developed below code, which returns me the current usage of both these memories. You can cross verify the result in Task Manager.
Output: Console Output
Task Manager: Snip from task manager