我一直在使用Intel / Nvidia混合图形配置作为来宾OS的Ubuntu 12.04 32位笔记本电脑上尝试一个名为androVM的Android虚拟机(详细信息在下面的图形卡上)。我测试了一些图形密集型应用程序,例如Angry Birds和基准测试应用程序AnTuTu,它们都可以运行virtualbox
并AndroVMplayer
带有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)
./AndroVMplayer
第一次在新的VM上调用时,我单击“启用硬件加速”。
sudo primusrun lshw -class display
并且两张卡都出现了。另外,当我运行时,我primusrun firefox
在此网站webglsamples.googlecode.com/hg/aquarium/aquarium.html上获得40-50fps的帧速。没有时我只能达到5fps左右primusrun
。