vmgl: vmm-independent graphics acceleration · suspend resume performance quake 3 enemy unreal...
TRANSCRIPT
VMGL: VMM-Independent Graphics Acceleration
H. Andrés Lagar-Cavilla, U of [email protected] Tolia (CMU), Eyal de Lara (Toronto), M. Satyanarayanan (CMU)
Why Virtualize 3D Acceleration?
Two simultaneous trends
VMs out of the server room
Client apps going 3D
●
Virtualization of Client Apps
SoulpadsThe CollectiveInternet Suspend/ResumeVirtual AppliancesMoka5
The World Is Going 3D
Why Is 3D Virtualization Hard?3D vendors compete through HW diversityLack of unifying hardware abstractionClosed specs
Open HW abstractions simplify virtualization:Network -> Ethernet FrameBlock Devices -> BIO requestSCSI drives -> SCSI command packet....
How could we ever write 3D applications?
3D Rendering APIs
De facto unifying sotware abstractionDeveloper gets vendor independence
Two main APIsOpenGLDirect3D
OpenGLCross-platform
VMGL: Virtualizing OpenGL
Provides 3D HW acceleration to applications running inside virtual machines
GPU independentVMM independentGuest OS independent
87% or better of native HW accelerationTwo orders of magnitude better than Mesa
VMGL Design
API virtualizationGPU vendor independence
OpenGL: cross-platform APIGuest OS independence
Network CommunicationVMM independence
OpenGL Apps In X11 Systems
GPU
Application
X ServerVendor
Open GL
3D 2D
VMGL Apps in X11 Guest VMs
GPU
VM Viewer: VNC, SDL
VMGL Stub
VendorOpen GL
Application
X Server VMGL GL Commands
Guest Host:Dom 0
Implementation Aspects
Efficient GL network transport
3D and 2D output composing in VM viewer
Suspend/Resume implementation
Dom0 drivers
Efficient GL Transport
Transport over networkVMM Independence
WireGL / Chromium
Only send updates that “ matter”glTextureXY only when texture visible
Combine, reorder and buffer commandsglRotate + glTranslate ->
Single matrix transformation
Window Manager Extension
Compose 3D and 2D output on VM viewer
Extension in VM's X server tellsviewer 3D outputPositionSize Clipping
Suspend / Resume
Think each GL app as a GL deviceRuntime: keep track of OpenGL stateSuspend: “ freeze” G L device (trivial)Resume: flush state to new GL stub
OpenGL state is GPU independentSuspend/resume across different GPUs
OpenGL state is boundedUpper bound: GPU mem size
VMGL Suspend / Resume State
WindowsVisual bitsBinding to window manager extension
GL ContextsContext data: fog, transformations...Textures: pixmap, clamp modeDisplay Lists: verbatim unrolling
Domain 0 GPU Drivers
ATI & Nvidia:GPU Mem mapping in user-space GL lib
Oblivious to Xen additional indirectionVirtual -> Physical (VM) -> MachineEven for domain 0
Fix open source portion of driverUse Xen-paravirt mem mapping functions
VMGL Evaluation
VMGL: OpenGL VirtualizationAPI v1.5Shaders through extensions
Frames per secondCPU, bandwidth consumptionResume latency, state size
WorkloadsGames & entertainment fuel 3D industry
Workloads
Enemy Territory
Unreal 2004
Quake 3
Mplayer
Performance (FPS)
Quake 3 Enemy Unreal Mplayer
0
10
20
30
40
50
60
70
80
90
Native
Performance (FPS)
Quake 3 Enemy Unreal Mplayer
0
10
20
30
40
50
60
70
80
90
NativeMesa
Performance (FPS)
Quake 3 Enemy Unreal Mplayer
0
10
20
30
40
50
60
70
80
90
NativeMesa
VMGL
87% or better of native performance
VMM Portability (FPS)
Quake 3 Enemy Unreal Mplayer
0
10
20
30
40
50
60
70
80
90
Xen HVM
VMwareXen PV-HVM
Xen PV
VMM and VM type independent
Guest OS Portability (FPS)
FreeBSD Open Solaris Linux
0
10
20
30
40
50
60
70
80
90
Mesa
VMGL
Easily ported to other X11-based OSs
Suspend Resume Performance
Quake 3 Enemy Unreal Mplayer0
10
20
30
40
50
60
70
80
Quake 3 Enemy Unreal Mplayer0
500
1000
1500
2000
2500
State Size(MBs) Resume Time (ms)
State size boundedAlso across GPUs from different vendors
Wrapping Up
VMGL: OpenGL virtualization -> 1K downloads
Enable intersection of two growing trendsVirtualization3D Graphics
GPU/vendor independenceVMM independenceGuest OS independence
To appear @ VEE 2007More eval & details there
TODO
Xen-specific improvementsShared memory transport (XenSocket?)
WindowsCode portingWindow Manager hooksDirect3D support via translation layers