1.配置文档中的内容
- The GPU compute driver:
src/gpu-compute/gpu_compute_driver.[hh|cc]
- The HSA device driver:
src/dev/hsa/hsa_driver.[hh|cc]
The HSA driver code models the basic functionality for an HSA agent, which is any device that can be targeted by the HSA runtime and accepts Architected Query Language (AQL) packets. AQL packets are a standard format for all HSA agents, and are used primarily to initiate kernel launches on the GPU. The base HSADriver class holds a pointer to the HSA packet processor for the device, and defines the interface for any HSA device. An HSA agent does not have to be a GPU, it could be a generic accelerator, CPU, NIC, etc.
-
The
GPUComputeDriver
derives fromHSADriver
and is a device-specific implementation of anHSADriver
. It provides the implementation for GPU-specificioctl()
calls. -
The
src/dev/hsa/kfd_ioctl.h header
must match thekfd_ioctl.h
header that comes with ROCt. The emulated driver relies on that file to interpret the ioctl() codes the thunk uses.
2.APU模式下的代码结构
- src/
- gpu-compute/ GPU core model
- mem/protocol/ APU memory model
- mem/ruby/ APU memory model
- dev/hsa/ HSA device models
- configs/
- example/apu_se.py sample script
- ruby/APU protocol configs
3.GPU相关术语
- SQC: Sequencer Cache (shared L1 instruction cache)
- CU: Compute Unit (SM in NVIDIA terminology)
- TCP: Texture Cache per Pipe(private L1 data)
- TCC: Texture Cache per Channel(shared L2 cache)
- LDS: Local Data Share (Shared memory in NVIDIA terminology, sometimes called “scratch pad”)
- GDS: Global Data Share, can be used by wavefronts of a kernel on all CUs.
- CP:command processer
- CP responsible for initializing register file state
- Grid:grid
- Workgroup:block(WG)
- wavefront:warp(WF)
- Work-item:thread(WI)
- KFD:Kernel fusion driver(ROCk)
- ABI:application binary interface
- Interface between the application binary (ELF) and other components (e.g., OS, ISA, and HW)
- Function call convention, location of special values, etc.
- ABI state primarily maintained in register file. Some state maintained in the WF context for simplicity
- HSAPP:HSA packet processor
- AQL:Architected Queuing Language
- GPRs:General Purpose Registers
- VGPR:Vector general purpose registers
- SGPRs:scalar general purpose registers
- wfDynId: unique WF id over all WFs executed across all CUs