Hash :
5cffbe96
Author :
Date :
2022-03-08T14:51:11
Android: Track peak GPU memory in restricted_trace_perf
We've noticed that the script reports higher memory usage than
recorded with local runs with similar steps. We isolated this to
ANGLE using much higher peak memory when the trace loads, but then
evens out after some time, nearing parity with native.
To track this for optimization, we are going to split the memory
tracking into:
- peak GPU memory usage
- sustained GPU memory usage
This CL changes the script to:
* Measure peak GPU memory usage by tracking total GPU memory used
throughout the trace, returning the highest.
* Measure sustained GPU memory usage by tracking usage from the
middle of the trace (based on run time), returning the average.
* Update the frequency of memory sampling by reducing sleep to 0.25
seconds instead of 1.0 second.
As a data point, here is what angry_birds_2_1500 reports on Pixel 6:
Before: 602599651 bytes
After: 672231424 bytes (peak)
360621537 bytes (sustained)
Bug: angleproject:6970
Change-Id: I227e30abeb6a5f28fe7230a2979441c3693234f1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3511314
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
#!/bin/bash
#
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
sleep_duration=$1
if [ $sleep_duration -eq 0 ]; then
echo "No sleep_duration provided"
exit 1
fi
start_time=$SECONDS
while true; do
pid=$(pidof com.android.angle.test:test_process)
case $pid in
''|*[!0-9]*) echo pid is not a number ;;
*) echo com.android.angle.test:test_process $pid >> /sdcard/Download/gpumem.txt ;;
esac
dumpsys gpu --gpumem >> /sdcard/Download/gpumem.txt
time_elapsed=$(( SECONDS - start_time ))
echo "time_elapsed: $time_elapsed" >> /sdcard/Download/gpumem.txt
sleep $sleep_duration;
done