Android x86 emulator with hardware acceleration on AMD processors

Since Leeloo and my parents has bought me a Samsung Galaxy S3, I’m interested in developing for Android again. I already tried once with my old HTC Dream, but 128 MB of RAM had rapidly stopped me. But before anything else, I wanted to create a development and test environment. My previous boss had me convinced for a long time that TDD (Test Driven Development, software development driven by tests) was the path to follow.

I do not like changing my computer while it is still working perfectly, and my loyal qy.net is still in good shape after 4 years of 24/7 operations (this is the home router and my desktop computer). The main processor, an AMD Turion TL56 (dual core processor running at 1.8 GHz) is OK for most of my daily development, but it is deadly slow to run the Android emulator for ARM processor, this is unusable!

However, this processor supports hardware virtualization and I thought about the Atom x86 Android version advocated by Intel. I thought that developing java applications was mostly similar on a ARM or x86 underlying machine.

But, unfortunately, even following instructions by the book, the emulator screen stayed desperately blank as soon as I turned on the KVM hardware acceleration.

The basic interface of android avd was not very verbose about the reason of the crash.

Manually launching the emulator from the command line was a bit more useful:

emulator -avd W1 -show-kernel -verbose 

The problem is easily diagnosed:

[    0.582943]  mmcblk0:
[    0.589697] registered taskstats version 1
[    0.589697] Freeing unused kernel memory: 288k freed
[    0.599681] Kernel panic - not syncing: Attempted to kill init!

The Linux kernel was panicking and did not manage to start correctly. The strange thing was that most of the boot process was done and only accessing to the local filesystem seemed to crash. But the problem was related to the KVM acceleration,without any doubt, because if I deactivated it with the following command:

emulator -avd W1 -show-kernel -verbose -qemu -disable-kvm

Then the system started correctly. Leeloo has a laptop with an Intel processor, so I tried to boot the system on it and the hardware acceleration worked flawlessly. I spent some time investigating the problem and testing on various processors, AMD opteron 170, opeteron 2356 and some Intel Xeon. I came to the conclusion that the hardware acceleration did not work on any processors from AMD, whereas everything was working correctly on Intel processors.

Defeated

I tried sor so many evenings to make hardware acceleration work on my AMD processor, recompiling about everything in the Android development kit, kernel, core, applications… But I never succeeded. I could only manage to boot the system, but somehow the system had a memory allocation instability that prevent any usage.

My best shot was using the virtualbox image with this virtualization solution. To do so you need to recompile the android kit for virtualbox, there are plenty of tutorials on the net. The result was disappointing and just a bit better than my shot with KVM, I’d get a running system with incessant application crashes, suggesting the problem was related to some core problem in the code used for atom-based processors…

Leave a Reply