GPU-resource multiplexing in component-based systems Sebastian - - PowerPoint PPT Presentation

gpu resource multiplexing in component based systems
SMART_READER_LITE
LIVE PREVIEW

GPU-resource multiplexing in component-based systems Sebastian - - PowerPoint PPT Presentation

GPU-resource multiplexing in component-based systems Sebastian Sumpf < sebastian.sumpf@genode-labs.com > Josef Sntgen < josef.soentgen@genode-labs.com > Outline 1. Motivation 2. State of the art 3. GPU resource multiplexing in


slide-1
SLIDE 1

GPU-resource multiplexing in component-based systems

Sebastian Sumpf <sebastian.sumpf@genode-labs.com> Josef Söntgen <josef.soentgen@genode-labs.com>

slide-2
SLIDE 2

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 2

slide-3
SLIDE 3

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 3

slide-4
SLIDE 4

Motivation

GPU-resource multiplexing in component-based systems 4

slide-5
SLIDE 5

Motivation

Architecture layout of an Intel Core i7 6700K processor 1

1https://software.intel.com/sites/default/files/managed/c5/9a/The-Compute-Architecture-of-Intel-Processor- Graphics-Gen9-v1d0.pdf GPU-resource multiplexing in component-based systems 5

slide-6
SLIDE 6

Motivation

GPUs have become freely programmable, think shader language, CUDA/OpenCL 2

2https://www.shadertoy.com/view/ldlcRf GPU-resource multiplexing in component-based systems 6

slide-7
SLIDE 7

GPU machine code

3

3https://twitter.com/adamjmiles/status/821914849038966784 GPU-resource multiplexing in component-based systems 7

slide-8
SLIDE 8

Maybe operating systems

→ should handle GPUs in a way like they do it for CPUs

GPU-resource multiplexing in component-based systems 8

slide-9
SLIDE 9

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 9

slide-10
SLIDE 10

State of the art

GPU-resource multiplexing in component-based systems 10

slide-11
SLIDE 11

Complexity analysis (Intel only)

Mesa library Mesa KLOC EGL 7.5 OpenGL 170 GLSL 90 i965 DRI driver 81 i915 driver ~100 KLOC

GPU-resource multiplexing in component-based systems 11

slide-12
SLIDE 12

Port Mesa with software rendering back end

GPU-resource multiplexing in component-based systems 12

slide-13
SLIDE 13

Or this

GPU-resource multiplexing in component-based systems 13

slide-14
SLIDE 14

Until

GPU-resource multiplexing in component-based systems 14

slide-15
SLIDE 15

3D software stack on Linux

GPU-resource multiplexing in component-based systems 15

slide-16
SLIDE 16

3D software stack on Linux

  • 1. Observation while investigating the i915 GPU driver from

Linux

◮ A lot of code to support previous IGD generations ◮ Support for many outdated features

  • 2. Idea

→ Support current hardware generations (i. e., Broadwell and newer) only → Take advantage of modern features → Try to write a minimal GPU multiplexer from scratch

GPU-resource multiplexing in component-based systems 16

slide-17
SLIDE 17

GPU resource multiplexing on Linux

GPU-resource multiplexing in component-based systems 17

slide-18
SLIDE 18

Engines

  • 1. Render engine (3D/GPGPU)
  • 2. VCS engine (Video Command Streamer - video decode

support)

  • 3. VECS engine (Video Enhancement Command Streamer)
  • 4. Blitter engine

→ Concentrate on render engine

GPU-resource multiplexing in component-based systems 18

slide-19
SLIDE 19

Resource management by the GPU driver

4

4 https://image.slidesharecdn.com/19gscale1-160901124550/95/xpds16-live-scalability-for-vgpu-using-gscale- xiao-zheng-intel-5-638.jpg?cb=1472733989 GPU-resource multiplexing in component-based systems 19

slide-20
SLIDE 20

GGTT and PPGTT

Global Graphics Translation Table (GGTT)

◮ Only one per GPU ◮ One level (8MB) ◮ 8 Byte page table entries (PTEs) point to 4KB physical pages ◮ The leading PTEs directly map into the aperture

Per-process GTT (PPGTT)

◮ Hierarchical page table in various formats ◮ Gen8+ supports four level page table format ◮ 48 bit virtual-address space GPU-resource multiplexing in component-based systems 20

slide-21
SLIDE 21

Aperture and fence registers

Aperture

◮ Only way for way CPU to access graphics memory directly ◮ Mapped through the GTT ◮ Up to 512MB on Broadwell/Skylake

Fence registers

◮ Allow to set tiling mode (X or Y) for memory area mapped

through the aperture (automatic tiling/detiling on write/read access by the CPU)

◮ 32 registers on Broadwell/Skylake GPU-resource multiplexing in component-based systems 21

slide-22
SLIDE 22

Ring management

Physical and logical rings

GPU-resource multiplexing in component-based systems 22

slide-23
SLIDE 23

Command execution

  • 1. Classical ring execution by setting the head
  • 2. Execlists

◮ Hardware status page ◮ Register state context ◮ PPGTT context ◮ Logical-ring context ◮ HW/engine context GPU-resource multiplexing in component-based systems 23

slide-24
SLIDE 24

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 24

slide-25
SLIDE 25

GPU resource multiplexing in user space

GPU-resource multiplexing in component-based systems 25

slide-26
SLIDE 26

GPU resource multiplexing in user space

GPU-resource multiplexing in component-based systems 26

slide-27
SLIDE 27

And of course

GPU-resource multiplexing in component-based systems 27

slide-28
SLIDE 28

Something new

GPU-resource multiplexing in component-based systems 28

slide-29
SLIDE 29

Component based scenario

GPU-resource multiplexing in component-based systems 29

slide-30
SLIDE 30

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 30

slide-31
SLIDE 31

Results

Trusted computing base Component KLOC Microkernel 10 Genode base system < 30 Nitpicker GUI server 5 GPU multiplexer 10

GPU-resource multiplexing in component-based systems 31

slide-32
SLIDE 32

State

Current state Support for Mesa-based GPU clients Future Take advantage of the blitter engine Skylake, Kaby Lake, ... Future (tempting) work Virtual GPU in VirtualBox as GPU client

GPU-resource multiplexing in component-based systems 32

slide-33
SLIDE 33

Outline

  • 1. Motivation
  • 2. State of the art
  • 3. GPU resource multiplexing in user space
  • 4. Results
  • 5. References

GPU-resource multiplexing in component-based systems 33

slide-34
SLIDE 34

References

Intel’s open source community: https://01.org Ben Widawsky: https://bwidawsk.net/blog/index.php/ 2015/09/gen-graphics-and-the-urb Daniel Vetter: http://blog.ffwll.ch/2012/10/i915gem-crashcourse.html

GPU-resource multiplexing in component-based systems 34

slide-35
SLIDE 35

Demo

GPU-resource multiplexing in component-based systems 35