vmgl: vmm-independent graphics acceleration · suspend resume performance quake 3 enemy unreal...

27
VMGL: VMM-Independent Graphics Acceleration H. Andrés Lagar-Cavilla, U of Toronto [email protected] Niraj Tolia (CMU), Eyal de Lara (Toronto), M. Satyanarayanan (CMU)

Upload: others

Post on 13-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

VMGL: VMM-Independent Graphics Acceleration

H. Andrés Lagar-Cavilla, U of [email protected] Tolia (CMU), Eyal de Lara (Toronto), M. Satyanarayanan (CMU)

Page 2: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Why Virtualize 3D Acceleration?

Two simultaneous trends

VMs out of the server room

Client apps going 3D

Page 3: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Virtualization of Client Apps

SoulpadsThe CollectiveInternet Suspend/ResumeVirtual AppliancesMoka5

Page 4: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

The World Is Going 3D

Page 5: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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?

Page 6: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

3D Rendering APIs

De facto unifying sotware abstractionDeveloper gets vendor independence

Two main APIsOpenGLDirect3D

OpenGLCross-platform

Page 7: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 8: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

VMGL Design

API virtualizationGPU vendor independence

OpenGL: cross-platform APIGuest OS independence

Network CommunicationVMM independence

Page 9: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

OpenGL Apps In X11 Systems

GPU

Application

X ServerVendor

Open GL

3D 2D

Page 10: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 11: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Implementation Aspects

Efficient GL network transport

3D and 2D output composing in VM viewer

Suspend/Resume implementation

Dom0 drivers

Page 12: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 13: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Window Manager Extension

Compose 3D and 2D output on VM viewer

Extension in VM's X server tellsviewer 3D outputPositionSize Clipping

Page 14: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 15: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

VMGL Suspend / Resume State

WindowsVisual bitsBinding to window manager extension

GL ContextsContext data: fog, transformations...Textures: pixmap, clamp modeDisplay Lists: verbatim unrolling

Page 16: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 17: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

VMGL Evaluation

VMGL: OpenGL VirtualizationAPI v1.5Shaders through extensions

Frames per secondCPU, bandwidth consumptionResume latency, state size

WorkloadsGames & entertainment fuel 3D industry

Page 18: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Workloads

Enemy Territory

Unreal 2004

Quake 3

Mplayer

Page 19: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Performance (FPS)

Quake 3 Enemy Unreal Mplayer

0

10

20

30

40

50

60

70

80

90

Native

Page 20: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

Performance (FPS)

Quake 3 Enemy Unreal Mplayer

0

10

20

30

40

50

60

70

80

90

NativeMesa

Page 21: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 22: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 23: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 24: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 25: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

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

Page 26: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

TODO

Xen-specific improvementsShared memory transport (XenSocket?)

WindowsCode portingWindow Manager hooksDirect3D support via translation layers

Page 27: VMGL: VMM-Independent Graphics Acceleration · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake 3 Enemy Unreal Mplayer 0 500 1000 1500 2000

THANKS

Demo

Q&A

[email protected]/~andreslc/vmgl/