Mali Offline Compiler User Guide

Similar documents
Offline Shader Compiler. Mali. User Guide. Version: 3.0. Copyright ARM. All rights reserved. ARM DUI 0513B (ID032912)

GPU Offline Shader Compiler. Mali. User Guide. Version: 2.2. Copyright 2009 ARM. All rights reserved. ARM DUI 0513A (ID101409)

GPU Shader Library. Mali. User Guide. Version: 1.0. Copyright 2009 ARM. All rights reserved. ARM DUI 0510A (ID101409)

OpenGL ES 2.0 SDK for Android. Mali. User Guide. Version: Copyright 2011 ARM. All rights reserved. ARM DUI 0587A (ID120411)

GPU Shader Development Studio. Mali. User Guide. Version: Copyright ARM. All rights reserved. DUI0504B (ID072410)

Using the NEMA SHADER-Edit

PrimeCell Infrastructure AMBA 3 AXI File Reader Master (BP144)

GPU Shader Development Studio. Mali. User Guide. Version: Beta. Copyright ARM. All rights reserved. DUI0504C (ID011412)

AMBA Remap and Pause. Technical Reference Manual. Revision: r0p0. Copyright 1997 ARM Limited. All rights reserved. ARM DDI 0048AC

More performance options

ARMv8-A Synchronization primitives. primitives. Version 0.1. Version 1.0. Copyright 2017 ARM Limited or its affiliates. All rights reserved.

GPU Performance Analysis. Mali. User Guide. Version: 2.2. Copyright 2009 ARM. All rights reserved. DUI 0502A (ID101409)

Trace Debug Tools Version 1.2 Installation Guide

INTRODUCTION TO OPENCL TM A Beginner s Tutorial. Udeepta Bordoloi AMD

OPENCL TM APPLICATION ANALYSIS AND OPTIMIZATION MADE EASY WITH AMD APP PROFILER AND KERNELANALYZER

Integrator /CP Board Support Package for Microsoft Windows CE.NET

Copyright Khronos Group Page 1

Dave Shreiner, ARM March 2009

amdgpu Graphics Stack Documentation

SIMULATOR AMD RESEARCH JUNE 14, 2015

ARM Cortex processors

ARM. Streamline. Performance Analyzer. Using ARM Streamline. Copyright 2010 ARM Limited. All rights reserved. ARM DUI 0482A (ID100210)

AMD CORPORATE TEMPLATE AMD Radeon Open Compute Platform Felix Kuehling

ARM. Mali GPU. OpenGL ES Application Optimization Guide. Version: 3.0. Copyright 2011, 2013 ARM. All rights reserved. ARM DUI 0555C (ID102813)

SIGGRAPH Briefing August 2014

Copyright Khronos Group Page 1. Vulkan Overview. June 2015

Bifrost - The GPU architecture for next five billion

Secure software guidelines for ARMv8-M. for ARMv8-M. Version 0.1. Version 2.0. Copyright 2017 ARM Limited or its affiliates. All rights reserved.

Versatile Express. Boot Monitor. Reference Manual. Copyright ARM. All rights reserved. ARM DUI 0465F (ID110612)

SOLUTION TO SHADER RECOMPILES IN RADEONSI SEPTEMBER 2015

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

ARM. Mali GPU. OpenGL ES Application Optimization Guide. Version: 2.0. Copyright 2011, 2013 ARM. All rights reserved. ARM DUI 0555B (ID051413)

AMBA Peripheral Bus Controller

User's Manual. TM / BA /EU Purinter Remote Configuration Tool. Overview. Building the Environment. Using the Tool. M Rev.B

VIRTUAL GPU LICENSE SERVER VERSION AND 5.1.0

Cortex -A53 MPCore Processor Cryptography Extension ARM. Technical Reference Manual. Revision: r0p4

NVIDIA CUDA C GETTING STARTED GUIDE FOR MAC OS X

Jomar Silva Technical Evangelist

GETTING STARTED WITH CUDA SDK SAMPLES

Using SPIR-V in practice with SPIRV-Cross

Vulkan 1.1 March Copyright Khronos Group Page 1

TESLA DRIVER VERSION (LINUX)/411.98(WINDOWS)

HYCU SCOM Management Pack for F5 BIG-IP

Installation Guide and Release Notes

GRID SOFTWARE MANAGEMENT SDK

Texture Compression Tool. Mali. User Guide. Version: Copyright 2009, ARM. All rights reserved. DUI 0503E (ID092912)

HMS30C7110. uclinux Developer Guide. Multipurpose Network Processor. SNMP Working Guide. Hynix Semiconductor Inc. Version 0.1

Prospects for a more robust, simpler and more efficient shader cross-compilation pipeline in Unity with SPIR-V

DS-5 ARM. Using Eclipse. Version Copyright ARM. All rights reserved. ARM DUI 0480L (ID100912)

Shoviv MBOX Converter

DK2. Handel-C code optimization

GRID SOFTWARE FOR MICROSOFT WINDOWS SERVER VERSION /370.12

Intel Stress Bitstreams and Encoder (Intel SBE) 2017 AVS2 Release Notes (Version 2.3)

US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

CC Software version 1.5.0

OpenCL ICD Installation Guidelines. Khronos OpenCL Working Group. Version 2.2-7, Sat, 12 May :21:

Intel Integrated Native Developer Experience 2015 (OS X* host)

SUPPORT MATRIX. HYCU OMi Management Pack for Citrix

Khronos Group Conformance Process

VIRTUAL GPU SOFTWARE MANAGEMENT SDK

D3D12 & Vulkan: Lessons learned. Dr. Matthäus G. Chajdas Developer Technology Engineer, AMD

Achieving High-performance Graphics on Mobile With the Vulkan API

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

ROCm: An open platform for GPU computing exploration

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

NVIDIA Tesla Compute Cluster Driver for Windows

Versity Software Update Overview

FAQs Data Sources SAP Hybris Cloud for Customer PUBLIC

TESLA DRIVER VERSION (LINUX)/411.82(WINDOWS)

GRID SOFTWARE FOR HUAWEI UVP VERSION /370.28

GRID SOFTWARE FOR RED HAT ENTERPRISE LINUX WITH KVM VERSION /370.28

DesktopPlayer for Mac

Cg Toolkit. Cg 2.0 May 2008 Release Notes

CUDNN. DU _v07 December Installation Guide

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Sample for OpenCL* and DirectX* Video Acceleration Surface Sharing

ARM Firmware Suite v1.4 Installation Guide

Getting Started. NVIDIA CUDA C Installation and Verification on Mac OS X

GRID SOFTWARE FOR HUAWEI UVP VERSION /370.12

Qualcomm Snapdragon Profiler

Stonesoft User Agent. Release Notes for Version 1.1.3

Cg Toolkit. Cg 2.0 January 2008 Release Notes

IBM Rational Rhapsody TestConductor Add On. Testing on a Linux Target

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

ARM. Compiler toolchain v4.1 for. Creating Static Software Libraries with armar. Copyright 2011 ARM. All rights reserved. ARM DUI 0590A (ID061811)

VIRTUAL GPU SOFTWARE R384 FOR RED HAT ENTERPRISE LINUX WITH KVM

NVIDIA VOLTA DEEP LEARNING AMI

ServerStatus Installation and Operation Manual

CREATING AN NVIDIA QUADRO VIRTUAL WORKSTATION INSTANCE

HMS30C7110. uclinux Developer Guide. Multipurpose Network Processor. Interrupt Controller Guide. MagnaChip Semiconductor Ltd. Version 0.

Veritas System Recovery 18 Linux Edition: Quick Installation Guide

Blackbox ProTM User Guide

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

Cisco UCS Performance Manager Release Notes

Cg Toolkit. Cg 1.4 rc 1 Release Notes

NVIDIA CUDA INSTALLATION GUIDE FOR MAC OS X

PMC-BiSerial-III SDLC 8-Channel SDLC Interface

LogiCORE IP 3GPP LTE Turbo Encoder v1.0 Bit-Accurate C Model. 3GPP LTE Turbo. [optional] UG490 (v1.0) April 25, 2008 [optional]

Avigilon Control Center 6 System Integration Guide

Transcription:

Mali Offline Compiler 6.0.0 User Guide ARM Limited 2017

Introduction 2

Contents 3 Contents Chapter 1: Introduction... 5 Overview... 6 Installation Package... 6 This Release...6 Chapter 2: Installation... 7 Supported Platforms...8 Linux and OSX... 8 Windows... 8 Chapter 3: Usage...9 Using the Mali Offline Compiler... 10 Sample Shaders... 10 Testing a Shader...10 Prerotate... 10 OpenCL...11 Vulkan... 11 Chapter 4: Known Issues... 13 Compilation of a vertex shader may fail with the error "Register allocation failed for vertex shader"...14 Offline compiler libraries crash when using unsupported extensions... 14 Mali Offline Compiler does not support SPIR-V entry point names... 14 Chapter 5: Maintenance...15 Supported Driver Versions... 16 Support... 18 Chapter 6: Legal...19 Proprietary Notice...20

Contents 4

Chapter 1 Introduction Topics: Overview Installation Package This Release

Introduction 6 Overview The Mali Offline Compiler is a command line tool that compiles vertex, fragment, compute, geometry, tessellation control, and tessellation evaluation shaders written in the OpenGL ES Shading Language (ESSL), or kernels written in OpenCL C, or Vulkan SPIR-V binary modules and prints information about the compiled code. Shaders can be used in the OpenGL ES 2.0, 3.0, 3.1, and 3.2 APIs, and kernels can be used in the OpenCL 1.1, and 1.2 APIs. SPIR-V modules can be used in the Vulkan 1.0 API. Vertex, fragment, compute, geometry, tessellation control, and tessellation evaluation shaders can be compiled into binary shaders that you can link and run on a Mali GPU. The resulting binary file must be moved to the target platform, read in by the application, and given as parameter in a call to the appropriate OpenGL ES function. You can use the Mali Offline Compiler to: Pre-compile shaders into binary code that you can distribute with your application. The binary code is then passed to the OpenGL ES API as an alternative to shader source code. Binary shaders reduce the time it takes to load a shader load time. Assist software development, by checking that shaders compile properly without having to pass them through an OpenGL ES application. Optimize your shaders by collecting feedback about the number of cycles each execution of the shader takes when you run it on the GPU. Ship your application with pre-compiled binary shaders instead of the OpenGL ESSL source code that is required if you use the on-target compiler. Note: Using the Mali Offline Compiler is optional. Because a particular binary shader can only be used on one type of GPU, using compiled shaders reduces portability. If you require portability, you can use the on-target Compiler which enables the OpenGL ES drivers to compile OpenGL ESSL shader code or Vulkan SPIR-V binary code dynamically when application runs on a target platform. Binary output is currently not available for OpenCL kernels. For OpenCL, the Mali Offline Compiler can only be used to test the validity of OpenCL kernels and to view information about the compiled code. Installation Package The installation package for the Mali Offline Compiler contains everything you need to start compiling OpenGL ES shader code and OpenCL kernels on a desktop computer. You should have downloaded the installation package appropriate to your platform. The Mali Offline Compiler is available for Windows, Linux, and Mac OS X. On Linux and Windows it comes in both 32- bit and 64-bit variants. On Mac OS X only a 64-bit version is available. Typically, you should download the package that most closely resembles your host environment. If you aren't sure which package to choose, the 32-bit version will work across the widest variety of platforms. This Release This release adds the Mali-Gxx r6p0 and Mali-T600 r18p0 driver. Mali-G51 / r0p0, r0p1, r1p0 support has been added. Support for Vulkan SPIR-V has been added.

Chapter 2 Installation Topics: Supported Platforms Linux and OSX Windows

Installation 8 Supported Platforms The Mali Offline Compiler has been tested on the following platforms: Microsoft Windows 7 x86 Microsoft Windows 7 x64 Ubuntu Linux 14.04 x86 Ubuntu Linux 14.04 x64 Mac OSX 10.9 x64 Linux and OSX On Linux and OSX, the Mali Offline Compiler is provided as a tgz package that can be extracted to any location on disk. This package can be extracted using any modern version (i.e. > 1.13) of GNU tar: tar xvzf Mali_Offline_Compiler_v6.0.0.853d74_<platform>_<arch>.tgz Windows On Windows, the Mali Offline Compiler is provided as both a zip package that can be extracted to any location on disk, and as an executable installer package. To install the software, run the installer and follow the instructions on screen. A link to the installed Mali Offline Compiler directory will be added to the Start menu. By default, the malisc executable file will be located in: C:\Program Files\ARM\Mali Development Tools\Mali Offline Compiler v6.0.0 The installer will add the install location to your PATH environment variable so you can access malisc from any location.

Chapter 3 Usage Topics: Using the Mali Offline Compiler Sample Shaders Testing a Shader Prerotate OpenCL Vulkan

Usage 10 Using the Mali Offline Compiler On Windows, if you used the installer, the Mali Offline Compiler installation folder will be automatically added to the PATH environment variable, allowing you to run the malisc executable from the command line in any working directory. Otherwise, if you used the Windows zip or the Linux or OSX tgz archives, you will either need to run malisc from the folder you extracted the archives to, or to manually add this folder to the PATH environment variable. To see the full list of available options and further help information, on Windows run: malisc --help or on Linux and Mac OS X, run:./malisc --help Sample Shaders Some sample shaders are provided in the 'samples' folder in the Mali Offline Compiler installation directory. Testing a Shader After compiling a shader, it can be tested as follows: 1. Load the compiled shader into an OpenGL ES application using a call to glshaderbinary. 2. Draw geometry using the shader. 3. Examine the visual output. If unsatisfactory, alter the uniforms used to control the shader, or use a different shader. Note: If a shader pair, consisting of a vertex shader and a fragment shader, is successfully compiled using the Offline Compiler, the linking stage cannot fail because of resource constraints. Linking only fails if the uniform or varying variables of the shaders are incompatible. Prerotate Device manufacturers integrating certain ARM Mali devices can choose to enable or disable a 'prerotate' option. If prerotate is enabled on your device it will not be able to load non-prerotate binary shaders. If you select an offline compiler driver which supports prerotate ('supports prerotate will be shown when the --list option is passed in) two binaries will be produced by the offline compiler: 1. Prerotate binaries (output-filename.prerotate) can be loaded on all devices but performance is expected be lower. 2. Non-prerotate binaries (output-filename.non-prerotate) will only work on non-prerotate drivers but performance is expected to be better. For best compatibility, we suggest that developers use the prerotate binary. For best performance, you can try to load the non-prerotate shader, and, if an error is returned, then load the prerotate shader instead. Code for this might look like: #include <GLES2/gl2.h> #include <GLES2/gl2ext.h>...

Usage 11 vertex_shader = glcreateshader(gl_vertex_shader); glshaderbinary(1, &vertex_shader, GL_MALI_SHADER_BINARY_ARM, non_prerotate_binary, length); error = glgeterror(); if(error == GL_INVALID_VALUE) { int errorlog_length; glgetshaderiv(vs, GL_INFO_LOG_LENGTH, &errorlog_length); char* errorlog = malloc(errorlog_length * sizeof(char)); glgetshaderinfolog(vertex_shader, errorlog_length, NULL, errorlog); /* * If the non-prerotate binary is not supported then you will see the * following message in the errorlog: * ---- "The driver is too new for the shader. Try to upgrade your * compiler." * in this case you should use the prerotate binary instead, e.g. * glshaderbinary(1, &vertex_shader, GL_MALI_SHADER_BINARY_ARM, * prerotate_binary, length); */ }... OpenCL OpenCL support is currently only available on Linux and Mac OS X. The OpenCL C language allows you to use header files in your source code, with the #include preprocessor directive. The directory that the Offline Shader Compiler looks in to resolve any relative path header inclusions, such as #include header.h, is the current working directory. Absolute path header inclusions, such as #include /work/header.h, may also be used. Alternatively, multiple source files can be passed in to malisc. If multiple source files are specified, they will be concatenated together in the order that they were passed in. Vulkan The Mali Offline Compiler accepts Vulkan SPIR-V binary modules. You can create a SPIR-V binary module from a shader written in ESSL using glslang. Note that shaders written using Vulkan-specific features cannot be compiled as OpenGL ES SL shaders by the Mali Offline Compiler.

Usage 12

Chapter 4 Known Issues Topics: Compilation of a vertex shader may fail with the error "Register allocation failed for vertex shader" Offline compiler libraries crash when using unsupported extensions Mali Offline Compiler does not support SPIR-V entry point names

Known Issues 14 Compilation of a vertex shader may fail with the error "Register allocation failed for vertex shader" Status Affected compiler: Mali-400 series Description MaliGP2 has only limited internal bandwidth between its registers and execution units. In some rare cases, the register allocator for MaliGP2 in the shader compiler runs into a situation where there are more operations executed in one cycle than can be fed from the registers simultaneously. The compiler aborts the compilation in this case. Implications Some very big or very complex vertex shaders fail to compile. Workaround Changing the shader code slightly will often eliminate the problem. Try to rewrite some of the shader to do the calculations differently. Offline compiler libraries crash when using unsupported extensions Status Affected compiler: Mali-T600 series r3p0-00rel0 Description If the shader being compiled uses unsupported extensions, the compiler will crash. Implications It is not obvious when unsupported extensions are used. It is not possible to get shader statistics for these shaders. Workaround Check for extensions in the shader if the compiler crashes. Identify the unsupported extensions by removing them systematically and recompiling. Mali Offline Compiler does not support SPIR-V entry point names Status Affected compiler: all the compilers supporting SPIR-V modules. Description Current implementation does not allow to specify the entry point name to be used. Implications It is not possible to compile SPIR-V modules containing one or more entry points whose name is not main. Workaround Compile different stage shaders into separate SPIR-V binary modules and make sure the entry point name is main.

Chapter 5 Maintenance Topics: Supported Driver Versions Support

Maintenance 16 Supported Driver Versions Mali Offline Compiler Version Mali-400 Series Driver Mali-T600 Series Driver Mali-Gxx Series Driver 2.3 r2p2 3.0.0 r2p3-01rel10 4.0.0 r3p1-01rel1 r1p0-04rel0 4.1.0 r3p1-01rel1 r2p1-00rel0* 4.2.0 r3p1-01rel1 r2p1-00rel0* 4.3.0 r3p1-01rel1 r2p1-00rel0* 4.4.0 r4p0-00rel1 r2p1-00rel0* 4.5.0 r4p0-00rel1 4.6.0 r4p0-00rel1 5.0.0 r4p0-00rel1 5.1.0 r4p0-00rel1 r2p1-00rel0* r2p1-00rel0* r5p1-00rel0 r5p1-00rel0 r6p0-00rel0 r5p1-00rel0 r6p0-00rel0 5.2.0 r4p0-00rel1

Maintenance 17 Mali Offline Compiler Version Mali-400 Series Driver Mali-T600 Series Driver Mali-Gxx Series Driver r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 5.3.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0 5.4.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0 r11p0-00rel0 r12p0-00rel0 5.5.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0 r11p0-00rel0 r12p0-00rel0 r13p0-00rel0 5.6.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0

Maintenance 18 Mali Offline Compiler Version Mali-400 Series Driver Mali-T600 Series Driver Mali-Gxx Series Driver r11p0-00rel0 r12p0-00rel0 r13p0-00rel0 5.7.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0 r11p0-00rel0 r12p0-00rel0 r13p0-00rel0 r17p0-00rel0 6.0.0 r4p0-00rel1 r6p1-00rel0 r5p1-00rel0 r6p0-00rel0 r8p0-00rel0 r9p0-00rel0 r10p0-00rel0 r11p0-00rel0 r12p0-00rel0 r13p0-00rel0 r17p0-00rel0 r18p0-00rel0 r6p0-00rel0 * These driver versions are not available for Mac OSX. These driver versions are not available for Windows. Support For further support on this product, please visit the ARM Connected Community. It should be noted that continuing support of the product is at ARM s discretion unless explicitly included in a current contract between ARM and you.

Chapter 6 Legal Topics: Proprietary Notice

Legal 20 Proprietary Notice Words and logos marked with or TM are registered trademarks or trademarks of ARM Limited in the EU and other countries, except as otherwise stated below in this proprietary notice. Other brands and names mentioned herein may be the trademarks of their respective owners. OpenGL is a registered trademark and the OpenGL ES logo is a trademark of Silicon Graphics Inc. used by permission by Khronos. OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos. Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc. SPIR and the SPIR logo are trademarks of the Khronos Group Inc. Windows is a registered trademark of Microsoft Corporation in the United States and other countries. The Mali OpenCL compiler library is based on and incorporates portions of LLVM Version 3.5. The LLVM source code is available from the LLVM website. Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder. The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM Limited in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded. This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss for damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.