The GPU profiling feature discussed in my previous post includes a not-very-obvious customization mechanism:
- Graphics / Start Diagnostics, use Print Screen to capture frames, then return to Visual Studio
- Open up the folder that contains the resulting .vsglog capture file (eg. right-click on GraphicsExperiment1.vsglog and select Open Containing Folder)
- In this folder you will see a file named something like GraphicsExperiment1.vsglog.GraphicsFrameAnalysisParameters.xml
- Edit this XML to configure GPU performance analysis settings
- Now when you select the Frame Analysis tab and click on the Click here label, these new settings will be used
Yes yes, I know – we simply didn’t have time to make a better UI for these options :-) Although most people will be fine with the defaults, we figured it was still worth exposing this XML file for more advanced users to tweak things to their preference.
Interesting settings to adjust:
<ExperimentRepeatCount> (default 5). This controls how many times each measurement is repeated, which is done to measure standard deviation and be able to tell which measurements result from noise other than the actual thing we are trying to measure. Turn it down to 1, and analysis will run much faster but you will no longer be able to tell if some results are due to random noise. Increase it, and you will get more accurate results even if the underlying data is noisy, but you might have to wait a while (perhaps leave such an analysis running while you go to lunch).
<Variant ID=”X”>. These elements control which experiments (changing viewport size, MSAA, filtering, reduced texture dimensions, etc.) are carried out. Deleting ones you don’t need will speed up the analysis. If you only care about the baseline time per draw call, delete all but variant #0 for the fastest possible analysis (#0 is the baseline, which cannot be turned off).
<Variants HardwareCounterMode=”Default”>. This controls whether we will collect and display any hardware-specific counter values reported by the D3D driver (as exposed via the ID3D11Device::CreateCounter API and D3D11_COUNTER_DEVICE_DEPENDENT_0). The resulting data can be valuable for understanding GPU performance, but unfortunately not all drivers properly support this functionality, so by default we collect counters only on specific devices where we recognize the driver and know it will do the right thing. Hardware counters will be collected automatically on new Windows Phone 8.1 devices, but not on desktop PCs where we have no way to be sure what the driver will do if we call that API! If you are feeling brave, change the “Default” setting to “ForceEnable” and see what happens. On my dev PC the result is:
The analysis tool returned an error.
so I guess my driver does not properly support ID3D11Device::CreateCounter 🙁