PresentMon gives us a peek under the hood of DirectX 12 games

One worry that's arisen from game developers' move to DirectX 12 and the Universal Windows Platform is its potentially chilling effect on benchmarking and frame-time monitoring. Good old Fraps doesn't work with DirectX 12 apps like Ashes of the Singularity or UWP apps like Gears of War: Ultimate Edition yet. There's some hope, though. Friend of TR and Intel graphics guru Andrew Lauritzen released a tool called PresentMon today that gives us an independent look into the performance of DX12 apps.

Put simply, PresentMon uses counters from a Windows facility called Event Tracing for Windows (in a manner that Lauritzen says is similar to Microsoft's own GPUView tool) to give us frame times for DirectX 12 apps in a comma-separated-values file. That's quite useful for the type of benchmarking we like to perform at TR. Here's a rough graph of some random data we collected from Gears of War: Ultimate Edition:

And here's a look at one from the Ashes of the Singularity DirectX 12 benchmark:

Pretty cool, huh?

PresentMon does take some work to get running, though. You'll need to download the repository from GitHub, grab Visual Studio Express Community 2015, and open the PresentMon.vcxproj file from the repository in the IDE. After Visual Studio grabs some required updates, just build the solution and you'll get an x64 directory in your project folder. Look inside the "Debug" or "Release" folder in that x64 directory, depending on your settings, and you'll see a PresentMon executable.

In its current form, PresentMon is a command-line app. I found it easiest to use by copying the Debug or Release folder from the steps above to my desktop, then navigating to the folder from the command line. At the bare minimum, users will need to run "PresentMon.exe -process-name " from a command prompt, which launches a monitoring window for the game in question. Exiting the PresentMon executable (or the app it's logging) will stop logging. Full documentation is available on the PresentMon GitHub page.

Our thanks to Andrew for making this invaluable tool available to the public.

Comments closed
    • jihadjoe
    • 4 years ago

    This is awesome! Now pretty much any game (or any program that does graphics) can be used as a benchmark, and without needing to capture each individual frame with FRAPS or using external hardware like FCAT.

    • auxy
    • 4 years ago

    Thanks Andrew and team!

    I’m really glad to have this tool in the community, but I do have to say that I wish it wasn’t necessary.

    I hope Microsoft releases a bunch of games on UWP and they sell abysmally so that they end up shutting down the whole thing like they did with Kinect recently. [sub<] (If you didn't hear, Microsoft shut down or "restructured" five studios within Microsoft Game Studios on the 7th, all of which were heavily invested in Kinect development.)[/sub<] [sub<][i<]edited for clarity[/i<][/sub<]

      • sweatshopking
      • 4 years ago

      You don’t understand why people might want to have a built in native store where purchases carry across from desktop to mobile to tv?! Sometimes auxy, I wonder about you.

        • anotherengineer
        • 4 years ago

        He is back!!!!

        • auxy
        • 4 years ago

        [code<]STRAWMAN T \|/ R O A .-|-. W ^ M / \ A ===== N | | | [/code<]

        • biffzinker
        • 4 years ago

        Wait a second, where are you getting TV? Shouldn’t you of said Xbox in place of TV?

    • anotherengineer
    • 4 years ago

    hmmmmm look how flat that GoW graph is………..25ms so 40fps.

    So was that GPU or CPU limited or frame capped?

      • Jeff Kampman
      • 4 years ago

      Some form of Vsync is on on a 165Hz monitor 😉

        • jessterman21
        • 4 years ago

        Yep, looks like it’s stuck at 55, then 41.25fps

    • NTMBK
    • 4 years ago

    PresentMon used Event Tracing! It’s super effective!

    • DrDominodog51
    • 4 years ago

    What system call is being tracked by this?

      • Andrew Lauritzen
      • 4 years ago

      Present, hence “PresentMon” 🙂

        • DrDominodog51
        • 4 years ago

        Something that explains the software is [i<]present[/i<] in the title. 😀

        • Meadows
        • 4 years ago

        Most game menus are rendered nowadays, how does one exclude the first X frames from the results?

          • Airmantharp
          • 4 years ago

          By editing the .csv?

            • Meadows
            • 4 years ago

            Fine, let me clarify. How do you know where to edit it (where the actual game footage begins)?

            A ready state and a hotkey to start logging potentially works best but I can’t see if it does that.

            • Jeff Kampman
            • 4 years ago

            I actually left some frames from the trailing edges of the time spent in the menu at the start of these graphs. Menus often render at silly framerates (or fixed framerates), so it’s relatively easy to see where the transition from menu to game happens.

            • Andrew Lauritzen
            • 4 years ago

            You can actually start the tool at any time you want… since it doesn’t need to “hook” any applications, you can go through the menus and get into game before you even start collecting data if you want.

    • chuckula
    • 4 years ago

    PresentMon: He isn’t just for Christmas in Jamaica anymore!

      • CuttinHobo
      • 4 years ago

      I swear, chuckula… Jamaican me crazy!

    • Pancake
    • 4 years ago

    Fraps sits on the page flip command and tracks when it occurs. I think most programmers working on DX/OGL would already be doing that to monitor how their code behaves – I certainly did. It would be trivial for Fraps to be updated to include that for DX12. We’re talking like about 10 lines of code here.

      • brucethemoose
      • 4 years ago

      Unfortunately, Fraps hasn’t been updated in 3 years.

      • Andrew Lauritzen
      • 4 years ago

      FRAPS could be made to work with DX12, yes, but not universal windows applications. Those are sandboxed in such a way that hooking is not possible so all the usual suspects simply won’t work.

        • Klimax
        • 4 years ago

        Hooking-based methodology was always problematic. (And causing often quite some trouble, also not really supported outside of few special cases) For example FRAPS doesn’t work at least with some COD games. (Ghosts for sure) ETW-based measurement should work universally and is recommended way. (HW-based counters are exception, those require bit different approach)

    • south side sammy
    • 4 years ago

    not so sure I like sound of ” the Universal Windows Platform” too much!

    • EzioAs
    • 4 years ago

    Thanks for the tool Andrew.

      • Andrew Lauritzen
      • 4 years ago

      I should note that a colleague was responsible for the tool. I just tweeted about it because he doesn’t have a twitter account 🙂

      I’ll pass on the sentiment though!

Pin It on Pinterest

Share This