9.2.3 Diagnosing graphics software stack problems with GRM

GRM provides ready-made functions for you to diagnose problems from the GPU drivers easily. They help you examine the driver on OpenGL ES executions and the GPU accesses.

The available functions are:

Examining OpenGL ES executions in driver with Error Code Check

GRM provides an Error Code Check function to examine the OpenGL ES executions in the driver. It can identify errors from the target, the host, and GGA. You can use it to examine any OpenGL ES API in your application.

About the task

Error Code Check generates errors for those APIs that created different error codes from the target and the host drivers. From the errors, you see the problematic APIs and the root causes. For the error descriptions, see Error messages from Error Code Check.

Before you begin

Make sure:

Procedure

  1. Open the settings.ini file.
  2. In the file, set:
    #1: Enable. 0: Disable.
    checkErrorCode 1
  3. To examine all OpenGL ES APIs in use, in the settings.ini file, set:
    #1:Enable. 0:Disable.
    enableErrorCheckWhiteList 0
  4. To check specific APIs:
    1. In settings.ini, set enableErrorCheckWhiteList to 1.
    2. Open the checkerrcode.ini file, and then set 1 to the interested APIs.

    Note:

    checkerrcode.ini is located in the same directory as settings.ini. For the directory, see Booting Android graphics software stacks with GRM.
  5. Boot the software stack as described in Booting Android graphics software stacks on virtual GPU.
Results

The abnormal APIs and their error information are shown on the host, like the following:

ERROR [RECONCILER] gles20_glCopyTexSubImage2D Inconsistent error code detected. host=0x0501, target=0x0502

In this message, 0x0501 and 0x0502 are the error codes retrieved from the host and the target drivers respectively.

For more details about the error messages, see Error messages from Error Code Check.

Error messages from Error Code Check

Error messages reported by Error Code Check can help you troubleshoot OpenGL ES APIs issues.

The messages show errors from the target GPU drivers, GGA, and Mali OpenGL ES Emulator. GGA and the emulator are on the host. The corresponding messages are like the following:

  • When an API error is generated from the target GPU driver, the message is like the following:

    ERROR [RECONCILER] gles20_glCopyTexSubImage2D Inconsistent error code detected. host=0x0501, target=0x0502

    Here:

    • gles20_glCopyTexSubImage2D is the problematic API.
    • 0x0501 and 0x0502 are the error codes retrieved from the host and the target drivers respectively.

      Note:

      The API error codes are defined in the OpenGL ES header file.
  • When the error is from GGA, the message is like the following:

    FATAL [RECONCILER] glProgramParameteri() Could not find program object descriptor for target-side program id [0]

    Here, glProgramParameteri() is the problematic API.

    Note:

    For GGA errors, report them directly to the ARM account team.
  • When the error is from the Mali OpenGL ES Emulator, the message is like the following:

    FATAL-Exception thrown in GLES32Api::glUniformMatrix4fv -> Underlying OpenGL error in GL33Backend.
    See Fatal error logs for full details. This is probably a programming error, please report it.

    Note:

    For Mali emulator errors, report them directly to the ARM account team.

    For details about the Mali OpenGL ES Emulator, see Mali OpenGL ES Emulator User Guide.

  • When the error is from the host GPU driver, applications can execute wrongly or system failures can occur.

Tracing accesses to the GPU registers

GRM offers the Trace and Dump function to track the driver accesses to the GPU registers in real time.

About this task

You can use this function to monitor and detect the driver accesses to the GPU registers during execution.

Before you begin

Make sure:

  • The software stack is successfully boot up on the virtual GPU.

    For details, see Booting Android graphics software stacks on virtual GPU.

  • The Fast Models package contains GenericTrace.so on Linux, or GenericTrace.dll on Windows.

    GenericTrace.so specifies the hardware resources to be tracked, and defines the trace information to be retrieved for these resources. It is located in: $PVLIB_HOME/plugins/Linux64_GCC-4.8/Release.

    You can define your own trace library with Fast Models Model Trace Interface. For details, see Fast Models Model Trace Interface.

Procedure

  1. From the host, execute the following command to list the virtual GPU and the resources in the GPU to be traced:
    ${PATH_Model} --plugin $PVLIB_HOME/plugins/Linux64_GCC-4.8/Release/ListTraceSources.so
    The terminal shows:
    • The virtual GPU:

      Component (292) providing trace: Kits3_Subsys.css.gpu
    • The resources in this GPU to be traced, which are registers of different usages.

      For the Mali‑G71 GPU model, these registers are:

      • INFO_ReadRegister: Outputs the access time, addresses, data, and names for all read registers.
      • INFO_Reset: Outputs the GPU reset data.
      • INFO_WriteRegister: Outputs the access time, addresses, and names for all write registers, and the data before and after the write actions.
      • WARN_ReadToWriteOnlyRegister: Outputs warning messages and addresses for write-only registers that were read by the driver.
      • WARN_WriteToReadOnlyRegister: Outputs warning messages and addresses for read-only registers that were written to by the driver.
      • WARN_AccessToUnimplementedRegister: Outputs warning messages and addresses for invalid registers that were accessed by the driver.
  2. Start the real-time trace by booting the software stack as described in Booting Android graphics software stacks on virtual GPU, except the following.
    When you enter the boot command as described in Boot commands, add the following commands:
    --plugin $PVLIB_HOME/plugins/Linux64_GCC-4.8/Release/GenericTrace.so \
    -C TRACE.GenericTrace.trace-sources=Kits3_Subsys.css.gpu.* \
    -C TRACE.GenericTrace.enabled=1 \
    -C TRACE.GenericTrace.verbose=1 \
    -C TRACE.GenericTrace.print-timestamp=1 \
    -C TRACE.GenericTrace.trace-file=dp-trace-generic.log

    In these commands:

    • Kits3_Subsys.css.gpu is the virtual GPU obtained from Step 1.

      • To trace all its supported registers, add the suffix '*'. For instance, Kits3_Subsys.css.gpu.*.

      • To trace a specific type of registers, add the register type name as the suffix. For instance, Kits3_Subsys.css.gpu.INFO_ReadRegister.

      • To trace multiple types of registers, separate them with ','. For instance, Kits3_Subsys.css.gpu.INFO_ReadRegister, Kits3_Subsys.css.gpu.INFO_WriteRegister

    • dp-trace-generic.log is the log file used in this example to save the traced results.

      Note:

      Using a log file to save the trace results is optional. Without this option, all trace results are only shown on the host terminal.

    For more details about these trace commands, see GenericTrace.

  3. (Optional) Execute graphics applications to examine more accesses.
Results:

From the host terminal or the log file, you see the driver-accessed registers in detail, such as the register addresses, contained data, and their access time.

The following example shows the output:

HOST_TIME=1557460.545195s INFO_ReadRegister: REG_OFFSET=0x0000000000000000 VALUE=0x60000000 REG_NAME="GPU_ID"
HOST_TIME=1557460.545266s INFO_ReadRegister: REG_OFFSET=0x0000000000000004 VALUE=0x07130206 REG_NAME="L2_FEATURES"
HOST_TIME=1557460.545279s INFO_ReadRegister: REG_OFFSET=0x0000000000000008 VALUE=0x00000000 REG_NAME="SUSPEND_SIZE"
HOST_TIME=1557460.545291s INFO_ReadRegister: REG_OFFSET=0x000000000000000c VALUE=0x00000809 REG_NAME="TILER_FEATURES"
HOST_TIME=1557460.545303s INFO_ReadRegister: REG_OFFSET=0x0000000000000010 VALUE=0x00000001 REG_NAME="MEM_FEATURES"
HOST_TIME=1557460.545316s INFO_ReadRegister: REG_OFFSET=0x0000000000000014 VALUE=0x00002830 REG_NAME="MMU_FEATURES"
HOST_TIME=1557460.545325s INFO_ReadRegister: REG_OFFSET=0x0000000000000018 VALUE=0x000000ff REG_NAME="AS_PRESENT"
HOST_TIME=1557460.545334s INFO_ReadRegister: REG_OFFSET=0x000000000000001c VALUE=0x00000007 REG_NAME="JS_PRESENT"
HOST_TIME=1557460.545345s INFO_ReadRegister: REG_OFFSET=0x00000000000000c0 VALUE=0x0000020e REG_NAME="JS0_FEATURES"
HOST_TIME=1557460.545362s INFO_ReadRegister: REG_OFFSET=0x00000000000000c4 VALUE=0x000001fe REG_NAME="JS1_FEATURES"
HOST_TIME=1557460.545364s INFO_ReadRegister: REG_OFFSET=0x00000000000000c8 VALUE=0x0000007e REG_NAME="JS2_FEATURES"
Non-ConfidentialPDF file icon PDF versionARM 100965_1101_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.