4.5 Using GPUVerify to validate OpenCL kernels

GPUVerify is a tool that can test whether an OpenCL kernel is free from various issues, including intra-group data races, inter-group data races, and barrier divergence.

GPUVerify is a stand-alone application and is not provided by Graphics Analyzer. Download it from the Imperial College website, GPUVerify: a Verifier for GPU Kernels. Before using it with Graphics Analyzer, Arm recommends that you get it working in a stand-alone context, using its own documentation.

To use GPUVerify with Graphics Analyzer, you must first point Graphics Analyzer to the binary in your GPUVerify directory. Click Edit > Preferences and fill in the Path to GPUVerify field, as shown here:

Figure 4-7 Preferences dialog


If you enter an invalid path in this field, Apply and OK are grayed out.

When tracing an OpenCL application, Graphics Analyzer captures calls to all OpenCL 1.2 functions, including clCreateProgramWithSource, clCreateKernel, clCreateKernelsInProgram, and clEnqueueNDRangeKernel. It then uses the data from these functions to get:

  • The names of all the OpenCL kernels.
  • The source code associated with the OpenCL kernels.
  • Any run-time parameters that are known at this point, for example the local and global workgroup sizes.

To run any of the kernels that were found in a trace through GPUVerify, select a function call in the trace with live kernel objects, then select Debug > Launch GPUVerify. You are presented with the following dialog:

Figure 4-8 Run kernel through GPUVerify dialog


The Kernel drop-down list shows all the kernel objects that are live and have available source code at the currently selected function call. Source code is only available to Graphics Analyzer for kernels that have been created from a program that was created using clCreateProgramWithSource followed by clBuildProgram. If the kernel you expect to see is not in the list, ensure that you have selected a function call where that kernel object is live and that the kernel was created using the described method.

After you have selected a kernel from the drop-down list, the Local Work Size, Global Work Size, and Kernel Build Options fields are populated with all the information Graphics Analyzer has available. You can pick the local and global work sizes from the drop-down lists, which are populated from the enqueue history of the kernel. Alternatively enter them manually as a comma-separated list of numbers. The number of dimensions of the local and global sizes must match. If invalid options are entered, an error box is displayed, giving more information. There are no restrictions to the Kernel Build Options field, though GPUVerify might output an error if the options are unsupported.

The output for GPUVerify is shown in the Graphics Analyzer Console view.

Non-Confidential - RELPDF file icon PDF version101545__00_en
Copyright © 2020–2022, 2024 Arm Limited or its affiliates. All rights reserved.