r/androiddev • u/Ssunde2 • Jun 12 '18
AMD finally gets google emulator support (Canary 27.3.6)
4
u/redoran3031 Jun 12 '18
do you have to install or update some amd software, or is it only an android studio patch?
4
u/Ssunde2 Jun 12 '18
Nope! You just need to get the newest canary builds :) Edit:(And enable hyper V in Windows!)
1
u/ZeAthenA714 Jun 12 '18
Well, it's not working for me.
I have Hyper-V and hardware acceleration activated, but when I try to launch AVD it tells me I need hardware acceleration for x86 images. I noticed I don't have Intel HAXM installed and it won't install because apparently it doesn't like AMD cpu.
Do you have Intel HAXM installed? Have you done anything else apart from enabling Hyper-V?
2
u/Ssunde2 Jun 12 '18
You need to enable hyper-v, but also further down there is a box called "windows hypervisor platform". That fixed it for me!
1
u/ZeAthenA714 Jun 12 '18
Yeah that's what I did, still not working :/
Oh well, I'll just have to wait for a stable release.
1
u/lfy_google Android Studio Emulator developer Jun 12 '18
Can you try running the canary version of Studio, or running the emulator from command line with -verbose (and paste any acceleration related error message?)
1
u/AceMcVeer Jun 15 '18
Not the OP, but I'm running canary, have Windows 10 Pro, Hyper-v and hypervisor is enabled and computer restarted a couple times and a new device created.
Running in CMD line it spits out:
Created filesystem with 11/4224 inodes and 1302/16896 blocks
Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: Android Emulator requires an Intel processor with VT-x and NX support. Your CPU: 'AuthenticAMD'
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support. Your CPU: 'AuthenticAMD'
1
u/lfy_google Android Studio Emulator developer Jun 15 '18
Have you enabled "Windows Hypervisor Platform" in Windows Optional Features and enabled virtualization in the bios?
edit: also try Studio 3.2
1
u/AceMcVeer Jun 15 '18
Yes I did mention that in my post. It is enabled I the BIOS as well, you can't enable in Windows without first enabling in the BIOS.
1
u/lfy_google Android Studio Emulator developer Jun 15 '18
What AMD CPU hardware are you running?
→ More replies (0)1
u/thebspin Oct 21 '18
windows hypervisor platform
This part saved me! Stupid as hell they don't mention this in the official statement..
1
u/kay-nyn Jun 29 '18 edited Jun 30 '18
Same thing happend to me, but it took some time for Android Studio to update avd to latest version. Once that process was done, I was able to create emulator.
Update: Just read your post again. I do have issues when I am starting the emulator. My PC: Ryzen 1700/16GB/Win 10 Pro Hyper-V is enabled as I am running docker as well.
6
u/bt4u6 Jun 12 '18
Relying on hyper v means it will not work for people using "home" edition of Windows
86
46
u/Zenqo Jun 12 '18
Wait, seriously?
I spent the whole of Saturday setting up a dual-boot of linux so I could run the android emulator. Is this now pointless?
41
u/kokeroulis Jun 12 '18
On linux you will also have faster build times.
On Windows gradle is slow, because gradle is generating a ton of files, where windows are slow at reading multiple small files.
Windows is ok, on reading small amount of files but huge.
IMO If you don't have any issues with Linux, then stick with it and use virtualbox in order to have some MS apps (like outlook).
8
u/pagalDroid I love Java Jun 12 '18
Ah, so that is why the build time feels so slow. I recently switched from linux to windows and was wondering why it was slower.
2
u/evolution2015 It's genetic, man. 😳 D'oh! Jun 13 '18
Really? Is it noticeably faster? For example, it currently takes about 1 minute and 50 seconds to rebuild my project on Windows. How long it would take if I install Linux on the same machine and build the project there?
3
u/kokeroulis Jun 13 '18
yes it is noticeably faster. Windows is slow because of the ntfs.
3
u/evolution2015 It's genetic, man. 😳 D'oh! Jun 13 '18
I tested on a virtual machine Linux Mint 18. I tried to use the exact same Android Studio + SDK, although the Windows version was using build tools 27.0.3, but only 28.0.0 was installable on Linux.
I tried keep cleaning and rebuilding (so that the OS file cache would negate the disk performance), and it took 49 seconds on Windows (4-core, 16GB), and 34 seconds on virtual machine Linux (4-core, 8GB).
If NTFS is the problem, can I create a different file system for Android build and build projects there to increase the speed?
2
u/kokeroulis Jun 13 '18 edited Jun 13 '18
I think the build tools are not going to make a big difference. Sometimes you get better build times with a new version but this is very rare...
So linux is faster than windows despite the fact that it is inside a virtual machine?!! which virtual machine did you use? Virtualbox?
If the install was on the real hardware, It would go even faster..
If you want to benchmark it with a more accurate way, you can use the gradle-profiler, by running gradle-profiler --benchmark --warmups 3 --iterations 5 clean :app:assembleFlavorHereOrRemoveThatDebug
I am not sure about the filesystem question. I know that you are able to create a ext4 filesystem on Windows, but i am not sure about its performance. (I never used windows for developing) (Ext4 is the default filesystem for Linux.)
Maybe you could ask on the gradle forums...
0
Jun 12 '18
[deleted]
11
u/Gwolf4 Jun 12 '18
You stills have the io problems of ntfs and windows. Better put them on ssd on an ext 4 partition XD
8
6
u/psteiger github.com/psteiger Jun 12 '18
I just did that yesterday and my CPU is Intel. Build times are a lot faster. Gradle is painfully slow on Windows as /u/kokeroulis pointed out.
1
u/Zenqo Jun 12 '18
Interesting. I have my windows install on a SSD and my Linux install on a hard drive. Might be stupid but would this affect build times at all?
6
u/psteiger github.com/psteiger Jun 12 '18
Yes, SSDs are a lot faster than HDs. The fastest setup for build times would be to install Linux on the same SSD alongside Windows, which is what I do.
6
2
u/Seven2Death Jun 14 '18
I spent the whole of Saturday setting up a dual-boot of linux
first time? dont worry soon youll be able to install when someone looks away from their computer for a second. its stupid easy once you know what's what.
2
u/Zenqo Jun 14 '18
A good majority of the time was installing another hard drive so I had a dedicated drive for Linux. But yeah, certainly will be a lot easier next time!
-7
u/Zhuinden Jun 12 '18
Linux wouldn't change whether you have an Intel or an AMD CPU anyways. o_o
28
u/ZeAthenA714 Jun 12 '18
AMD hardware acceleration for the android emulator is supported on linux but not on windows.
3
u/Zhuinden Jun 12 '18
Oh, I didn't know that, okay. That's good to know. Always had Intels so never had this problem.
4
u/Zenqo Jun 12 '18
Sorry I don't think I was clear. I installed Linux for the sole purpose of the Android emulator. Is my linux dual-boot now redundant because I can get the exact same on Windows with no difference in performance etc.?
-7
u/Zhuinden Jun 12 '18
I've been using Windows for android development for quite a while and I never noticed any problems with the emulator. I think this is just urban legend from "Linux masterrace" people.
Honestly the MacBook Pro I got at work is much laggier than my desktop windows machine.
7
u/ZeAthenA714 Jun 12 '18
It's not an urban legend. AMD hardware acceleration didn't work on windows but it did work on linux. Intel hardware acceleration worked on both windows and linux.
6
u/Zhuinden Jun 12 '18
Now if I had read the reply you made exactly 1 hour ago, then I wouldn't have looked like an idiot! Whoops :D
4
6
u/kokeroulis Jun 12 '18
The difference is that the emulator had the following options for acceleration
Windows & Mac: HAMX
Linux: KVM
HAXM is not supported on Linux, its Windows & Mac OSX only. KVM is only supported on linux (no support for Windows & Mac OSX)
KVM = Intel + AMD
Before HAXM = Intel Now HAXM = Intel + AMD
37
u/lfy_google Android Studio Emulator developer Jun 12 '18
Based on the comments here, I'd like to clarify:
From our testing, this should also work on Windows 10 Home even though it does not have a "Hyper-V" option; enabling just "Windows Hypervisor Platform" in Windows Optional Features should work as well.
Also, API level <= 25 is not working yet; we will have that fixed in the next canary.
5
u/omniuni Jun 12 '18
Why base it on Hyper-V and not something like the open source Virtualbox driver? AMD processors are more than capable of virtualization (as demonstrated by the fact that the emulator has been accelerated under Linux on AMD for years now), and using Hyper-V seems to at the very least require some extra work for many people to enable.
11
u/lfy_google Android Studio Emulator developer Jun 12 '18
Yeah, another option would be to implement an AMD backend for HAXM, or use non-VT setups. These would require more effort, but are things that are worth looking into. We'll give an update when there's progress made in these fronts.
1
u/DoListening Jun 14 '18
On the plus side, using Hyper-V means you can use it alongside Docker.
1
u/kay-nyn Jun 29 '18
this
Also, I am running Docker and downloaded the latest Android studio (3.3 Canary 1), but I am still unable to create a device. Any idea on what might be missing?
8
Jun 12 '18
These are the original notes of Google for the Android Emulator 27.3.6 Canary update:
https://androidstudio.googleblog.com/2018/06/emulator-2736-canary.html
1
u/ene__im https://github.com/eneim Jun 12 '18
How is the emulator performance?
4
u/Ssunde2 Jun 12 '18
I don't have a intel box right now to test side by side, but it seems very responsive.
3
2
2
2
2
1
1
Jun 12 '18
Finally I will personally have a reason for my usage of Windows 10 Pro (instead of Home)? And I won't have to reboot to Linux all the time?
Awesome!
1
u/neonwarge04 Jun 12 '18
this is good news. I really need the emulator that is provided from the SDK. I am iust planning to setup my Linux machine this weekend.
1
u/tk421whyarentyouatyo Jun 13 '18
this was possible in prior versions but you had to dig around and manually start the emulator with some special flags.
great news regardless!
1
1
u/PostMaloy Jun 13 '18
Is this only in the canary build? If so, any idea when it will reach stable build?
-1
0
-3
u/Almezing Jun 12 '18
Why haven't people found that genymotion already provide this function for AMD? I looked up HAXM alternative the moment I found amd wasn't supported.
0
Jun 12 '18
[deleted]
2
u/Ssunde2 Jun 12 '18
Yeah i forgot about that! Now we have a reason to upgrade (besides edge for business)
4
u/lfy_google Android Studio Emulator developer Jun 12 '18
Only the "Windows Hypervisor Platform" feature needs to be toggled on; you should be good with Windows 10 Home if you have the latest version of it, where that feature is available.
14
u/[deleted] Jun 12 '18
I literally just got an i7 because it hasn't been supported. W/e, I needed an upgrade anyway.