Top Banner
XenGT: A Full GPU Virtualization Solution with Mediated Pass-Through March 27, 2014 Zhiyuan Lv, [email protected] Kevin Tian, [email protected] Eddie Dong, [email protected] David Cowperthwaite, [email protected]
33

XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

Mar 24, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

XenGT: A Full GPU Virtualization Solution with Mediated Pass-Through

March 27, 2014

Zhiyuan Lv, [email protected]

Kevin Tian, [email protected]

Eddie Dong, [email protected]

David Cowperthwaite,

[email protected]

Page 2: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

2

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 3: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

3

GPU Use Cases

3D Graphics

Media

Compute

Page 4: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

4

Virtualization Use Cases

Hypervisor

VM … VM VM

Rich Virtual Client

Bring Your Own Device

Smart TV

Multi-Screen Infotainment

Virtual Data Center

Cloud

Remote Virtual Desktop

Secure e-Payment

Use Cases

Page 5: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

5

GPU Virtualization Gains Momentum

Page 6: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

6

Scenario-1: Rich Virtual Client

IT

Office

Productivity

Development

CADs

Entertainment

Games/

Video

3D/Media Acceleration

Page 7: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

7

Scenario-2: Remote Virtual Desktop

Desktop#1

Office

Productivity

Desktop#2

CADs

Desktop#N

Video Edit

3D/Media Acceleration

Network

Remote Framebuffer

Streaming

Page 8: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

8

Cloud

Media

Transcode Media

Transcode Media

Transcode Media

Transcode

Scenario-3: GPU As A Service

VM

Media

Transcode

Media

Transcode Media

Transcode Media

Transcode Media

Transcode

VM

HPC

Media Acceleration GPGPU Compute

Page 9: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

9

And many other virtualization scenarios

which run GPU-accelerated tasks in VM

Page 10: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

10

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 11: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

11

Linux Graphics Stack

Kernel

Window System

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media

3D 3D Compute

GPU

Page 12: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

12

Virtualization in API Level

Hypervisor

VM

Graphics Driver

API Backend

• API forwarding between

frontend and backend

driver

• Gain GPU acceleration

capability in VMs

• However, lagging features

and API compatibility

Window System

Kernel

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media 3D 3D Compute

API Frontend

Page 13: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

13

Virtualization in Driver Level

Hypervisor

VM

Graphics Driver

API Backend

• Enhance VGA device model

with GPU resources

• New user mode and kernel

drivers for the specific virtual

device, but still like API

forwarding

• So, lagging features and API

compatibility too

Window System

Kernel

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media 3D 3D Compute

Virtual kernel driver

Virtual user mode driver

Page 14: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

14

Virtualization in Device Level

• Assign GPU to a specific VM

• Near-native performance

• Full features

• However, no sharing

capability

Hypervisor

VM

Kernel

Window System

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media 3D 3D Compute

Page 15: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

15

So… none of above techniques can meet all requirements of GPU Virtualization:

Performance

Feature

Sharing

Page 16: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

16

Here Comes Full GPU Virtualization!

Hypervisor

VM1 VM2

Mediator

Kernel

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media 3D 3D Compute

Kernel

Window System

API Layer (OpenGL/VAAPI/OpenCL)

DRM Driver

User Mode Driver

3D 3D 3D 3D 3D Media 3D 3D Compute

Run

native graphics driver

inside VMs!

Performance!

Feature! Sharing!

Window System

Page 17: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

17

XenGT Target: Intel® Processor Graphics

128MB fast cache for bandwidth

saving with GT3e - Intel® Iris™

Pro

22nm

GT3

Build-in into 4th generation Intel®

Core™ processors

EDRAM

2x computational shader

power with new GT3 - Intel®

Iris™

High Speed Video Decode &

Encode H.264/MPEG-4 AVC,

VC-1 QSV

Page 18: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

18

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 19: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

19

XenGT: A Full GPU Virtualization Solution

• Built on a mediated pass-through framework

• Privileged I/O operations are trap-and-emulated

• Performance critical operations are passed through

• Virtual GPU (vGPU) device model

• Equivalent features as physical Intel Processor Graphics

• Running native graphics driver inside VMs

• Leverage existing driver optimizations and stability fixes

• First implementation on Xen hypervisor

• Core device model reusable in other hypervisors

Page 20: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

20

XenGT Architecture

Xen

Dom0 VM

QEMU VGA

Mediator

Scheduler

vGPU vGPU Graphics

Driver Graphics

Driver

Pass-through

Trap

Page 21: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

21

Intel® Processor Graphics Architecture

Render Engine

Regis

ters

GPU

Display Engine

Page Table

System Memory

Graphics Virtual Memory

One global virtual memory address space

Multiple local memory

address spaces

Page 22: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

22

XenGT Graphics Memory Partition

Render Engine

Regis

ters

GPU

Display Engine

Page Table

System Memory

Graphics Virtual Memory

Host View VM1 VM2 VM3

Ballooned graphics memory

Available graphics memory to VMs

Page 23: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

23

GPU Page Table Virtualization

• Shadow GPU page tables (GPN<->HPN)

Shared shadow global page table Per-VM shadow local page table

Page 24: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

24

Render Engine Virtualization 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

• 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

Page 25: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

25

Display Virtualization – Direct Mode

• Direct mode – directly program VM frame buffer to display engine

• Display Switch

• Simple as frame buffer flip

• Panel fitting for VMs with different resolutions

Dom0

VM1

VM2

plane pipe port

Physical Display Engine

plane pipe port

Virtual display

plane pipe port

Virtual display

plane pipe port

Virtual display

switch

XenGT

Page 26: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

26

Display Virtualization – Indirect Mode

Compositor

VM1

VM2

XenGT

plane pipe port

display engine Gem buf

Gem buf

texture

texture window

DOM 0

• Indirect mode – VM frame buffer

is mapped and composited

through Dom0

• XenGT provides interface for

dom0 to map VM frame buffer

• DRM is extended to bind frame

buffer to GEM buffer object

Render Engine

Page 27: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

27

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 28: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

28

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 29: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

29

Current Status

• Initial release in 09/2013, including all major features

• Multiple VMs (Dom0 + 3 VMs) running simultaneously

• Display switch among VMs

• Second release in 03/2014

• More stability improvement

• Support guest resolution changes

• Enhanced support for multiple display and hotplug

• Preliminary support for GPU recovery

• More developing/tuning work ongoing

Page 30: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

30

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 31: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

31

Agenda

• Why GPU Virtualization

• How GPU Virtualization Works

• How XenGT Works

• Demo

• Current Status

• Summary

Page 32: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

32

Summary

• GPU virtualization gains momentum

• Full GPU virtualization provides a good balance among performance,

feature and sharing capability

• XenGT is a full GPU virtualization solution, on Intel® Processor

Graphics, running native graphics driver inside VMs

• 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 33: XenGT: A Full GPU Virtualization Solution with ... - Semantic Scholar

33

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 © 2014 Intel Corporation. All rights reserved.