If you have ever experienced the London Underground rail system you will no doubt have heard the voice intoning the phrase “mind the gap” at many stations. Every time I hear that, I feel like shouting “fix the gap”! When I joined the Fast Models team and started speaking to partners it soon became apparent that we had a major gap. Frequently, I ended up having to explain that we didn’t have Fast Models of the Mali GPUs and why that was the case.
Now, with Fast Models 11.0 released earlier this month, we have fixed the gap.
The challenge of modelling GPUs in a programmer’s view environment is that the modelling techniques used to create efficient CPU models doesn’t map well to GPUs. We needed a different approach. For Virtual Prototypes with ARM Fast Models we have implemented a solution with two components: the Generic Graphics Accelerator (GGA) and GPU Register Models (GRM).
The first part of the solution introduced was the Generic Graphics Accelerator. The GGA utilises the GPU on the host workstation where the Fast Model is running to accelerate the graphics calls in the target software stack. The purpose of the Generic Graphics Accelerator is to support software integration at the application level. You can use it to develop and run applications that use OpenGL ES version 2.0, 3.0, or 3.1 APIs. The following image shows the GGA set up, the GGA components are the ones highlighted.
The OpenGL ES calls in the software stack are intercepted and routed out through a side channel in the Fast Model platform. These are converted to OpenGL calls by the Mali OpenGL ES emulator. The emulator is free to download from the ARM website (https://developer.arm.com/products/software-development-tools/graphics-development-tools/opengl-es-emulator). The OpenGL calls are executed by the workstation’s native graphics driver and GPU. The results are read back into a buffer in the Fast Models reconciler and, if there is a suitable display model in the virtual prototype, displayed on a virtual LCD. The GGA has been extensively tested with a range of Host GPU solutions including devices from AMD, Intel and Nvidia. The Fast Models User Guide documents the current level of compatibility, the minimum level of OpenGL compatibility required, the recommended drivers, etc.
Using the GGA enables multiple HD frames to be processed per second. This compares very favourably versus a software emulation of the graphics calls which can take many seconds to process a single frame. A question we often get asked is whether servers or compute farms can be used to run the virtual prototype. Here a host GPU may not be present. Two solutions exist: use a software renderer as an alternative to the GPU or use a remote GPU. We are pursuing the latter approach as it offers higher performance.
As you can gather from the description, the Generic Graphics Accelerator does not provide any hardware interface and completely replaces any existing GPU driver software stack on the target. That is, it is not useful for development or integration of the real driver stack that will run on the final device. To support the real driver stack integration, use the GGA in conjunction with a Mali GPU Register Model.
Using a GRM enables developers to examine the graphics software stack integration with GPU by using a virtual GPU. This enables a developer to detect problems from drivers and applications. The first GRM introduced is for the Mali-G71 with Fast Models 11.0. The current implementation is compatible with Android 4.4.2 (KitKat), 6.0.1 (Marshmallow), and 7.0 (Nougat) and OpenGL ES versions 2.0, 3.0, and 3.1. GRMs for other Mali GPUs such as the Mali-G61 and Mali-G72 are in development for future delivery.
The following diagram shows how the GRM meshes with the GGA. The additional components here are the Mali Driver in the software stack, this is unmodified from the driver that will run on the target hardware, and the GRM instantiated in the Fast Models platform.
The combination of the GGA and GRM allows you to run and debug the full Mali software stack on a Virtual Prototype ahead of having a hardware target.
To make use of the GRM and GGA you will need a virtual prototype built with Fast Models, optionally integrated into the solutions provided by our EDA partners. The Fast Models User Guide explains how to do this and how to build a software stack to run on the platform.
To aid getting started we provide an example FVP (Fixed Virtual Prototype) that includes the GGA and the Mali-G71 GRM. The FVP can be accessed from the developer.arm.com website (see end of blog for a link to the relevant location). This page contains more information on the FVPs and links to downloads. Under the “System Guidance for Mobile” heading you will see the SGM-775 platform which is the first FVP that we developed to include the GGA and GRM. You will need to register before being able to download the FVP.
To obtain the software stack to run on the FVP – boot code, trusted firmware and Android go to the https://developer.arm.com/products/system-design/system-guidance page. Here you will find the instructions on how to download the software.
Finally, to debug the code running on the FVP, ARM DS-5 Ultimate Edition includes configurations to connect to the SGM-775 FVP. When you bring these elements together, you will have a setup that looks something like the following.
Here you can see two windows from the FVP. The one to the right shows the simulation status indicating the instruction counts for each core and its run status. To the left of that is the simulated LCD, in this case driven by the Mali-DP650 Fast Model.
The third window is the DS-5 GUI, in this case showing the cores in the DynamIQ cluster of Cortex-A75 and Cortex-A55 cores along with the disassembly from one of those cores.
Virtual prototypes have been proven to be beneficial in accelerating time to market for new SoCs by enabling software development ahead of silicon availability. The availability of GRMs, underpinned by the performance delivered by the GGA expands this capability to include the graphics subsystem.
To find out more about virtual prototypes and to evaluate the new solutions for Mali GPUs, visit the Fixed Virtual Prototypes page on developer.arm.com.
We have indeed “fixed the gap”.
OpenCL support is a feature that we are investigating. But we don't have a date that can be shared in a public forum.
When is it likely that OpenCL compatible Generic Graphics Accelerators might be available in ARM Fast Model simulation?