Skip to content

Improve the PresentMon SDK - #718

Open
gvinals wants to merge 1 commit into
GameTechDev:mainfrom
gvinals:gvinals/sdk_improvements
Open

gvinals wants to merge 1 commit into
GameTechDev:mainfrom
gvinals:gvinals/sdk_improvements

Conversation

@gvinals

@gvinals gvinals commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Improve PresentMon SDK discoverability and C usability

Ship metrics.csv and a minimal C FPS/GPU sample (with CMake) in the SDK
install, and make PresentMonAPI.h plain C so the SDK is easier for people
and LLMs to read and use.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sample cannot compile against the shipped header, and adapter selection and incremental packaging need correction.

3 open issues
What changed in this PR

This PR expands the installed PresentMon SDK with a metrics reference and a minimal sample for polling displayed FPS and GPU utilization.

Changes:

  • Adds the sample, its CMake build configuration, and build/run instructions.
  • Packages metrics.csv and the sample sources with the optional SDK feature.
  • Passes the new payload paths through CMake and MSBuild to WiX.
File Description
README-Service.md Documents SDK additions and sample usage.
IntelPresentMon/​Samples/​main.c Adds FPS and GPU utilization polling.
IntelPresentMon/​Samples/​CMakeLists.txt Configures sample linking and loader DLL copying.
IntelPresentMon/​PmonCMakePackaging.wixproj.props Exposes new SDK payload paths to WiX.
IntelPresentMon/​PMInstaller/​PresentMon.wxs Installs the metrics reference and sample files.
cmake/​PresentMonPackaging.cmake Supplies SDK payload paths to MSBuild.

Review effort: Balanced

Comment thread IntelPresentMon/Samples/CMakeLists.txt
Comment thread IntelPresentMon/Samples/main.c
Comment thread cmake/PresentMonPackaging.cmake
Ship metrics.csv and a minimal C FPS/GPU sample (with CMake) in the SDK
install, and make PresentMonAPI.h plain C so the SDK is easier for people
and LLMs to read and use.
@gvinals
gvinals force-pushed the gvinals/sdk_improvements branch from 153474e to f82f9cb Compare October 23, 2026 22:24
@gvinals
gvinals marked this pull request as ready for review October 23, 2026 22:25
@gvinals
gvinals requested a balanced review from Copilot October 23, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sample has unresolved PID validation and process-termination detection bugs.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment on lines +85 to +90
char* end = NULL;
unsigned long pidLong = strtoul(argv[1], &end, 10);
if (end == argv[1] || *end != '\0' || pidLong == 0ul || pidLong > 0xfffffffful) {
fprintf(stderr, "Invalid process id: %s\n", argv[1]);
return 1;
}
Comment on lines +177 to +178
if (!GetExitCodeProcess(hProcess, &processExitCode) ||
processExitCode != STILL_ACTIVE) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants