Shahbaz Youssefi | 9544002 | 2019-02-01 16:36:09 -0500 | [diff] [blame] | 1 | # Using External Benchmarks with ANGLE |
| 2 | |
| 3 | This document contains instructions on how to run external benchmarks on ANGLE as the GLES renderer. |
| 4 | There is a section for each benchmark with subsections for each platform. The general theme is to |
| 5 | make the benchmark application pick ANGLE's `libGLESv2.so` and `libEGL.so` files instead of the |
| 6 | system ones. |
| 7 | |
| 8 | On Linux, this is generally achieved with setting `LD_LIBRARY_PATH`. On Windows, ANGLE dlls may |
| 9 | need to be copied to the benchmark's executable directory. |
| 10 | |
| 11 | ## glmark2 |
| 12 | |
| 13 | This benchmark can be found on [github](https://github.com/glmark2/glmark2). It's written against |
| 14 | GLES 2.0 and supports Linux and Android. It performs tens of tests and reports the framerate for |
| 15 | each test. |
| 16 | |
| 17 | ### glmark2 on Linux |
| 18 | |
| 19 | To build glmark2 on Linux: |
| 20 | |
| 21 | ``` |
| 22 | $ git clone https://github.com/glmark2/glmark2.git |
| 23 | $ cd glmark2 |
| 24 | $ ./waf configure --with-flavors=x11-glesv2 --data-path=$PWD/data/ |
| 25 | $ ./waf |
| 26 | ``` |
| 27 | |
| 28 | To run glmark2 using the native implementation of GLES: |
| 29 | |
| 30 | ``` |
| 31 | $ cd build/src |
| 32 | $ ./glmark2-es2 |
| 33 | ``` |
| 34 | |
| 35 | To run glmark2 using ANGLE, we need to first create a few links in the build directory of ANGLE: |
| 36 | |
| 37 | ``` |
| 38 | $ cd /path/to/angle/out/release |
| 39 | $ ln -s libEGL.so libEGL.so.1 |
| 40 | $ ln -s libGLESv2.so libGLESv2.so.2 |
| 41 | ``` |
| 42 | |
| 43 | Back in glmark2, we need to make sure these shared objects are picked up: |
| 44 | |
| 45 | ``` |
| 46 | $ cd /path/to/glmark2/build/src |
| 47 | $ LD_LIBRARY_PATH=/path/to/angle/out/release/ ldd ./glmark2-es2 |
| 48 | ``` |
| 49 | |
| 50 | With `ldd`, you can verify that `libEGL.so.1` and `libGLESv2.so.2` are correctly picked up from |
| 51 | ANGLE's build directory. |
| 52 | |
| 53 | To run glmark2 on the default back-end of ANGLE: |
| 54 | |
| 55 | ``` |
| 56 | $ LD_LIBRARY_PATH=/path/to/angle/out/release/ ./glmark2-es2 |
| 57 | ``` |
| 58 | |
| 59 | To run glmark2 on a specific back-end of ANGLE: |
| 60 | |
| 61 | ``` |
| 62 | $ ANGLE_DEFAULT_PLATFORM=vulkan LD_LIBRARY_PATH=/path/to/angle/out/release/ ./glmark2-es2 |
| 63 | ``` |
Cody Northrop | f9cc785 | 2019-02-06 07:59:45 -0700 | [diff] [blame] | 64 | |
| 65 | ### glmark2 on Linux for Android |
| 66 | |
| 67 | **Prerequisites** |
| 68 | |
| 69 | Below steps are set up to use version 26.0.1 of build-tools, which can be downloaded here: |
| 70 | |
| 71 | [https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip](https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip) |
| 72 | |
| 73 | Tested with r19 of NDK, which can be downloaded here: |
| 74 | |
| 75 | [https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip](https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip) |
| 76 | |
| 77 | Tested with OpenJDK 8: |
| 78 | |
| 79 | ``` |
| 80 | sudo apt-get install openjdk-8-jdk |
| 81 | ``` |
| 82 | |
| 83 | Note: This is built from a branch that has fixes for Android. It only supports |
| 84 | 32-bit ARM (armeabi-v7a). Supporting other ABIs requires more work, possibly |
| 85 | including a move to cmake instead of ndk-build. |
| 86 | |
| 87 | **Setup** |
| 88 | |
| 89 | ``` |
| 90 | export ANDROID_SDK=<path_to_Android_SDK> |
| 91 | export ANDROID_NDK=<path_to_Android_NDK> |
| 92 | export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 |
| 93 | ``` |
| 94 | |
| 95 | **Build** |
| 96 | |
| 97 | ``` |
| 98 | git clone https://github.com/cnorthrop/glmark2.git |
| 99 | cd glmark2/android |
| 100 | git checkout android_fixes |
| 101 | ./build.sh |
| 102 | ``` |
| 103 | |
| 104 | **Install** |
| 105 | |
| 106 | ``` |
| 107 | adb install --abi armeabi-v7a glmark2.apk |
| 108 | ``` |
| 109 | |
| 110 | **Run** |
| 111 | |
| 112 | To select ANGLE as the driver on Android (requires Android Q): |
| 113 | |
| 114 | ``` |
| 115 | adb shell settings put global angle_gl_driver_selection_pkgs org.linaro.glmark2 |
| 116 | adb shell settings put global angle_gl_driver_selection_values angle |
| 117 | ``` |
| 118 | |
| 119 | To switch back to native GLES driver: |
| 120 | |
| 121 | ``` |
| 122 | adb shell settings delete global angle_gl_driver_selection_values |
| 123 | adb shell settings delete global angle_gl_driver_selection_pkgs |
| 124 | ``` |