Android emulator still slow as hell even with Intel image, why? - android

I've successfully installed the Intel AVM for Jelly Bean v4.1, and I can create and start an Intel x86 AVM. However it's just as slow as the ARM ones. Having wasted a lot of time on this, as far as I can see the Intel emulation is no faster at all than the ARM images.
I do have HAXM installed, and on starting the emulator a message appears suggesting it's running in "fast" mode, but it's certainly not fast!
Is this because my PC (Windows 7, Intel) is not compatible, or did I miss something? How do I check compatibility?

Quoting the documentation:
The software requires an Intel CPU with Virtualization Technology (VT) support
However, this is not necessarily enabled by default on every machine with a VT-capable CPU. Once again, quoting the documentation:
Virtualization extensions are typically enabled through your computer's BIOS and are frequently turned off by default. Check the documentation for your system's motherboard to find out how to enable virtualization extensions.
So, for example, on a Dell Latitude E6400 sitting to my right, there is a BIOS option for "Enable Intel Virtualization Technology" that you have to check.

Checking the 'use host GPU' option in AVD properties seems to make it a bit faster for me (still slow but usable).
In Eclipse: Window > android Virtual Device Manager > Choose your device > Edit > 'use host GPU' checkbox at bottom.
NOTE: If you are using laptop with nvidia hybrid graphics (GeForce G210M in my case) make sure you have it on high performance before running the emulator. Otherwise Virtual device wont find the graphic card and will crash.
Also apart of "Virtualization Technology" I enabled something called "VTd support" in BIOS. I have no idea what it is or what it does (no description in my BIOS) but either of the above mentioned actions fixed the issue for me

I have the same issue. After making sure everything is properly configured:
(VT enabled in BIOS), Intel HAXM driver installed successfully, AVD details are as they should be.The emulator runs even slower than the ARM one.
If you still face the same problem as well. Star the issue here

Go into the AVD Manager (one of the little Android icons in the toolbar, hover to see which one) and on your AVD change the Memory Options: RAM to 768 MB. Hardware acceleration seems to fail if it's bigger.
(Also make sure "Use Host GPU" is ticked!)
(And also note the messages just below that. You might have to go into the SDK Manager and install an image.)
It still boots up slow, but once it's been running for a minute or two it should be faster. But it's still not as fast as a clean, native device, attached via USB.

In my case, I created and started several x86 emulators on an Linux server(cent os 7), and they all running slowly as hell.
The reason is, by default the emulators are set to have 2 cores, which is far less than the modern cell phones. So I changed the config.ini file in each emulator's directory, add one line hw.cpu.ncore=6(Depends on your major hardware, other properties may affect are hw.ramSize, vm.heapSize and so on. You can see all properties from hardware-qemu.ini in same directory.), and restart the emulators.
The emulators are running much more faster, not too much slower than real phones.
Hope my poor English expresses this clearly.

In my case i have a SSD Samsung 850 pro with software Samsung magician with rapid mode on that was the problem I put it off and android emulator run as a fash again.

Related

Android Studio, Suddenly got GPU Driver Issue when running emulator

I have a laptop that I mainly use for android development on android studio, today all of the sudden got this error message (or an outdated version of it) when i ran my emulator
Your GPU driver information:
GPU #1
Make: 8086
Model: Intel(R) HD Graphics Family
Device ID: 0a16
Driver version: 10.18.10.3945
GPU #2
Make: 10de
Model: NVIDIA GeForce 820M
Device ID: 1140
Driver version: 22.21.13.8476
Some users have experienced emulator stability issues with this driver version. As a result, were selecting a compatibility renderer. Please check with your manufacturer to see if there is an updated driver available.
Updated the geforce driver, but no use, tried to update the intel one but failed, is there a way to disable this? bypass the compatibility renderer and work as I used to, the emulator is awful now. Any explanation why that occurred all of the sudden?
Also I'm using windows 7 64-bit if that will help with anything, had an update few days ago.
I am using Win10 but have the same problem. Emulator started crashing my app after last emulator update. In my case, problem is that emulator does not run on hardware even though I never had a problem with my GPUs. Also, the "GPU driver issue" window that pops up doesn't even label WHICH one of the GPUs it thinks is the problem.
For me the solution that worked is to run emulator from terminal, forcing it to run using hardware graphics (instead of letting emulator decide on which) using command
emulator -avd avd_name -gpu mode
where mode is host so that it will run with hardware.
For example:
Using Android Studio terminal move to folder where the emulator is located. Default on Win10 is: C:\Users\userName\AppData\Local\Android\sdk\emulator
Find emulator to run by listing available ones:
emulator -list-avds
Run emulator with -gpu host option:
emulator -avd avd_name -gpu host
More info on this link
A comment in the on the bug report pertaining to this issue by a Google employee is illuminating.
If your system doesn't have a discrete GPU, we intended this change in
order to make the emulator more reliably run on Intel GPU drivers. At
your own risk, you may switch back to using the Intel GPU by going to
settings page, then changing the OpenGL ES renderer to "ANGLE
(D3D11)", "ANGLE (D3D9)", or "Desktop native OpenGL".
It appears that this message is being displayed for all systems using Intel GPUs, not just systems running specific versions of a graphics driver.
The solution is to, if possible, switch to using an external GPU for running the emulator.
If an Intel GPU is the only GPU available on system it is possible to re-enable accelerated rendering of OpenGL ES, by overriding the default OpenGL ES renderer in settings (see below). Options are OpenGL, ANGLE and SwiftShader. SwiftShader is CPU based OpenGL ES emulation, so this setting will not provide a speedup. ANGLE is Direct3d based OpenGL emulation.
As per the comment this is not guaranteed to work, indeed I am able to re-enable hardware acceleration for Android 7 emulators, but with hardware acceleration enabled, all I receive is a black screen for Android 8 emulators.
Open settings with Ctrl-Shift-S then, depending on the version of the emulator, either go to Settings -> General -> OpenGL ES renderer or to Settings -> Advanced -> OpenGL ES renderer
Newer emulator versions:
Older emulator versions:
Update #1:
Another comment on the bug report provides further illumination on this issue:
If you have just a Intel HD 4xxx running the emulator, it's intended that a compatibility renderer be used. I'm sorry about it, but we need to be able to switch to better-supported Intel GPU drivers especially when running high API levels (25+) of system images. Intel iGPUs of that generation (and older) have many issues with OpenGL compatibility.
It appears that Intel iGPU drivers for Haswell (4th gen) processor and older don't support OpenGL well enough for Android 7.1+ devices. So they are purposely falling back to using software emulation which better supports the new Android emulators.
This matches my experience. Using the Intel iGPU works great on Android 7, but is flaky on Android 7.1 and doesn't work at all on Android 8.
My suggestion, stick with Android 7 emulators when using hardware acceleration for Intel Haswell and older iGPUs.
Update #2:
Official communication on this issue was finally provided in the form of comments in the release notes for Emulator 26.1.3:
Which GPUs will be switched to use ANGLE or Swiftshader rendering is determined as follows:
Older Intel iGPUs have driver issues on both OpenGL and ANGLE D3D drivers. Users with Intel HD Graphics 3xxx and older will use Swiftshader.
Some users reported the inability to use API level 25 images because of a bug in which "Pixel Launcher keeps stopping." This seems to be a driver issue in some Intel HD 4xxx models. So they will be switched to use ANGLE automatically.
For best results with GPU emulation, we recommend either to use a discrete NVIDIA or AMD GPU, or a newer Intel GPU (Iris, HD 5xxx, HD 5xx/6xx).
I ran into this problem today. Per the suggestion from the Google emulator issue tracker, I installed the beta emulator 26.1.3. Problem fixed.
As other suggested, go to Settings -> Appearance & Behaviour -> System settings -> Updates. Change "Automatically check updates for" to "Beta channel". Update emulator to latest beta. Driver issue should be gone. I had problems running fragment with google maps (app chrash) that was solved after update of emulator to latest beta.
I did the same thing as #Api, but I did it from the Virtual Device Manager. In the device edit window, in the Graphics dropdown list, I selected "Hardware - GLES 2.0". I believe the default is Automatic. I still get the erroneous GPU Driver popup window, but the emulator does not crash anymore. It is back to normal reliability.
For linux users, go to Android Folder which in my case is under ~/Android. Then proceed to /sdk/emulator. "emulator" is a local command. So, you can run the command as local "./emulator".
The rest is done as the user "Api" stated.
$ ./emulator -avd -avd_name -gpu mode
$ ./emulator -avd Nexus_5X_API_26 -gpu host (#IN MY CASE)
Note: I didn't download SDK, instead copy and pasted it under /home dir. That's why the command was not valid on a global scale. If you setup sdk avd from ground-up, it should work just fine.
I'm having the exact same issue from precisely 4 days ago. I've tried both above answers but none of it work.
PS. The emulator works, but just crashes seemingly at random. I prior to this error, the emulator worked fine and i could test certain features, i can also debug completely with no crashes via USB with a few android devices so im almost certain its a problem with the emulator.
Edit: Not sure what eactly the problem was, but was solved by forcing Android Studio to run with nVidia GPU.
I managed to workaround this problem by disabling the use of the GPU so that the AVD uses Software acceleration.
It won't be as fast as GPU though, but at least it has better chances to work properly.
I tried other options above but sadly none of them was working.
If you want to try this option, go to the AVD Manager (in Android Studio : Tools -> Android -> AVD Manager), then edit your virtual Device and in the Graphics field, you can set "Software - GLES 1.1" instead if "Hardware - GLES 2.0".
This is not the perfect fix for this problem but it can help.
On Mac OS (currenly i'm using Catalina)
First move to emulator directory
I use the default location
cd /Users/yourusername/Library/Android/sdk/emulator
Search list of emulator
./emulator -list-avds
example my output is :
Pixel_2_XL_API_27
Running emulator using -gpu command
./emulator -avd Pixel_2_XL_API_27 -gpu host
How do I update my GPU drivers?
Select Windows Start > Control Panel.
Open Device Manager.
(Or Search Start for Device Manager.)
Click the arrow next to Display Adapters.
Right-click on Intel HD Graphics and choose Update Driver.
Choose Search automatically for updated driver software.
none of that worked for me on my windows laptop with intel hd4000
what worked is ubuntu linux
after i run emulator on linux i was shocked of its speed :)
so it seems the problem with intel and windows won't be resolved soon

With sufficient specs and Intel® VT enabled, Android Emulator and Genymotion both lag when they're running

When I first started using the emulator than came with Android Studio, it was running very sluggish even with HAXM enabled. I decided to play around with the RAM allowance along with switching between the Software and Hardware option but no dice. I decided later to install Genymotion due to the good reviews and it runs as slow as it does with the other emulator. I've also checked to see if Intel VT was enabled and it was. I also don't run any major applications during the emulation.
I've tried a number of methods and I've yet to find and fix this problem of the poor performance of these emulators.
The processor I'm using is a quad core i5-6300HQ with 8 gigs of ram and a GTX960M graphics card. Windows, Genymotion, and Android Studio (with its SDKs) are all installed onto an SSD.
Is there a method of fixing this that I've missed?
Thanks.
The Resolution I'm using is 1440x2560.

Android Studio: Hardware Acceleration

This is driving me absolutely crazy and I can't find any help. I'm fairly novice when it comes to emulators, and even more so when it comes to Android Studio. Here's my problem: I installed Android Studio. Downloaded the SDK updates, including the HAXM one, and set up my own AVD. Upon trying to start up my AVD, or even the starter AVD that was already there, I get an error stating that "emulator: ERROR: x86 emulation currently requires hardware acceleration!"
I've done some googling and tried to finish the install of HAXM using the install file in the Android/SDK folder. I was promptly told that the installation failed and that my CPU didn't allow for Intel Hardware Acceleration, or something like that. I read somewhere that the only way I can use Hardware Acceleration on AMD is if I were on Linux, with which I have no experience with. So I tried giving up. Now I can't figure out how to disable Hardware Acceleration entirely in Android Studio. I haven't even begun learning how to write in android because I can't get an AVD up and running.
Does anyone have any tips for a complete Android noob? I thought this would be something fun to try since I was at once point fairly good with C++ and I have always been a huge fan of android. However, I've avoided doing anything GUI related until now, and I'm not finding it very fun at the moment.
I'm running an AMD system with 8GB of ram. More specifically, I'm using an AMD FX-4130 Quad-Core Processor on a GIGABYTE GA-970A-DS3 Motherboard.
Unfortunately AMD's virtualization technology AMD-V is not compatible with Intel HAXM. Your only choices are to either get familiar with Linux or use a ARM-based AVD, which doesn't require virtualization.
You can find instructions for Linux on Android Developers' document on Using the Emulator.
You can use Genymotion instead of default one. Its faster than the default one. And this emulator is compatible with both Intel and AMD. Genymotion just uses Virtualbox to run Android in VM.
Here's a link to Genymotion .
Genymotion , Genymotion user guide
it may help you.
Take an android phone with its USB cord then follow these steps:
1. plug in phone to computer.
2. on the phone goto: settings>about device scroll to find build number
3. press build number 7x (this enables developer mode)
4. go back to settings press developers options select usb debugging, include bug reports, verify apps via usb, and GPU force rendering.
5. Check for device connection on the computer
6. add in build.gradle under "buildTypes{" write this
debug { debuggable true }
then when you run your project you should be able to see your phone in the avd selection then select it. Your phone will awaken automatically with your application running except it will be a little semi-efficient boot process.
Also do not forget to remove the debug code from your gradle file when you app is finished.

Android Studio Emulator not starting

Because the emulator was really slow I installed the intel x86 emulator. I changed the settings in my emulator (ARM to intel atom). Now when I run a project it takes me to the emulator selection screen and when I select it, the project starts running, but the emulator doesn't pop up.
I tried switching the cpu back to ARM, but it still doesn't work.
When I close Android studio it asks me if I want to disconnect from the project so I'm sure it is running.
I came across a few posts that said to give the device 768 ram, but that didn't work.
Anyone knows a solution?
I was facing the exact same issue, but for me reducing the device RAM to 768 did fix it. Therefore I'd suggest continuing to decrease the RAM values and trying to launch it.
How about to use Rock speed Emulator - Genymotion?
I know it sometimes take time to launch emulator and launch app in emulator too. But it depends on your configuration of your PC and settings you have done in Eclipse or Android Studio.
For example: You may have kept "Build Automatically" ON and it sometimes slow down running time.
My current rep is not high enough yet to comment on another answer, so I am adding a new "answer" to +1 Paresh Mayani's answer to use Genymotion. I only recently discovered it and found it to be much much faster than the emulator. Instead of emulation it runs an Android rom in a VM using VirtualBox. I've found that it runs full speed on my machine and is just as fast in debug mode as normal mode, which is impressive since even my Nexus 5 struggles when connected to a debugger.
In my case also x86 was creating problem, I installed Android 5.0.1 armeabi-v7a and have set 768MB as RAM size and it worked.
Try to check and run the emulator ie. store a snapshot for faster startup...
I have tried that by checking the button and works fine.
If you're using an AMD machine try using the "ARM EABI v7 system image". For an intel chip use the "APIs Intelx86 Atom system image". Also, try a different tablet from the Android Studio settings e.g(Nexus 6), as the API level might not be supported from in the Nexus5 VM. You will also have a little wait time for the android emulator, mine takes about 7mins

Making the Android emulator run faster

The Android emulator is a bit sluggish. For some devices, like the Motorola Droid and the Nexus One, the app runs faster in the actual device than the emulator. This is a problem when testing games and visual effects.
How do you make the emulator run as fast as possible? I've been toying with its parameters but haven't found a configuration that shows a noticeable improvement yet.
Official web page
~50% faster
Windows:
Install "Intel x86 Emulator Accelerator (HAXM)" => SDK-Manager/Extras
Install "Intel x86 Atom System Images" => SDK-Manager/Android 2.3.3
Go to the Android SDK root folder and navigate to extras\intel\Hardware_Accelerated_Execution_Manager. Execute file IntelHaxm.exe to install. (in Android Studio you can navigate to: Settings -> Android SDK -> SDK Tools -> Intel x86 Emulator Accelerator (HAXM installer))
Create AVD with "Intel atom x86" CPU/ABI
Run emulator and check in console that HAXM running (open a Command Prompt window and execute the command: sc query intelhaxm)
Also don't forget install this one
P.S. during AVD creation add emulation memory: Hardware/New/Device ram size/set up value 512 or more
Linux:
Install KVM: open GOOGLE, write "kvm installation "
Create AVD with "Intel atom x86" CPU/ABI
Run from command line: emulator -avd avd_name -qemu -m 512 -enable-kvm
Or run from Eclipse: Run/Run Configurations/Tab "Target" - > check Intel x86 AVD and in "Additional Emulator Command Line Options" window add: -qemu -m 512 -enable-kvm (click Run)
P.S. For Fedora, for Ubuntu
OS-X:
In Android SDK Manager, install Intel x86 Atom System Image
In Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM)
In finder, go to the install location of the Intel Emulator Accelerator and install IntelHAXM (open the dmg and run the installation). You can find the location by placing your mouse over the Emulator Accelerator entry in the SDK Manager.
Create or update an AVD and specify Intel Atom x86 as the CPU.
P.S: Check this tool, very convenient even trial
UPDATE: Now that an Intel x86 image is available, the best answer is by zest above.
As CommonsWare has correctly pointed out, the emulator is slow because it emulates an ARM CPU, which requires translation to Intel opcodes. This virtualization chews up CPU.
To make the emulator faster, you have to give it more CPU. Start with a fast CPU or upgrade if you can.
Then, give the emulator more of the CPU you have:
Disable Hyperthreading - Since the emulator doesn't appear to utilize more than one core, hyperthreading actually reduces the amount of overall CPU time the emulator will get. Disabling HT will slow down apps that take advantage of multiple CPUs. Hyperthreading must be disabled in your BIOS.
Make the emulator run on a CPU other than CPU 0 - This has a much smaller impact than turning off HT, but it helps some. On Windows, you can specify which CPU a process will run on. Many apps will chew up CPU 0, and by default the emulator runs on CPU 0. I change the emulator to run on the last one. Note that on OS X you cannot set affinity (see: https://superuser.com/questions/149312/how-to-set-processor-affinity-on-a-mac).
I'm seeing somewhere around a 50% improvement with these two changes in place.
To set processor affinity on Windows 7:
Open Task Manager
Click View All Processes (to run as administrator, otherwise you can't set processor affinity)
Right click on emulator.exe and choose Set Affinity...
On the Set Affinity dialog, select just the last CPU
Note: When you change affinity in this way, it's only changed for the lifetime of the process. Next start, you have to do it again.
I would like to suggest giving Genymotion a spin. It runs in Oracle's VirtualBox, and will legitimately hit 60 fps on a moderate system.
Here's a screencap from one of my workshops, running on a low-end 2012 model MacBook Air:
If you can't read the text, it's a Nexus 7 emulator running at 56.6 fps. The additional (big!) bonus is that Google Play and Google Play Services come packaged with the virtual machines.
(The source of the demoed animation can be found here.)
Enable GPU Hardware Acceleration (in addition to Intel's HAXM), if you are using API 15 v3 or newer and SDK Tools v17+. Graphics acceleration for the emulator takes advantage of your development computer's graphics hardware, specifically its graphics processing unit (GPU), to make screen drawing faster. This gives a noticeable boost in speed.
To enable graphics acceleration enabled by default on your emulator: when creating the AVD, in the Hardware section, click New, select GPU emulation and set the value to Yes.
To enable acceleration only at runtime: use the -gpu flag while starting the emulator like this:
emulator -avd <avd_name> -gpu on
Source: Google's Using the Emulator tutorial.
Edit Although using the Intel images gets some performance gains, the performance gained by using Genymotion is much greater. See Paul Lammertsma's answer.
Previous Answer
With ADT rev 17 the emulator supports running x86 system images in virtualization mode on Windows and Mac OS X. This has a noticeable impact on performance.
ADT rev 17 notes:
http://android-developers.blogspot.jp/2012/03/updated-sdk-tools-and-adt-revision-17.html
Configuring Virtual Machine Acceleration:
http://developer.android.com/guide/developing/devices/emulator.html#accel-vm
I recently switched from a core 2 # 2.5 with 3gb of ram to an i7 # 1.73 with 8gb ram (both systems ran Ubuntu 10.10) and the emulator runs at least twice as fast now. Throwing more hardware at it certainly does help.
Just wanted to say that after I installed the Intel HAXM accelerator and use the Intel Atom image the emulator seems to run 50 times faster. The difference is amazing, check it out!
http://www.developer.com/ws/android/development-tools/haxm-speeds-up-the-android-emulator.html
I noticed that the emulator defaults to only Core 0, where most Windows applications will default to "any" core. Also, if you put it on another core (like the last core), it may make the emulator go crazy. If you can, you can try putting your heavy-CPU usage applications on the other CPU cores for a boost in speed.
Hardware-wise, get the fastest CPU you can get that works for single-core applications. More than 2 cores might not experience a huge difference in terms of emulator performance.
Eclipse + the Android emulator together eat up a ton of RAM. I would recommend 3 gigs of RAM at least because I used a system with 2 gigs of RAM, and it slowed down because the system ran out of RAM and started to use the page file.
I feel that the best CPUs for it will probably have a high clock (only use clock as a measure for CPUs in the same series btw), handle non-SIMD operations well, and have a turbo boost mechanism. There aren't many Java-based benchmarks, but overall look for application benchmarks like compression and office. Don't look at gaming or media since those are affected greatly by SIMD. If you find a Java one, even better.
On this year google I/O (2011), Google demonstrated a faster emulator. The problem is not so much on the byte code between ARM and x86 but the software rendering performed by QEMU. They bypass the rendering of QEMU and send the rendering directly to an X server I believe. They showed a car game with really good performace and fps.
I wonder when that will be available for developers...
Google recently announced a new emulator for Android. It's a much faster and better than the old one. You can find more info about it here.
choose a low resolution emulator (eg: Nexus S) if you don't have a good graphic card (like me)
I think it is because clr virtual machine uses cpu directly without code opcode translation.
It may be optimization for clr application or may be windows mobile/window phone 7 started on INTEL proccessor.
Android platform based on linux and theoretically you can start android on virtual machine in i686 environment. In this case virtual machines such as vmware could execute some opcodes direcly. But this option will be allowed only if you write on the Java. Because the Java interpret their byte-code or precompile it before execution.
see:
http://www.taranfx.com/how-to-run-google-android-in-virtualbox-vmware-on-netbooks
Thank you #zest! Worked like a charm. Some things of note: Need to apply Intel's hotfix for the HAXM to deal with kernel panic issue: http://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Also, note, if you have more than one abi, you need to uninstall one due to a bug in the latest version of the Android API (r19): https://code.google.com/p/android/issues/detail?id=66740 (remove armeabi-v7a in this case, since you want the x86 abi). Other than the 45-minutes it took me to resolve these, it was an very rewarding exercise in terms of the increased performance of the emulator.
You could also try the Visual Studio Android Emulator, which can also be installed as a standalone emulator (you don't need Visual Studio). Please note, that it can be installed only on Windows Pro or higher systems.
Use Genymotion instead of emulator. Genymotion has better performance
https://www.genymotion.com
Enabling this option worked for me.
AVD Manager -> Select device and click Edit-> Enable the option 'Use Host GPU'
I've been using the Intel(86) CPU/ABI. I created another emulator using the ARM(armeabi-v7a) and i found quite an improvement with the speed. I'm using platform 4.1.2 API level 16
Update your current Android Studio to Android Studio 2.0 And also update system images.
Android Studio 2.0 emulator runs ~3x faster than Android’s previous emulator, and with ADB enhancements you can now push apps and data 10x faster to the emulator than to a physical device. Like a physical device, the official Android emulator also includes Google Play Services built-in, so you can test out more API functionality. Finally, the new emulator has rich new features to manage calls, battery, network, GPS, and more.
Well question is from 2011 and I am answering in 2022 the best answer in my experience is to start emulator from command in that way the emulator starts a dedicated process and not a sub process of android studio. If the process is independent then it will be able to use the GPU properly and can utilize all resources unlike starting emulator from device manager.
You can create AVD from device manager and start is from the avd folder below is the way to start the emulator independently.
How to open emulator command line

Categories

Resources