使用primusrun在AndroVM中进行Android 3D加速?


19

我一直在使用Intel / Nvidia混合图形配置作为来宾OS的Ubuntu 12.04 32位笔记本电脑上尝试一个名为androVM的Android虚拟机(详细信息在下面的图形卡上)。我测试了一些图形密集型应用程序,例如Angry Birds和基准测试应用程序AnTuTu,它们都可以运行virtualboxAndroVMplayer带有primusrun,但是它们看起来确实很慢,与不使用时没有任何区别primusrun。我也尝试过optirun,它只会因段错误而崩溃。如何在混合图形系统中为此虚拟机启用OpenGL加速?

我正在运行的AndroVM版本是这个版本:

androVM_vbox86tp_4.1.1_r6.1-20130222-gapps-houdini-flash.ova

我正在按照此处说明的安装说明进行操作:
AndroVM 20130222版本| AndroVM博客

在“ Virtualbox”下,我将“切换的图形”选项设置为128MB视频内存,并启用了3D加速和2D加速。我的主机BIOS已激活其虚拟化选项。这是我的硬件详细信息:

sudo primusrun lshw -class display

*-display               
   description: VGA compatible controller
   product: GT218 [GeForce 310M]
   vendor: NVIDIA Corporation
   physical id: 0
   bus info: pci@0000:01:00.0
   version: a2
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
   configuration: driver=nvidia latency=0
   resources: irq:16 memory:d2000000-d2ffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:d000(size=128) memory:d3000000-d307ffff
*-display
   description: VGA compatible controller
   product: Core Processor Integrated Graphics Controller
   vendor: Intel Corporation
   physical id: 2
   bus info: pci@0000:00:02.0
   version: 18
   width: 64 bits
   clock: 33MHz
   capabilities: msi pm vga_controller bus_master cap_list rom
   configuration: driver=i915 latency=0
   resources: irq:52 memory:d3400000-d37fffff memory:b0000000-bfffffff ioport:e080(size=8)

使用时optirun ./AndroVMplayer,我得到以下信息:

[VGL] WARNING: The OpenGL rendering context obtained on X display
[VGL]    :8 is indirect, which may cause performance to suffer.
[VGL]    If :8 is a local X display, then the framebuffer device
[VGL]    permissions may be set incorrectly.
Got command 1002
Got command 1002
Got command 1
Got command 1002
Segmentation fault (core dumped)

这是我的virtualbox安装的详细信息:

 dpkg -l virtualbox* | grep ii    

ii  virtualbox                                4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - base binaries
ii  virtualbox-dkms                           4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - kernel module sources for dkms
ii  virtualbox-guest-additions                4.1.12-1                                             transitional package for virtualbox-guest-additions-iso
ii  virtualbox-guest-additions-iso            4.1.12-1                                             guest additions iso image for VirtualBox
ii  virtualbox-guest-dkms                     4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - guest addition module source for dkms
ii  virtualbox-guest-utils                    4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - non-X11 guest utilities
ii  virtualbox-guest-x11                      4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - X11 guest utilities
ii  virtualbox-qt                             4.1.12-dfsg-2ubuntu0.2                               x86 virtualization solution - Qt based user interface

如果使用运行它optirun,则会出现以下错误:

> [VGL] WARNING: The OpenGL rendering context obtained on X display
> [VGL]    :8 is indirect, which may cause performance to suffer. [VGL] 
> If :8 is a local X display, then the framebuffer device [VGL]   
> permissions may be set incorrectly.
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glCompileShader:351
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderiv:1215
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderInfoLog:1238
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glCompileShader:351
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderiv:1215
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderInfoLog:1238
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glCompileShader:351
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderiv:1215
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderInfoLog:1238
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glCompileShader:351
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderiv:1215
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderInfoLog:1238
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glCompileShader:351
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderiv:1215
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetShaderInfoLog:1238
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glGetUniformLocation:1382
> error 0x501
> sdk/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glUseProgram:1913
> error 0x501 AndroVMplayer: ../../src/xcb_conn.c:180: write_vec:
> Assertion `!c->out.queue_len' failed. Aborted (core dumped)

我将输出更正为运行时得到的结果,sudo primusrun lshw -class display并且两张卡都出现了。另外,当我运行时,我primusrun firefox在此网站webglsamples.googlecode.com/hg/aquarium/aquarium.html上获得40-50fps的帧速。没有时我只能达到5fps左右primusrun
719016 2013年

hmmm-也许不是必需的-您是否已按照androvm.org/blog/androvm-documentation在androvm中定义了启用硬件的opengl设置?
fossfreedom

是的,当我./AndroVMplayer第一次在新的VM上调用时,我单击“启用硬件加速”。
719016 2013年

...,您已经按照该链接中的硬件opengl部分设置了网络,并通过run.sh脚本(或使用primusrun的脚本的变体)运行了网络。
fossfreedom

1
方法,应禁用2D加速。只有3D。
Cubiq

Answers:


1

在运行android环境时,openGL使用特定的规则。我无法完全回答您的问题,但是我可以向您推荐Android开发工具包。developer.android.com/sdk/设置完成后,它将自动配置您的设置以优化渲染效果,并可以提供3d Android环境。


1

您可以尝试GenyMotion。只需单击一次即可设置并以x86模式运行。

这真的是快速的Android模拟器。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.