shithub: gpufswip

ref: ad771cd7e0f803bf1647d2f906156814b612a164
dir: /slides/notes.txt/

View raw version
INTRO

About myself:
- Game developer
- I like shaders
- Miss hardware acceleration on Plan 9


WHAT IS A GPU?

Separate computer
- more complex than just a small coprocessor

"Graphics" processing unit
- can do much more than graphics
- GPGPU

SIMD
- GPUs are best example, because graphics
- image: thousands of pixels, same process
- GPU: run program thousand times, different data, in parallel
- different architectures, generations, ... technical details (ignore)


APPLICATION ARCHITECTURE

Resource Abstraction
- bind different gpufs

9P Performance
- could be big overhead!
- to explore

Scalability on the application level
- gpufs doesn't know the use case
- application must scale
  - draw less
  - smaller detail, ...
  - gamedev
  - but: non-gamedev tasks (simulation, science)?


INSPIRED BY VULKAN

Designed by Khronos
- designed OpenGL

Lowlevel API
- compared to DirectX and OpenGL
- OGL: 100 LOC, Vulkan: 1000LOC

Abstract and cross-platform
- shader language SPIR-V
- Available on win, linux (incl. Android), mac

Shaders and buffers as objects
- transfers to filesystem hierarchy

pic:
- application manages shader and buffer at filesystem level
- compilation, loading to GPU
- execution on GPU

FILESYSTEM INTERFACE

everything work in progress
no guarantees
things can change drastically

Simple to understand
- easy to develop applications
- can be handled by hand

Generic enough to be portable
- Plan 9 is cross platform

Plug and Play
- same interface for all implementations
- bind

GPGPU first
- future: only compute shader

pic:
creating buffer and shader
loading data

pic:
filesystem overview
- one buffer, one shader
- ctl files

pic:
descriptor table
1 pool, 2 sets. first set with 4 bindings

shader -> pool
buffer -> specific binding

confusing, refer to shader

EXAMPLE SHADER PROGRAM

important:
- layout lines
- gl_GlobalInvocationID

layout buffer:
- set and binding

layout local_size_xyz:
- workgroup size (will explain)

gl_GlobalInvocationID:
- which invocation (which data to use)

WORKGROUPS

Number of workgroups:
- specified when shader is run
- 3d vector

Workgroup size:
- seen in shader program
- 3d vector

Total number of invocations -> gl_GlobalInvocationID

Compile:
- High level (edited)
- Spir-V binary
- Native
- GPU

SPIR-V binary is cross-platform:
- not machine-specific
- "description" of the program
- cross compilers

IMPLEMENTATION

Draft Implementation:
- focus on filesystem
- stalled

Drawterm:
- actual GPU
- verify and refine filesystem interface

Possible others:
- Future!
- e. g. SSE/CPU, network, hardware, ...