Hardware acceleration #286
Replies: 9 comments 8 replies
-
While I haven't done such a thorough investigation I've had my suspicion this is the case, too. Also, I have a screen recording from CI that asks user to confirm the extension: |
Beta Was this translation helpful? Give feedback.
-
@mattjohnsonpint I'm really glad you started this issue, because I'm working through the same thing now. The pop-up is blocking a lot, and I'm not sure it's achieving VM acceleration. The only difference I'm running into, is that I thought I was not getting a valid |
Beta Was this translation helpful? Give feedback.
-
I have been talking back and forth while trying to figure this stuff out with @igorboskovic3 who sent me https://github.com/igorboskovic3/actions-test/actions/runs/3228474831 which also has a system-extension updated popup. Screenshot of Popup I really do think we need more clarity on this from the runner team. Here are the few issues I have been communicating in related to HAXM: Another thing I want to look into is potentially using the new SKIA Rendering |
Beta Was this translation helpful? Give feedback.
-
The main reason I am digging on this is that some of our Android tests are extremely flaky - but only when running in Github Actions. Run the same tests on an emulator on either my Mac or Windows machines and they pass every time. Even if I let it run repeatedly for hours. Also sometimes the emulators in CI flat out fail to boot. Also API 32 seems more flaky than others - not sure why. Originally I thought perhaps the issue was because the warning we get:
But like I said, it always works locally - even on an AVD configured for a single core. So just process of elimination - trying to figure out what is special about the CI environment that causes the flakiness. Perhaps it's hardware acceleration, perhaps not. |
Beta Was this translation helpful? Give feedback.
-
@mattjohnsonpint Same here. We have quite a few teams all trying to run affordable automation leveraging Github Actions + Github Action Runners after migrating from a self-hosted solution (KVM enabled Ubuntu Agent hosted on MacStadium) I have also been super skeptical of why And yes, I'm pretty sure I could run the test suite with 4x sharding locally on our M1/M2 MacBooks, so it's quite hilarious we're in this state on CI. |
Beta Was this translation helpful? Give feedback.
-
@mattjohnsonpint I'm starting to think there's much of an advantage at all with running on macOS agents. We used to run on them because HAXM was supported, and things were more "stable" on macOS than Ubuntu Agents (The standard Github ones) If we're going to have the same performance, I'd rather run on 1/10th the cost Ubuntu agents than the macOS agents. Also, the Ubuntu agents, if you have access to the larger agent beta, can provide way more powerful machines. |
Beta Was this translation helpful? Give feedback.
-
@mattjohnsonpint I just did a test and discovered that if you run This is more than confusing to me. https://github.com/mrk-han/Emulator-Sandbox/actions/runs/3374542418 New Tools ->
Old Tools ->
|
Beta Was this translation helpful? Give feedback.
-
Maybe an alternative would be to use an Automated Test Device (ATD) image Only available currently on API30 & API31 (canary channel) though.
|
Beta Was this translation helpful? Give feedback.
-
See this comment: #46 (comment) |
Beta Was this translation helpful? Give feedback.
-
This is a bit of continuation from #279. (@mrk-han especially)
I've been doing some experimenting, and I don't think thatinstalling HAXM on MacOS under GitHub Actions hosted runners is actually doing anything whatsoever for the Android emulator.
brew install --cask intel-haxm
does indeed say it succeeds, but it doesn't actually work. Same withsudo $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "extras;intel;Hardware_Accelerated_Execution_Manager"
which does the same thing without brew.The HAXM docs say that you should see the HAXM kernel extension running with
kextstat | grep intel
, but that returns nothing. Run without grep shows other extensions, but not HAXM.The android docs here say that on macOS 10.10 and higher, the built-in
Hypervisor.Framework
is used first, and HAXM is a fallback. It also says here that on macOS 10.13 and higher one has to enable security permissions manually in the system preferences UI in order to load a third-party (non-apple) kernel extension at all.This aligns with my findings. After installing HAXM (with either brew or sdkmanager),
/Library/Extensions/intelhaxm.kext
is on disk, but not loaded.sudo kextload /Library/Extensions/intelhaxm.kext
gives an error:And regardless of whether I install HAXM or not, checking the emulator with
$ANDROID_HOME/emulator/emulator -accel-check
always gives the same result:I interpret this to mean that the Android emulator is indeed using hardware acceleration, as provided by Hypervisor.Framework, and I cannot use HAXM because I don't have ability to set the security permission programatically.
Am I wrong?
(I had the same results on
macos-11
ormacos-12
GitHub Actions hosted runners)CC: @vaind (any thoughts?)
Beta Was this translation helpful? Give feedback.
All reactions