Powershell has the useful Get-Counter
tool. In particular, I'm interested in:
(Get-Counter -Counter '\GPU Process Memory(*)\Total Committed').CounterSamples
I want to find a similar solution in C#, i.e. calculate GPU memory values for each running process. My searches on the Internet were unsuccessful, maybe I use infidels keywords for the search.
Right now I'm calling this method in C# workaround:
using (PowerShell PS_GPUProcessMemory =
PowerShell.Create().AddScript(@"(Get-Counter -Counter '\GPU Process Memory(*)\Total Committed').CounterSamples"))
{
//Do something
}
However, how can I do without Powershell? How to use C# to find GPU memory values for each running process? thanks