GPU-resource multiplexing in component-based systems Sebastian - - PowerPoint PPT Presentation
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
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
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
Motivation
GPU-resource multiplexing in component-based systems 4
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
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
GPU machine code
3
3https://twitter.com/adamjmiles/status/821914849038966784 GPU-resource multiplexing in component-based systems 7
Maybe operating systems
→ should handle GPUs in a way like they do it for CPUs
GPU-resource multiplexing in component-based systems 8
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
State of the art
GPU-resource multiplexing in component-based systems 10
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
Port Mesa with software rendering back end
GPU-resource multiplexing in component-based systems 12
Or this
GPU-resource multiplexing in component-based systems 13
Until
GPU-resource multiplexing in component-based systems 14
3D software stack on Linux
GPU-resource multiplexing in component-based systems 15
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
GPU resource multiplexing on Linux
GPU-resource multiplexing in component-based systems 17
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
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
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
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
Ring management
Physical and logical rings
GPU-resource multiplexing in component-based systems 22
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
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
GPU resource multiplexing in user space
GPU-resource multiplexing in component-based systems 25
GPU resource multiplexing in user space
GPU-resource multiplexing in component-based systems 26
And of course
GPU-resource multiplexing in component-based systems 27
Something new
GPU-resource multiplexing in component-based systems 28
Component based scenario
GPU-resource multiplexing in component-based systems 29
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
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
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
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
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
Demo
GPU-resource multiplexing in component-based systems 35