Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we default to -gpu swiftshader_indirect if HAXM is supported by MacOS Latest? #270

Closed
mrk-han opened this issue Oct 4, 2022 · 9 comments

Comments

@mrk-han
Copy link
Collaborator

mrk-han commented Oct 4, 2022

According to the readme, it seems the default GPU flag uses -gpu swiftshader_indirect, but this is the software acceleration which the Android Docs here say to try to use if Hardware Acceleration is not available. But, MacOS-Latest allegedly does support HAXM and Hardware Acceleration.

  1. Is this really the default that the ReactiveCircus/Android-Emulator-Runner uses?
  2. Or is this only used an example in the readme? The wording is confusing, because it says the default emulator options are Default emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim

I recommend not defaulting to this, or adding clarification in the readme.

@ychescale9
Copy link
Member

Yes that's the default, but you can override it including any other emulator options with emulator-options: -no-window -gpu host -no-snapshot -noaudio -no-boot-anim for example.

But as far as I remember host mode won't work due to other limitations. Feel free to give it a go and let me know if it works!

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 4, 2022

@ychescale9 Tried out gpu -host and saw WARNING | Your GPU drivers may have a bug. If you experience graphical issues, please consider switching to software rendering. and then the emulator never booted 😂

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 4, 2022

Error: Timeout waiting for emulator to boot.
[725](https://github.com/PathwayVets/thrive-android-app/actions/runs/3185448675/jobs/5195031526#step:12:730)
INFO    | Wait for emulator (pid 3105) 20 seconds to shutdown gracefully before kill;you can set environment variable ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL(in seconds) to change the default value (20 seconds)

This was the eventual error -- perhaps I'll increase the time and check if it will actually boot

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 5, 2022

Increased time to 2 minutes and still no boot. Using -gpu auto now which I assume defaults to swiftshader_indirect. So, seems like we aren't able to utilize the hardware acceleration after all? Will do more experimenting...

@ychescale9
Copy link
Member

This might help although I'm not too hopeful https://github.com/google/android-emulator-container-scripts

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 6, 2022

@ychescale9 Funny thing is I helped update that readme before they open-sourced it from the internal repo. But I haven't checked it out much since. I really would prefer to run in Docker so things could be more portable. Thanks for the suggestion.

It'd be a real shame if Hardware Acceleration couldn't be taken advantage of on the Github Actions/Azure runners.

Will do more investigating...

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 12, 2022

Turns out HAXM isn't supported by default.

Ran emulator -accel-check on the macOS-11 agent. (macOS 11.7)

2022-10-12T02:17:38.3163720Z accel:
2022-10-12T02:17:38.3169550Z 6
2022-10-12T02:17:38.3200330Z HAXM is not installed on this machine

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 12, 2022

Added this because I couldn't find out why this was the case actions/runner-images#6388

We should also probably change the readme... 😞

@mrk-han
Copy link
Collaborator Author

mrk-han commented Oct 19, 2022

Closing as HAXM is not pre-installed by macOS-11 or macOS-12.

See: actions/runner-images#6388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants