简体   繁体   中英

D3DKMTQueryStatistics not found in d3dkmthk.h

I try to get the gpu usage for a running process programmatically. In previous posts, people refered to D3DKMTQueryStatistics which was part of the d3dkmthk.h header, but it looks like they removed D3DKMTQueryStatistics in one of the newer windows sdk versions. I'm using Windows SDK 10, 10.0.19041.0 and its gone.

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/nf-d3dkmthk-d3dkmtquerystatistics

C (Windows) - GPU usage (load %)

see the CollectReports method of gfxWindowsPlatform.cpp from Firefox source.

HMODULE gdi32Handle;
PFND3DKMTQS queryD3DKMTStatistics = nullptr;

if ((gdi32Handle = LoadLibrary(TEXT("gdi32.dll"))))
    queryD3DKMTStatistics = (PFND3DKMTQS)GetProcAddress(gdi32Handle, "D3DKMTQueryStatistics");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM