Comments (2)
I used the following console app to reproduce that:
// GPUWaitGlitch.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "Windows.h"
#include "PresentMonAPI.h"
#define MAX_FRAMES 1024
#define MAX_STEPS 10000
int main()
{
STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
char szCmdLine[] = "Text3D_D3D9.exe";
if (CreateProcess(NULL, szCmdLine, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
PM_SESSION_HANDLE session;
if (pmOpenSession(&session) == PM_STATUS_SUCCESS)
{
if (pmStartTrackingProcess(session, pi.dwProcessId) == PM_STATUS_SUCCESS)
{
PM_QUERY_ELEMENT queryElements[]
{
{ PM_METRIC_CPU_BUSY , PM_STAT_NONE, 0, 0 },
{ PM_METRIC_CPU_WAIT , PM_STAT_NONE, 0, 0 },
{ PM_METRIC_GPU_LATENCY , PM_STAT_NONE, 0, 0 },
{ PM_METRIC_GPU_BUSY , PM_STAT_NONE, 0, 0 },
{ PM_METRIC_GPU_WAIT , PM_STAT_NONE, 0, 0 },
};
PM_FRAME_QUERY_HANDLE frameQuery;
uint32_t dwBlobSize = 0;
if (pmRegisterFrameQuery(session, &frameQuery, queryElements, _countof(queryElements), &dwBlobSize) == PM_STATUS_SUCCESS)
{
LPBYTE lpBlob = new BYTE[dwBlobSize * MAX_FRAMES];
for (DWORD dwStep=0; dwStep<MAX_STEPS; dwStep++)
{
uint32_t dwFrames = MAX_FRAMES;
do
{
PM_STATUS err;
err = pmConsumeFrames(frameQuery, pi.dwProcessId, lpBlob, &dwFrames);
if ((err == PM_STATUS_SUCCESS) ||
(err == PM_STATUS_NO_DATA))
{
if (dwFrames)
{
for (DWORD dwFrame=0; dwFrame<dwFrames; dwFrame++)
{
LPBYTE lpFrame = lpBlob + dwFrame * dwBlobSize;
double cpuBusy = *(double* )(lpFrame + queryElements[0].dataOffset);
double cpuWait = *(double* )(lpFrame + queryElements[1].dataOffset);
double gpuLatency = *(double* )(lpFrame + queryElements[2].dataOffset);
double gpuBusy = *(double* )(lpFrame + queryElements[3].dataOffset);
double gpuWait = *(double* )(lpFrame + queryElements[4].dataOffset);
std::cout << "Frametime : " << cpuBusy + gpuBusy << " ms, GPU wait : " << gpuWait << " ms\n";
}
}
}
else
std::cout << "Failed to consume frames!\n";
}
while (dwFrames == MAX_FRAMES);
Sleep(100);
}
delete[] lpBlob;
pmFreeFrameQuery(frameQuery);
}
else
std::cout << "Failed to register frame query!\n";
pmStopTrackingProcess(session, pi.dwProcessId);
}
else
std::cout << "Failed to start process tracking!\n";
pmCloseSession(session);
}
else
std::cout << "Failed to open session!\n";
}
else
std::cout << "Failed to spawn process!\n";
}
from presentmon.
Thanks for reporting the issue and the sample source. We'll take a look at it.
from presentmon.
Related Issues (20)
- Add capability to monitor CPU power draw and CPU temperature
- CPUBusy always shows up as equal to FrameTime HOT 12
- Presentmon Initialization Error HOT 21
- Question about VR HOT 2
- Won't allow me to force a process ID HOT 1
- Feature request - Histogram & Feedback HOT 2
- PresentMon 2.0 & Phoenix Point game - Overlay not working HOT 2
- GPU Wait shows wrong data for some games in windowed mode HOT 2
- Request: Please still provide information about Present calls w/ 2.0 metrics` HOT 4
- Please add GPUStart QPC timestamp reporting to service/console application HOT 3
- No stdout flush in console PresentMon 2.0. Is it intended? HOT 5
- PresentMon console app report lower fps after system idle for a while on AMD GPU HOT 4
- PresentMon installer does not allow alternative installation paths HOT 4
- Lose iFlip if the overlay is brought up. HOT 1
- [Feature Request] show system RAM and SWAP usage
- can't track Unreal Engine HOT 1
- Display the Presented FPS (X%) metric as the Xth percentile of FPS, not the Xth percentile of (frame)times
- When Arc Control recording is on, 99% FPS is abnormally low
- [Feature Request] Change Location of Config Folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presentmon.