Intel® Graphics Performance Analyzers Framework: API Debug Layer
Learn how to turn on the validation layer for your graphics API and how the API Debug Layer in Intel® Graphics Performance Analyzers Framework (Intel® GPA Framework) can help you understand precisely how the GPU is running your code.
Hello Folks – Welcome back to our Intel Graphics Performance Analyzers video series, Intel GPA Framework, Quick Tips. I am Pamela Harrison, Software TCE for the Intel GPA team. I am back with more insights for how to use Intel GPA Framework to help with your profiling workflow.
In this video, we will discuss the API Debug Layer. It can help you understand precisely how the GPU is executing your code.
This layer turns on the validation layer for your graphics API. You can add this layer during capture with gpa-injector and the executable of your application. You can also add this layer during playback with gpa-player and a stream that you previously captured.
Without any additional flags, the default command supports D3D12 and Vulkan*. The additional three flags support D3D12 at this time. We plan to add Vulkan support for these in the future.
The API Debug Layer, by default, prints all detected validation information from the API validation layer to stdout.
You will see messages of different severity, including incorrect image layout warnings, invalid barriers, explanations for object creation errors and others.
Here you don’t see any issues because this small sample has been optimized.
For the *optional* flags to the api-debug-layer, you will get additional information, as follows.
The first, gpubasedvalidation, exposes Microsoft’s SetEnableGPUBasedValidation data.
This mode allows the DirectX* validation layer to perform more thorough validation on the GPU. This mode is particularly useful for root causing device removed crashes. Due to its nature, this mode will slow down the workload or playback significantly.
The second of these options, flushafterexecute, only makes sense while playing back a stream. It forces a GPU flush after each command list execution call. This basically means that when the ExecuteCommandLists call returns from the layer, the command lists have already finished executing on the GPU. When you experience a GPU crash, this mode can help narrow down which command list is causing that crash.
And the final option that is available concerns device removal.
The API-debug-layer, in default mode, detects if a device was removed because of any ill-formed commands on the GPU. By default the check is performed after every API call.
If the device removal event is detected, the layer prints breadcrumb information provided by the DirectX runtime.
However, if you need even more reliable device removal detection, use the asyncdeviceremovalcheck option. This option launches an additional thread that performs the device removal detection asynchronously.
This concludes our short overview of our API-debug layer.
Thanks for watching!
Try out the api-debug-layer, and tune in for our next Quick Tip for more insights on profiling with Intel GPA Framework.
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.