4

My Android emulator runs very slow on my Ubuntu machine. I need it to run faster, because some apps are slowed down so much, that they change their behaviour (they use the camera).

System specs:

-x86_64
-Intel(R) Core(TM) i7-5600U CPU @ 2.60 GHz
-20GB Ram
-512Gb HDD

I use Ubuntu 20.04 and Android Studio 4.1.1 (fresh installation). I use this AVD: Pixel2 1080 x 1920: 420dpi API 28 Android 9.0 (Google X86_ARM) CPU/ABI: x86 In the extended menu I chose Graphics: Hardware - GLES 2.0. I also disabled GPS, audioInput and audioOutput with no performance improvements. I did not try this, because selecting Hardware - GLES 2.0 worked for me and the avd started normally (but still very slow).

Other system images are equally slow though.

I tried:

sudo modprobe msr
sudo rdmsr 0x3A

and it returns 5, so VT-X is enabled

Is the hardware the bottleneck, or is something configured wrongly? Maybe it is the HDD that slows the emulator down? I tried running the emulator on Windows and it's insanely fast. The windows machine is stronger though.

Update 11.12.2020: I also verified my KVM installation using this command:

./emulator -avd Pixel2Api28Arm -accel-check

It returned this:

28Arm -accel-check
accel:
0
KVM (version 12) is installed and usable
accel

So this does not seem to be an issue.

ykasur
  • 183
  • 1
  • 11
  • 1
    Run an ARM image in x86_64 host will cause performance problem. I do not know how 'SLOW' on your computer. But suggest you to try a x86_64 image to check your configuration. – progquester Dec 12 '20 at 13:14
  • 1
    The image I am using is not an ARM image. It’s a x86 image that contains an ARM translator. Even without running apps that contain ARM code, the emulator is really slow. – ykasur Dec 12 '20 at 16:11
  • 2
    I've got the same problem with Fedora 33, KVM enabled, and so on... It's absolutely not normal and I don't find the problem – Metal3d Mar 21 '21 at 01:28
  • 2
    I'm facing the same problem too on Fedora 33. – Ercross Apr 05 '21 at 09:22

1 Answers1

0

I was having the same problem (KVM working, but slow x64 emulator on x64 host), and found a solution here, which is to disable automatic snapshot creation.

Run your emulator, and click on the three dots (...) to open the settings:

In the settings, click "Snapshots":

Switch to the "Settings" section on top:

Set "Auto-save current state to Quickboot" to No:

It'll ask you to restart the emulator, click Yes:

BLuFeNiX
  • 2,496
  • 2
  • 20
  • 40