On my brand new Win11 Pro machine (AMD Ryzen 9 7950X) my Visual Studio 2022 Enterprise installation (v17.7.6) doesn't use hardware acceleration when I disable Hyper-V
and enable AEHD
(or GVM).
Short version
When I start an emulated device via the Visual Studio Android Device Manager
this error message shows up and the performance is crazy slow: Hyper-V is not configured. Turn on "Hyper-V" feature to switch to the Native Hypervisor and accelerate your emulator.
When I start it via batch/cmd using "C:\Program Files (x86)\Android\android-sdk\emulator\emulator.exe" -avd pixel_5_-_api_33
everything works fine.
Long version
- I have followed the instructions for android and MAUI.
- I made sure Hyper-V is really off
- I've installed the newest AEHD v2.1 (formerly GVM) from github
sc query aehd
says: RUNNINGemulator-check.exe hyper-v
says: Hyper-V is not installed (C:\Program Files (x86)\Android\android-sdk\emulator\emulator-check.exe)emulator-check.exe accel
says: GVM (version 2.1) is installed and usable.
But most importantly (as mentioned in the short version above): AEHD (hardware acceleration) works when started via cmd.
Why
does Android Device Manager
(which has nothing to do with the Android-Studio/Google Device Manager as the AndroidDevices.exe seems to be by Xamarin Inc.) forces me to have Hyper-V installed?
It took me ages, dozens of uninstall/install of AEHD/Hyper-V and luck to find out its an VS issue and not a driver/installation issue.
I've only found one more post on about the same issue here.
I cannot imagine this being a "global" bug and I'm the only one complaining about this...
Any help, thoughts and hints are highly appreciated. Thanks in advance.
PS: I do not want and cannot install/use Hyper-V as an active Hyper-V is incompatible with other software I'm running.
update 1
Here I've found the location of the log files of the Device Manager.
My logfile in c:\Users\<user>\AppData\Local\Xamarin\Logs\17.0\*.devicemanager.log
looks like this:
... [23-11-05 12:40:43.00] Component Android Emulator hypervisor driver (installer) r2.0.0 [Extra: (Google LLC.)] not present on the system [23-11-05 12:40:43.00] Component Intel x86 Emulator Accelerator (HAXM installer) r7.6.5 [Extra: (Intel Corporation)] not present on the system [23-11-05 12:40:43.00] Component Intel x86 Emulator Accelerator (HAXM installer) r7.6.5 [Extra: (Intel Corporation)] not present on the system...[23-11-05 12:41:10.00] AVDStatusToButtonTextConverter [Convert]Start[23-11-05 12:41:10.00] [HypervisorManager] Checking for accelerated emulator: True[23-11-05 12:41:10.00] [ProcessStartInfoAsInvoker] Executing command: "cmd" "/C" "sc" "query" "intelhaxm"[23-11-05 12:41:10.02] [ProcessResult] cmd result: StandardOutput: [SC] EnumQueryServicesStatus:OpenService FAILED 1060: The specified service does not exist as an installed service. ExitCode: 1060[23-11-05 12:41:10.18] [HypervisorManager] IsWHPOn: False[23-11-05 12:41:10.18] [HypervisorManager] IsHyperVOn: False[23-11-05 12:41:10.18] [HypervisorManager] SupportsHyperVOnlyAcceleration: True...
It claims Hypervisor driver is not installed (which in the logged version it isn't). So I installed the official v2.0 from the SDK-Manager and tried again:
... [23-11-05 12:50:44.84] Detecting component Android Emulator hypervisor driver (installer) r2.0.0 [Extra: (Google LLC.)] in directory 'C:\Program Files (x86)\Android\android-sdk\extras/google/Android_Emulator_Hypervisor_Driver' [23-11-05 12:50:44.84] Found revision 2.0.0 on the system [23-11-05 12:40:43.00] Component Intel x86 Emulator Accelerator (HAXM installer) r7.6.5 [Extra: (Intel Corporation)] not present on the system [23-11-05 12:40:43.00] Component Intel x86 Emulator Accelerator (HAXM installer) r7.6.5 [Extra: (Intel Corporation)] not present on the system...[23-11-05 12:41:10.00] AVDStatusToButtonTextConverter [Convert]Start[23-11-05 12:41:10.00] [HypervisorManager] Checking for accelerated emulator: True[23-11-05 12:41:10.00] [ProcessStartInfoAsInvoker] Executing command: "cmd" "/C" "sc" "query" "intelhaxm"[23-11-05 12:41:10.02] [ProcessResult] cmd result: StandardOutput: [SC] EnumQueryServicesStatus:OpenService FAILED 1060: The specified service does not exist as an installed service. ExitCode: 1060[23-11-05 12:41:10.18] [HypervisorManager] IsWHPOn: False[23-11-05 12:41:10.18] [HypervisorManager] IsHyperVOn: False[23-11-05 12:41:10.18] [HypervisorManager] SupportsHyperVOnlyAcceleration: True...
The driver is no found, but still the same issue. I reckon its a bug in AndroidDevices.exe as it always starts virtual device with Executing command: "cmd" "/C" "sc" "query" "intelhaxm"
which forces HAXM apparently :(