1

I am using NVAPI, I can get some performance data by calling this function:

NvAPI_GPU_GetDynamicPstatesInfoEx

But don't know how to get video memory usage. I find some c# codes call this function to get it.

NVAPI.NvAPI_GPU_GetMemoryInfo

But there is no the same function in NVAPI.

Any idea?

Dean Chen
  • 3,800
  • 8
  • 45
  • 70

2 Answers2

2

Does it have to be in NVAPI? If not, check out Nvidia PerfKit: http://developer.nvidia.com/nvidia-perfkit

pomeroy
  • 1,377
  • 1
  • 12
  • 21
2

In case somebody still needs this, you can use this library:

https://github.com/falahati/NvAPIWrapper


  1. Find the right GPU using the NvAPIWrapper.GPU.PhysicalGPU.GetPhysicalGPUs() static method.
  2. Use the NvAPIWrapper.GPU.PhysicalGPU.MemoryInfo property to get the total memory, available memory and other information relative to memory.
Soroush Falahati
  • 2,196
  • 1
  • 27
  • 38
  • I think for what OP asked you are using NvAPI_GPU_GetPhysicalFrameBufferSize (which is call from nvapi if somebody need it) if I checked the repo properly... – CJ_Notned Apr 28 '22 at 11:45