如何在Qemu中添加虚拟GPU? [英] How do I add a virtual GPU into Qemu?

查看:137
本文介绍了如何在Qemu中添加虚拟GPU?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在Qemu中添加虚拟GPU?有人告诉我,这涉及添加使用OpenGL的新图形输出模块?

I was wondering how to go about adding a virtual GPU into Qemu? I have been told it involves adding a new graphics output module that uses OpenGL?

推荐答案

您可能会引用我建议您做的第一件事是阅读源代码,以将已实现的虚拟图形适配器的命令转换为图形输出.然后,您应该重写此代码,以改用OpenGL命令.一旦获得此权限,就必须从字面上发明一个新的虚拟GPU来提供访客系统.我什至不会尝试模仿GeForce或Radeon.无论如何,GeForces都没有公开记录.

The very first thing I suggest you do is reading the source code how commands to the virtual graphics adaptors already implemented are turned into graphical output. Then you should rewrite this, to use OpenGL commands instead. Once you got this you must literally invent a new, virtual GPU to offer the guest system. I'd not even attempt to emulate a GeForce or Radeon. GeForces are not publically documented anyway.

qemu没有提供用于实现GPU的真正API.当然,有一些内部API用于实现VESA和S3仿真,但是新的GPU将要求您重做很多.

qemu doesn't provide a real kind of API for implementing a GPU. Of course there's some internal API for that, used to implement that VESA and S3 emulation, but a new GPU will require you to redo a lot of that again.

虚拟硬件应提供一些I/O来传递绘图命令和数据.从理论上讲,您可以在此处传递全套OpenGL命令.但是OpenGL与硬件无关,而实际上是实现硬件"的,因此必须在其中找到一些平衡点.然后,在qemu中,您必须实现该虚拟硬件才能正确执行渲染命令.

The virtual hardware should offer some I/O to pass drawing commands and data. In theory you could pass the full set OpenGL commands there. However OpenGL is hardware agnostic, whereas you actually implement "hardware", so you must find some balance there. Then in qemu you must implement that virtual hardware to execute the rendering commands apropriately.

最后但并非最不重要的一点是,您必须为该虚拟硬件实现驱动程序,这将涉及向Mesa添加新驱动程序并为Xorg创建驱动程序.

Last but not least you must implement drivers for that virtual hardware, which will involve adding a new driver to Mesa and creating a driver for Xorg.

这篇关于如何在Qemu中添加虚拟GPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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