GearVR debugging with ARM Mali Graphics debugger

Hi,

in my attempt to dig deep into performance problems of my GearVR UE4 game, I tried using the ARM Mali Graphics debugger. It requires adding a .so library to the Android project and loading it dynamically on runtime.

I added loading code to main game activity in Engine\Build\Android\Java\src\com\epicgames\ue4\GameActivity.java but unfortunately, I’m unable to package the .so file with the .apk properly.

When I added makefiles to the UE4 Java project as per ARM documentation, I get error when AutomationTool is about to create the .apk file (error log below).

I’ve seen on Niklas Smedberg’s presentation (https://de45xmedrsdbp.cloudfront.net/Resources/files/UE4_DevCon2014_MobilePerf-1826750604.pdf), that you guys at Epic use ARM Mali Graphics Debugger to debug UE4 projects. Could you please give some small tutorial on how to set it up properly?

MainFrameActions: Packaging (Android (ETC2)): ====2015-10-07 11:23:03====PREPARING NATIVE CODE=================================================================
MainFrameActions: Packaging (Android (ETC2)): UEDeployAndroid.UpdateProjectProperties: 
MainFrameActions: Packaging (Android (ETC2)): ====2015-10-07 11:23:03====UPDATING BUILD CONFIGURATION FILES====================================================
MainFrameActions: Packaging (Android (ETC2)): UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml...
MainFrameActions: Packaging (Android (ETC2)): UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Updating project.properties, local.properties, and build.xml...
MainFrameActions: Packaging (Android (ETC2)): UEDeployAndroid.MakeApk: 
MainFrameActions: Packaging (Android (ETC2)): Copying new .so C:\Repo\mkosobucki_capybara\Capybara\Binaries\Android\Capybara-armv7-es2.so file to jni folder...
MainFrameActions: Packaging (Android (ETC2)): UEDeployAndroid.RunCommandLineProgramAndThrowOnError: Preparing native code for debugging...
MainFrameActions: Packaging (Android (ETC2)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Android (ETC2)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Android (ETC2)): Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: C:/NVPACK/android-ndk-r10e/ndk-build.cmd failed with args APP_ABI="armeabi-v7a " NDK_DEBUG=1
MainFrameActions: Packaging (Android (ETC2)): Stacktrace:    at UnrealBuildTool.Android.UEDeployAndroid.RunCommandLineProgramAndThrowOnError(String WorkingDirectory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
MainFrameActions: Packaging (Android (ETC2)):    at UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
MainFrameActions: Packaging (Android (ETC2)):    at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
MainFrameActions: Packaging (Android (ETC2)):    at AndroidPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool
MainFrameActions: Packaging (Android (ETC2)): \Android\AndroidPlatform.Automation.cs:line 183
MainFrameActions: Packaging (Android (ETC2)):    at Project.Package(ProjectParams Params, Int32 WorkingCL) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\Scripts\PackageCommand.Automation.cs:line 30
MainFrameActions: Packaging (Android (ETC2)):    at BuildCookRun.DoBuildCookRun(ProjectParams Params) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 212
MainFrameActions: Packaging (Android (ETC2)):    at BuildCommand.Execute() in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 35
MainFrameActions: Packaging (Android (ETC2)):    at AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 392
MainFrameActions: Packaging (Android (ETC2)):    at AutomationTool.Automation.Process(String[] CommandLine) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 366
MainFrameActions: Packaging (Android (ETC2)):    at AutomationTool.Program.MainProc(Object Param) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\Program.cs:line 134
MainFrameActions: Packaging (Android (ETC2)):    at AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param) in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 708
MainFrameActions: Packaging (Android (ETC2)):    at AutomationTool.Program.Main() in c:\Repo\mkosobucki_capybara\Engine\Source\Programs\AutomationTool\Program.cs:line 53
MainFrameActions: Packaging (Android (ETC2)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (ETC2)): Program.Main: AutomationTool exiting with ExitCode=Error_Unknown
MainFrameActions: Packaging (Android (ETC2)): Domain_ProcessExit
MainFrameActions: Packaging (Android (ETC2)): AutomationToolLauncher exiting with ExitCode=1
MainFrameActions: Packaging (Android (ETC2)): copying UAT log files...
MainFrameActions: Packaging (Android (ETC2)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults:Error: Error Unknown Error
2 Likes

Upgrade to MGD 3.2.0 helped. It works now. However, it’s still unsuitable to use with GearVR because of this:
https://forums.oculus.com/viewtopic.php?t=20404

You can’t easily set up VRApi used in UE4 to use double buffering, so MGD won’t recognize places where frames end.

Thanks

I am here because of @discobot

2 Likes

Hi! To find out what I can do, say @discobot display help.

1 Like

go away @discobot ; you are only instigating and causing problems/confusion in your wake.

:angry:

SHOW ME THE CAPYBARA

4 Likes

Let’s go to the bar and capitalize, you old goat. You won’t need to see anything but your beer.

If you have a thing for rodents, you old goat, the beer might not work, I hear rodents have a thing for old goats. Capybara - Wikipedia

@discobot Not sure I understand why you bring me here… :melting_face:

2 Likes

Hi! To find out what I can do, say @discobot display help.

@discobot display help.

@discobot display help

I currently know how to do the following things:

@discobot start {name-of-tutorial}

Starts an interactive tutorial just for you, in a personal message. {name-of-tutorial} can be one of: tutorial, advanced tutorial.

@discobot roll 2d6

:game_die: 3, 6

@discobot quote

:left_speech_bubble: A rolling stone gathers no moss. — Publilius Syrus

@discobot fortune

:crystal_ball: You may rely on it

2 Likes

@discobot sent me here

Hi! To find out what I can do, say @discobot display help.

@discobot display help

I currently know how to do the following things:

@discobot start {name-of-tutorial}

Starts an interactive tutorial just for you, in a personal message. {name-of-tutorial} can be one of: tutorial, advanced tutorial.

@discobot roll 2d6

:game_die: 3, 6

@discobot quote

:left_speech_bubble: Until you make peace with who you are, you’ll never be content with what you have. — Doris Mortman

@discobot fortune

:crystal_ball: You may rely on it

@NickEh30 Hello! Im new here! :handshake:

@discobot display help