Commit 78c77361 by Cody Northrop Committed by Commit Bot

Perf: Add a single Manhattan trace

Now that TRex is up and working and Manhattan runs cleanly: * Add a single compressed Manhattan trace. * Allow errors from tests to fail the test * Restore the working directory between each trace test Test: angle_perftest --gtest_filter=TracePerfTest* Bug: b:151349786 Bug: angleproject:3630 Bug: angleproject:4496 Change-Id: I9e9d9342efb23431380f484befb9a19915c4bd0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2113230 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a7510f06
......@@ -9,6 +9,7 @@
#include "system_utils.h"
#include <array>
#include <iostream>
#include <dlfcn.h>
#include <sys/stat.h>
......@@ -81,6 +82,10 @@ class PosixLibrary : public Library
std::string fullPath = directory + libraryName + "." + GetSharedLibraryExtension();
mModule = dlopen(fullPath.c_str(), RTLD_NOW);
if (!mModule)
{
std::cerr << "Failed to load " << libraryName << ": " << dlerror() << std::endl;
}
}
~PosixLibrary() override
......
......@@ -189,7 +189,6 @@ ANGLEPerfTest::ANGLEPerfTest(const std::string &name,
mBackend(backend),
mStory(story),
mGPUTimeNs(0),
mIgnoreErrors(false),
mSkipTest(false),
mStepsToRun(std::numeric_limits<unsigned int>::max()),
mNumStepsPerformed(0),
......@@ -649,11 +648,7 @@ void ANGLERenderTest::step()
mOSWindow->messageLoop();
#if defined(ANGLE_ENABLE_ASSERTS)
// Some gfxbench tests have expected errors that don't affect replay
if (!mIgnoreErrors)
{
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
}
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
#endif // defined(ANGLE_ENABLE_ASSERTS)
}
......
......@@ -89,7 +89,6 @@ class ANGLEPerfTest : public testing::Test, angle::NonCopyable
std::string mStory;
Timer mTimer;
uint64_t mGPUTimeNs;
bool mIgnoreErrors;
bool mSkipTest;
std::unique_ptr<perf_test::PerfResultReporter> mReporter;
......
......@@ -14,6 +14,7 @@
#include "tests/perf_tests/DrawCallPerfParams.h"
#include "util/egl_loader_autogen.h"
#include "restricted_traces/manhattan_10/manhattan_10_capture_context1.h"
#include "restricted_traces/trex_200/trex_200_capture_context1.h"
#include <cassert>
......@@ -50,10 +51,9 @@ ANGLE_MAYBE_UNUSED uint8_t *DecompressBinaryData(const std::vector<uint8_t> &com
return uncompressedData.release();
}
// TODO (anglebug.com/4496)
// Temporarily limit the tests to a single trace to get the bots going
enum class TracePerfTestID
{
Manhattan10,
TRex200,
InvalidEnum,
};
......@@ -81,6 +81,9 @@ struct TracePerfParams final : public RenderTestParams
switch (testID)
{
case TracePerfTestID::Manhattan10:
strstr << "_manhattan_10";
break;
case TracePerfTestID::TRex200:
strstr << "_trex_200";
break;
......@@ -138,6 +141,8 @@ class TracePerfTest : public ANGLERenderTest, public ::testing::WithParamInterfa
QueryInfo mCurrentQuery = {};
std::vector<QueryInfo> mRunningQueries;
std::vector<TimeSample> mTimeline;
std::string mStartingDirectory;
};
TracePerfTest::TracePerfTest()
......@@ -145,17 +150,20 @@ TracePerfTest::TracePerfTest()
{}
// TODO(jmadill/cnorthrop): Use decompression path. http://anglebug.com/3630
#define TRACE_TEST_CASE(NAME) \
mStartFrame = NAME::kReplayFrameStart; \
mEndFrame = NAME::kReplayFrameEnd; \
mReplayFunc = NAME::ReplayContext1Frame; \
NAME::SetBinaryDataDir(ANGLE_TRACE_DATA_DIR_##NAME); \
#define TRACE_TEST_CASE(NAME) \
mStartFrame = NAME::kReplayFrameStart; \
mEndFrame = NAME::kReplayFrameEnd; \
mReplayFunc = NAME::ReplayContext1Frame; \
NAME::SetBinaryDataDecompressCallback(DecompressBinaryData); \
NAME::SetBinaryDataDir(ANGLE_TRACE_DATA_DIR_##NAME); \
NAME::SetupContext1Replay()
void TracePerfTest::initializeBenchmark()
{
const auto &params = GetParam();
mStartingDirectory = angle::GetCWD().value();
// To load the trace data path correctly we set the CWD to the executable dir.
if (!IsAndroid())
{
......@@ -165,8 +173,10 @@ void TracePerfTest::initializeBenchmark()
switch (params.testID)
{
case TracePerfTestID::Manhattan10:
TRACE_TEST_CASE(manhattan_10);
break;
case TracePerfTestID::TRex200:
trex_200::SetBinaryDataDecompressCallback(DecompressBinaryData);
TRACE_TEST_CASE(trex_200);
break;
default:
......@@ -177,13 +187,15 @@ void TracePerfTest::initializeBenchmark()
ASSERT_TRUE(mEndFrame > mStartFrame);
getWindow()->setVisible(true);
mIgnoreErrors = true;
}
#undef TRACE_TEST_CASE
void TracePerfTest::destroyBenchmark() {}
void TracePerfTest::destroyBenchmark()
{
// In order for the next test to load, restore the working directory
angle::SetCWD(mStartingDirectory.c_str());
}
void TracePerfTest::sampleTime()
{
......
manhattan_10_20
manhattan_10_20.tar.gz
manhattan_1100_1110
manhattan_1100_1110.tar.gz
manhattan_1440_1450
manhattan_1440_1450.tar.gz
manhattan_750_760
manhattan_750_760.tar.gz
trex_200_210
trex_200_210.tar.gz
trex_800_810
trex_800_810.tar.gz
trex_900_910
trex_900_910.tar.gz
trex_1300_1310
trex_1300_1310.tar.gz
manhattan_10
manhattan_10.tar.gz
trex_200
trex_200.tar.gz
......@@ -33,14 +33,10 @@ Build the angle_perftests:
```
autoninja -C out/Release angle_perftests
```
On desktop, run them like so:
Run them like so:
```
out/Release/angle_perftests --gtest_filter=TracePerfTest*
```
On Android, run them like so:
```
out/Release/bin/run_angle_perftests --gtest_filter=TracePerfTest*
```
## Updating traces
......@@ -56,6 +52,7 @@ python ..\..\..\..\scripts\refresh_angle_libs.py --verbose
set TFW_PACKAGE_DIR=../../../build/vs2017-x64/testfw/tfw-dev
set ANGLE_DEFAULT_PLATFORM=vulkan
# TRex
set START=200
set END=210
set LABEL=trex
......@@ -65,6 +62,17 @@ set ANGLE_CAPTURE_FRAME_START=%START%
set ANGLE_CAPTURE_FRAME_END=%END%
set ANGLE_CAPTURE_OUT_DIR=..\..\..\..\..\angle\src\tests\perf_tests\restricted_traces\%LABEL%_%START%
..\bin\testfw_app.exe -b ../../../build/vs2017-x64/testfw/tfw-dev --gfx egl -w 1920 -h 1080 -t gl_trex --ei -frame_step_time=40
# Manhattan
set START=10
set END=20
set LABEL=manhattan
mkdir ..\..\..\..\..\angle\src\tests\perf_tests\restricted_traces\%LABEL%_%START%
set ANGLE_CAPTURE_LABEL=%LABEL%_%START%
set ANGLE_CAPTURE_FRAME_START=%START%
set ANGLE_CAPTURE_FRAME_END=%END%
set ANGLE_CAPTURE_OUT_DIR=..\..\..\..\..\angle\src\tests\perf_tests\restricted_traces\%LABEL%_%START%
..\bin\testfw_app.exe -b ../../../build/vs2017-x64/testfw/tfw-dev --gfx egl -w 1920 -h 1080 -t gl_manhattan --ei -frame_step_time=40
```
### Linux
......@@ -87,6 +95,17 @@ export ANGLE_CAPTURE_FRAME_START=$START
export ANGLE_CAPTURE_FRAME_END=$END
export ANGLE_CAPTURE_OUT_DIR=../../../../../angle/src/tests/perf_tests/restricted_traces/${LABEL}_${START}
../bin/testfw_app -b $TFW_PACKAGE_DIR --gfx egl -w 1920 -h 1080 -t gl_trex --ei -frame_step_time=40
# Manhattan
export START=10
export END=20
export LABEL=manhattan
mkdir -p ../../../../../angle/src/tests/perf_tests/restricted_traces/${LABEL}_${START}
export ANGLE_CAPTURE_LABEL=${LABEL}_${START}
export ANGLE_CAPTURE_FRAME_START=$START
export ANGLE_CAPTURE_FRAME_END=$END
export ANGLE_CAPTURE_OUT_DIR=../../../../../angle/src/tests/perf_tests/restricted_traces/${LABEL}_${START}
../bin/testfw_app -b $TFW_PACKAGE_DIR --gfx egl -w 1920 -h 1080 -t gl_manhattan --ei -frame_step_time=40
```
## Upload to the cloud
......@@ -94,6 +113,7 @@ export ANGLE_CAPTURE_OUT_DIR=../../../../../angle/src/tests/perf_tests/restricte
```
cd ~/chromium/src/third_party/angle/src/tests/perf_tests/restricted_traces
upload_to_google_storage.py --bucket chrome-angle-capture-binaries --archive trex_200
upload_to_google_storage.py --bucket chrome-angle-capture-binaries --archive manhattan_10
```
## Adding new tests
......
......@@ -7,9 +7,10 @@
import("../../../../gni/angle.gni")
# TODO: anglebug.com/4496
# Temporarily limit the data uploaded to a single trace to get the bots going
_tests = [ "trex_200" ]
_tests = [
"manhattan_10",
"trex_200",
]
angle_trace_perf_sources = [ "perf_tests/TracePerfTest.cpp" ]
......
f801199c7958b20531cbd02289daa5127090d3a5
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment