创建新的AVD,同时检查快照和使用主机GPU(Create new AVD, check both

2019-10-19 19:03发布

我设法创建一个AVD ,但我不能同时检查SnapshotUse Host GPU 。 什么是两者的优势? 为什么我不能同时使用? Vogella告诉我 ,无论加快这一进程的不同部分,所以对我来说很有意义,他们都应该能够使用。

Answer 1:

I think you can not; my AVD manager explicitly disallows it:

From Android: why snapshots and gpu are mutually exclusive?:

The Android emulator is based on QEMU, which has to simulate various hardware devices as would be found by Android running on a real phone. Specifically it simulates a mythical phone called 'goldfish'.

When you save a snapshot, the device RAM must be saved in the snapshot. But, that doesn't just mean the main RAM - it also refers to all the other fiddly bits of the phone hardware - for example the CPU registers, the state of the real-time clock hardware, and any/all registers in every other piece of hardware in this virtual phone.

If you've not enabled GPU, then the graphics hardware state is fairly simple - it will be a framebuffer, and a few registers representing the x dimension, y dimension and pixel format.

However, if you've enabled GPU passthrough, then saving the state of that hardware would be much more complex. QEMU would have to save the state of each texture, what cameras are set up, geometry, and a squillion other more things which are kept in a GPU. The pipeline of commands flowing to the GPU would also have to be interrupted at an arbitrary point, and the state of execution of those commands recorded (hard since there's a multi-stage pipeline and some instructions may have been partially executed).

Moreover, it might be very hard for qemu actually to get to this information, since qemu is just passing it through to the host GPU. There's no way for qemu to ask the host GPU driver exactly what's been executed and what hasn't. At the very least, this would require support by the host operating system and GPU driver, and it might even require changes to the GPU pipeline to simplify things such that the pipeline can be stopped and restarted at arbitrary points.



文章来源: Create new AVD, check both Snapshot and Use Host GPU