google / android-emulator-hypervisor-driver

Other
773 stars 251 forks source link

No "gvm" Service after Android Emulator Hypervisor for AMD Processor installation #30

Open unitrix0 opened 4 years ago

unitrix0 commented 4 years ago

I'm desperately trying to install the Android Emulator Hypervisor for AMD Processor but something seems to fail, as the command sc query gvm tells me there is no such service.

I think I have disabled all the Hpyer-V Windows features. I've also seen this article https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/wiki/Is-Hyper-V-really-disabled%3F from which I got the cpuid tool. The Output is:

Hypervisor feature flag 80000000
Hypervisor string Microsoft Hv
Hypervisor signature Hv#1

What ever that means...

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

which is output of: emulator-check.exe cpu-info emulator-check.exe accel

unitrix0 commented 4 years ago

Here you go:

emulator-check.exe cpu-info
cpu-info:
137
AMD CPU|Inside a VM|64-bit CPU|
cpu-info

emulator-check.exe accel
accel:
0
WHPX (10.0.18362) is installed and usable.
accel
Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

Are you trying to run emulator inside a virtual machine? ("Inside a VM")

unitrix0 commented 4 years ago

No, what I might need to add is that I started the development on a Intel CPU and now changed to AMD.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

I suppose you need to go to SDK Manager > SDK Tools > make sure you have installed "Android Emulator hypervisor driver for AMD Processor" and make sure you don't have checked "Intel x86 Emulator Accelerator (HAXM installer)" I recommend installing latest version from here: https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/releases From my experience, it's better to install it with this command (instead of running bat files) RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\gvm.Inf then reboot

unitrix0 commented 4 years ago

I've verified that HAXM is uninstalled and the other thing is installed. I then used your link and finally got the gvm service. However if I start the Virtual Device now it tells me that WHPX is not configured and I should activate the Windows Hypervisor Platform feature. I thought that's not needed?

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

Is it working for a newly created avd? Maybe there's something explicitely specified in the previously created avd config. (%userprofile%.android\avd\.avd*)

Also make sure you reboot after installing the gvm driver

I would look into hardware-qemu.ini. For reference, i run an amd and my config contain these lines: .... hw.cpu.arch = x86 hw.cpu.model = qemu32 hw.cpu.ncore = 4 .... hw.gpu.enabled = true hw.gpu.mode = host ....

unitrix0 commented 4 years ago

I did the reboot Created a new device but the settings look the same... hardware-qemu.ini.txt

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

Can you please post the exact error you get when launching this newly created avd?

unitrix0 commented 4 years ago

If I start the device through the device manager I immediately get a dialog saying WHPX isn't configured and I should activate the Windows-Hypervisor-Plattform feature to use the native Hypervisor. Two Buttons, "Documentation" and "Run Anyway". I don't post a screenshot since the message is in German.

If I start a Debug session on the Build Output I get this:

1>------ Build started: Project: Mobile.Android, Configuration: Debug Any CPU ------
emulator: WARNING: x86 emulation may not work without hardware acceleration!
emulator: emulator window was out of view and was recentered
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2084,5): warning MSB3277: Found conflicts between different versions of "System.Numerics.Vectors" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
1>  Mobile.Android -> C:\_Repos\Beep_Mobile\Mobile\Mobile.Android\bin\Debug\Mobile.Android.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Xamarin.Android.Legacy.targets(225,5): warning XA0122: Assembly 'Xamarin.Android.Support.Annotations' is using a deprecated attribute '[assembly: Java.Interop.DoNotPackageAttribute]'. Use a newer version of this NuGet package or notify the library author.
2>Waiting for runtime checks to complete

and then nothing happens anymore

unitrix0 commented 4 years ago

The "Documentation" button leads me to this: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows#hyper-v

If I understand that right I need to install the Hyper-V feature..?

unitrix0 commented 4 years ago

That was it! I installed the Hyper-V component as described in that link now a Nexus 6P with R 11.0 - appi 30 runs but a Pixel 3a does not run with that OS. I guess thats not supported

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 4 years ago

That's strange. You should be able to run avd on AMD without having to install hyper-v, as documented here: Ref: https://developer.android.com/studio/run/emulator-acceleration

Criteria Hypervisor
You have an Intel processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Intel HAXM.
You have an Intel processor and do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.
You have an AMD processor and do not need to run Hyper-V at the same time as the Android Emulator. Use Android Emulator Hypervisor Driver for AMD Processors.
You have an AMD processor and do need to run Hyper-V at the same time as the Android Emulator. Use WHPX.

Personally, I didn't install hyper-v, only the gvm driver.

unitrix0 commented 4 years ago

It is strange... How ever, the table on the page I posted says if you have and AMD CPU use WHPX which leads me to the instructions on installing Hyper-V..... I don't know.

anyway, appreciate your help.

Taogle2018 commented 4 years ago

@unitrix0 I am absent from work recently. The output message is something meaningful to me. It basically means your system has Hyper-V enabled. The purpose of this small utility is to help me figure out the exact system configuration users are using. Whether Hyper-V is enabled can be hard for user to figure out. Later I updated Android Emulator binaries to take advantage of findings of this small unity. You can also now use "emulator-check.exe hyper-v" to check hyper-v status. (Old version may show wrong status). As @fusionneur said, you could either use WHPX (which is built on top of Hyper-V), or disable Hyper-V and try installing again. If you decide to use Hyper-V, you can safely ignore the installation error.