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

VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMM-Independent Graphics Acceleration

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

Page 2: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Why Virtualize 3D Acceleration?

Two simultaneous trends

VMs out of the server room

Client apps going 3D

And we only have software rendering (Mesa)

Page 3: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Virtualization of Client Apps

SoulpadsThe CollectiveInternet Suspend/ResumeVirtual AppliancesMoka5, MojoPac, BlackDog, ...

Page 4: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

The World Is Going 3D

Page 5: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

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: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

3D Rendering APIs

De facto unifying software abstractionDeveloper gets vendor independence

Two main APIsOpenGLDirect3D

OpenGLCross-platform

Page 7: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMGL: Virtualizing OpenGL

Provides 3D HW acceleration to applications running inside virtual machines

GPU independentVMM independentGuest OS independentSuspend and resume capable

87% or better of native HW accelerationTwo orders of magnitude better than Mesa

Page 8: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMGL Design

API virtualizationGPU vendor independence

OpenGL: cross-platform APIGuest OS independence

Network CommunicationVMM independence

Page 9: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

OpenGL Apps In X11 Systems

GPU

Application

X ServerVendor

Open GL

3D 2D

Page 10: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMGL Apps in X11 Guest VMs

GPU

VMGL Stub

VendorOpen GL

Application

GL Commands

GuestHost

VM Viewer: VNC, SDL

VMGLX Server

Page 11: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Implementation AspectsOpenGL API v1.5

Shaders through extensions

Efficient GL network transport

3D and 2D output composing in VM viewer

Suspend/Resume implementation

Xen-specific: Domain 0 drivers

Page 12: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Implementation AspectsOpenGL API v1.5

Shaders through extensions

Efficient GL network transport

3D and 2D output composing in VM viewer

Suspend/Resume implementation

Xen-specific: Domain 0 drivers

Page 13: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Efficient GL Transport

Transport over networkVMM Independence

WireGL / ChromiumIntended for tiled rendering

Only send updates that “ matter”glTextureXY only when texture visible

Combine, reorder and buffer commandsglRotate + glTranslate ->

Single matrix transformation

Page 14: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Output Composing in VM Viewer

3D & 2D output coming from different sources

Extension in VM's X server tellsviewer about 3D windowsPositionSize Clipping

Page 15: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

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 boundedSee experiments

Page 16: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMGL Suspend / Resume State

WindowsVisual bitsBinding to window manager extension

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

Page 17: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMGL Evaluation VMGL: OpenGL Virtualization

VMMsXen – Paravirtual (results unless otherwise noted)Xen – HVMVMware Workstation

OSsLinux 2.6.16.29OpenSolaris 10 rel 06/06FreeBSD rel 6.1

HardwareATI X600, Intel Dual Core 2.4 GHz, VT, 2GB Ram

Page 18: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Workloads

Enemy Territory

Unreal 2004

Quake 3

Mplayer

Page 19: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Performance (FPS)

Quake 3 Enemy Unreal Mplayer

0

10

20

30

40

50

60

70

80

90

Native

Page 20: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Performance (FPS)

Quake 3 Enemy Unreal Mplayer

0

10

20

30

40

50

60

70

80

90

NativeMesa

Page 21: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

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: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

VMM Portability (FPS)

Quake 3 Enemy Unreal Mplayer

0

10

20

30

40

50

60

70

80

90

Xen HVM

VMware WorkstationXen PV-HVM

Xen PV

VMM and VM type independent

Page 23: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Guest OS Portability (FPS)

FreeBSD Open Solaris Linux

0

10

20

30

40

50

60

70

80

90

Mesa

VMGL

VMGL easily ported to other X11-based OSs

Quake 3 on VMware Workstation

Page 24: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

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: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Wrapping UP

VMGL: OpenGL virtualization

Enable intersection of two growing trendsVirtualization3D Graphics

GPU/vendor independenceVMM independenceGuest OS independence

More eval & details in paper

Page 26: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

TODO

VMM-specific improvementsShared memory transport

WindowsCode portingWindow Manager hooksDirect3D support via translation layers

Page 27: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

THANKS

DemoQ&A

2549 Downloads and counting: www.cs.toronto.edu/~andreslc/vmgl/

[email protected]

Page 28: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

BACKUP

Page 29: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Xen 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 driver

Use Xen-paravirt mem mapping functions

Page 30: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Performance (FPS)

Quake 3 Enemy Unreal Mplayer0

10

20

30

40

50

60

70

80

90

NativeMesa

VMGL

87% or better of native performance

Page 31: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Concurrent Execution

Quake 3 Enemy Unreal Mplayer0

0.2

0.4

0.6

0.8

1

VMGL

Native

Page 32: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

CPU Consumption - Unreal

Page 33: VMM-Independent Graphics Accelerationlagarcavilla.org/publications/slides/VEE-2007/vmgl.pdf · Suspend Resume Performance Quake 3 Enemy Unreal Mplayer 0 10 20 30 40 50 60 70 80 Quake

Bandwidth Consumption - Unreal