I am looking for a reliable way to determine the current GPU memory usage, preferably in C ++ / C. I found many ways to get use, for example, the following methods:
- Direct drawing
- Dxdiag
- Wmi
- Dxgi
- D3d9
These methods are not accurate enough (most of them are one hundred megabytes). I tried nvapi.h , but I did not see anything that I could use for a memory request. I thought that only the methods listed above were the only parameters, but then I came across a tool called GPU-Z , which gives me accurate readings in memory to the nearest megabyte, even when OpenCL almost completely loads my 580GTX. I can verify that I am at the peak of memory usage by allocating a few more megabytes before OpenCL returns the return code of Object_Allocation fail .
Looking at import from GPU-Z, I see nothing interesting except:
kernel32.dll: LoadLibraryA, GetProcAddress, VirtualAlloc, VirtualFree
My guess is LoadLibraryA should be used to load a dll to request GPU memory and sensors. If this DLL exists, where does it live? I am looking for a solution for AMD and NVidia, if possible (using different APIs is ok).
roboto1986
source share