26
XenGT: a So+ware Based Intel Graphics Virtualiza;on Solu;on Oct 22, 2013 Haitao Shan, [email protected] Kevin Tian, [email protected] Eddie Dong, [email protected]

XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

Embed Size (px)

DESCRIPTION

GPU virtualization has become an increasingly important requirement for client virtualization and cloud. Significant challenges exists realizing the multiplexing of graphics, media and compute workloads from multiple VMs and achieving the goals of being fully functional, high performance and secure. In this presentation, we will first review existing graphics virtualization technologies, and then introduce how XenGT - an open source solution from Intel - approaches differently. Broad functionality and good performance is achieved by accelerating the native OS graphics stack in each VM with minimum hypervisor intervention. A software mediator ensures the secure multiplexing of workloads from the multiple VMs by managing the scheduling of VMs on the GPU and controlling access to privileged resources and operations.

Citation preview

Page 1: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

XenGT:  a  So+ware  Based  Intel  Graphics  Virtualiza;on  Solu;on

Oct 22, 2013

Haitao Shan, [email protected]

Kevin Tian, [email protected]

Eddie Dong, [email protected]

Page 2: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

2

!Agenda

•  Background

•  Existing Arts

•  XenGT Architecture

•  Performance

•  Summary

Page 3: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

Background

Page 4: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

4

!Graphics Computing

•  Entertainment applications •  Gaming, video playback, browser, etc.

•  General purpose windowing •  Windows Aero, Compiz Fusion, etc

•  High performance computing •  Computer aided designs, weather broadcast, etc.

Same capability required, when above tasks are moved into VM

Page 5: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

5

!Graphics Virtualization

•  Performance vs. multiplexing •  Consistent and rich user experience in all VMs •  Share a single GPU among multiple VMs

Client Rich Virtual Client

Server VDI, transcoder, GPGPU

Embedded Smartphone, tablet, IVI

Page 6: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

Existing Arts

Page 7: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

7

!Device Emulation

•  Only for legacy VGA cards •  E.g. Cirrus logic VGA card

•  Limited graphics capability •  2D only •  Optimizations on frame buffer operations

•  E.g. PV framebuffer

•  Impossible to emulate a modern GPU •  Complexity •  Poor performance

Page 8: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

8

!Split Driver Model

•  Frontend/Backend drivers •  Forward OpenGL/DirectX API calls •  Implementation specific for the level of

forwarding •  E.g. VMGL, VMware vGPU, Virgil

•  Hardware agnostic

•  Challenges on forwarding between host/guest graphics stacks

•  API compatibility •  CPU overhead

Page 9: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

9

!Direct Pass-Through/SR-IOV

•  Best performance with direct pass-through •  However no multiplexing

Page 10: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

XenGT Architecture

Page 11: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

11

!XenGT

•  A mediated pass-through solution for graphics virtualization

•  Pass-through performance critical resources •  Trap-and-emulate privileged operations

•  Maintain a device model per VM

•  Run native graphics driver in VM

•  Achieve good performance and moderate multiplexing capability

Device Emulation Split Driver Model Mediated Pass-Through

Direct Pass-Through

Performance

Multiplexing

Page 12: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

12

!XenGT Architecture

Page 13: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

13

!Intel Processor Graphics

•  Graphics memory •  Virtual memory address spaces

•  A single global virtual memory (GVM) space •  Multiple per-process virtual memory (PPVM)

spaces •  Backed by system memory through GTTs

•  Render engine •  Fulfill the acceleration capability through

fixed pipelines and execution units

•  Display engine •  Route date from graphics memory to

external monitors

•  Global state •  Represent remaining circuits, including

initialization, PM, etc.

Render Engine

Display Engine

GPU

Graphics Memory (System Memory)

State

Global State

State

Global Virtual Memory

Global Graphics Translation Table

(GGTT)

Per-Process Virtual Memory

GPU Commands

External Monitors

Per-Process Graphics Translation Tables

(PPGTTs)

Page 14: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

14

!Mediated Pass-Through Policies

•  Access frequency on GPU interfaces

•  Policies

Pass-through ------------------------------------------

Graphics Virtual Memory Spaces Command Buffers

Mediation ------------------------------------------

MMIO registers GTTs

PCI configuration space Legacy VGA I/O ports

Page 15: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

15

!Global Virtual Memory Space

•  The single GVM space is partitioned •  Access to VM’s own GVM region is passed

through •  Classical memory virtualization challenge

•  Host view vs. guest view •  Address space ballooning with driver

cooperation

•  GGTT accesses are mediated •  Access to its own GGTT entries is translated

•  GPFN <-> MFN •  Access to others’ entries is virtualized

Page 16: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

16

!Per-Process Virtual Memory Spaces

•  Each VM manages its own PPVM spaces

•  Active space pointed by PP_DIR_BASE

•  Accesses are passed through

•  PPGTT accesses are write-protected

•  Shadow PPGTT table •  Switch PP_DIR_BASE at render

context switch

Page 17: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

17

!Command Buffers

•  Command buffer access is passed through •  Reside in virtual memory spaces

•  Command submission request is mediated •  Through MMIO register (ring tail) •  Render scheduler makes the decision

•  Render owner request is submitted to render engine •  Non-render owner request is blocked

Graphics Driver GPU

Submission

Completion

Submission

Submission

Completion

Completion

time time

Queue Commands

Access Registers

Execute Commands

T1

T2

Batch Buffer

Ring Tail Ring Head

Ring Buffer

Chained Batch Buffers

Command

Command

Command

Page 18: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

18

!Render Engine Sharing

•  A simple round-robin scheduler •  In 16ms epoch

•  Render owner access is trap-and-forwarded to the render engine

•  Non-render owner access is trap-and-emulated

Render context switch flow

1.  Wait VM1 ring buffer becoming empty

2.  Save render MMIO registers for VM1

3.  Flush internal TLB/caches

4.  Hardware context switch

5.  Restore render MMIO registers for VM2

6.  Submit previously queued commands

Page 19: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

19

!Display Engine Sharing

Direct display model -  Display engine points to the frame buffer

of the foreground VM -  vGT driver configures display engine for

foreground/background switch

Indirect display model -  vGT driver provides interface to decode

VM frame buffer location/format -  An OpenGL app composites VM frame

buffers

Page 20: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

Performance

Page 21: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

21

!

3D Performance

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. For more complete information about performance and benchmark results, visit www.intel.com/benchmarks

Page 22: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

22

!Single VM vs. Two VMs

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products. For more complete information about performance and benchmark results, visit www.intel.com/benchmarks

Page 23: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

!

Summary

Page 24: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

24

!Summary

•  Sustain consistent and rich user experience in VM •  Running native graphics driver in VM

•  Achieve good performance •  Minimum impact on performance critical operations

•  Support moderate multiplexing capability •  Trap-and-emulate privileged operations

•  Call for action - try and feedback •  https://github.com/01org/XenGT-Preview-kernel •  https://github.com/01org/XenGT-Preview-xen •  https://github.com/01org/XenGT-Preview-qemu

Page 25: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel

25

!Notices and Disclaimers

INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL® PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. INTEL PRODUCTS ARE NOT INTENDED FOR USE IN MEDICAL, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS.

Intel may make changes to specifications and product descriptions at any time, without notice.

All products, dates, and figures specified are preliminary based on current expectations, and are subject to change without notice.

Intel, processors, chipsets, and desktop boards may contain design defects or errors known as errata, which may cause the product to deviate from published specifications. Current characterized errata are available on request.

No computer system can provide absolute security under all conditions. Intel® Trusted Execution Technology (Intel® TXT) requires a computer with Intel® Virtualization Technology, an Intel TXT-enabled processor, chipset, BIOS, Authenticated Code Modules and an Intel TXT-compatible measured launched environment (MLE). Intel TXT also requires the system to contain a TPM v1.s. For more information, visit http://www.intel.com/technology/security

Intel, Intel logo, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

*Other names and brands may be claimed as the property of others.

Copyright © 2013 Intel Corporation. All rights reserved.

Page 26: XPDS13: XenGT - A software based Intel Graphics Virtualization Solution - Haitao Shan, Intel