安卓:为什么快照和GPU相互排斥? [英] Android: why snapshots and gpu are mutually exclusive?

查看:153
本文介绍了安卓:为什么快照和GPU相互排斥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用快照和GPU支持模拟器两种。但仿真器拒绝启动:

  

模拟器:错误:快照和GPU是相互排斥的,在这   点。请把他们的一关,并重新启动仿真器。

我不知道什么是对这些限制的原因是什么?这并不在我看来,作为逻辑冲突。

解决方案

Android模拟器是基于QEMU,具有模拟各种硬件设备如将通过在真正的手机运行的是Android中找到。特别是它模拟了一个神秘的电话被称为金鱼。

当您保存快照,该设备的RAM必须保存在快照中。但是,这并不意味着只在主RAM - 它也指在电话硬件的所有其他繁琐比特 - 例如CPU寄存器,的实时时钟的硬件的状态下,而在所有其他的任何/所有寄存器一块硬件在这个虚拟电话

如果您还没有启用GPU,则图形硬件的状态非常简单 - 这将是一个帧缓冲,和几个寄存器重新presenting的X尺寸,Y尺寸和像素格式

然而,如果你启用了GPU直通,然后保存该硬件的状态会更复杂。 QEMU必须保存每个纹理的状态,什么相机设置,几何形状,并保存在一个GPU一个squillion其他更多的东西。流入到GPU命令的管道也将具有在任意点被打断,并执行记录,这些命令的状态(硬因为有一个多级管道和某些指令可能已被部分执行)。

此外,它可能是非常困难的实际QEMU来的获得的这些信息,因为QEMU只是通过它通过对主机的GPU。有没有办法让QEMU问主机GPU的驱动程序到底发生了什么什么被执行,而不是。最起码,这将需要支持的主机操作系统和GPU的驱动程序,它甚至可能需要更改的GPU管线把事情简单化,使得管道可以停止和重新启动在任意点。

I tried to use snapshots and gpu support for emulator both. But emulator refused to start:

emulator: ERROR: Snapshots and gpu are mutually exclusive at this point. Please turn one of them off, and restart the emulator.

I wonder what is the reason for these limitations? It doesn't seems to me as logical collision.

解决方案

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.

这篇关于安卓:为什么快照和GPU相互排斥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆