Skip to content

Commit e6810bd

Browse files
committed
hsa docs
1 parent 369fd46 commit e6810bd

File tree

7 files changed

+31
-2
lines changed

7 files changed

+31
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ aka Navi31 aka gfx1100 aka Plum Bonito aka amd744c
1919
- DCN = Display Core Next (dcn320) (amdgpu/dcn_3_2_0_dmcub.bin)
2020
- VCN = Video Core Next (encoder/decoder) (vcn400) (vcn_4_0_0.bin)
2121
- [SDMA](/docs/SDMA.md) = System DMA (lsdma600) (sdma_6_0_0.bin) (F32)
22+
- [HSA](/docs/HSA.md) = Heterogeneous System Architecture
2223

2324
More info on each piece:
2425
https://mjmwired.net/kernel/Documentation/gpu/amdgpu/driver-core.rst
@@ -32,7 +33,7 @@ RS64 = RISCV/RV64I + a few custom instructions! Load (at least MEC) with offset
3233

3334
## Architechture Diagram
3435

35-
![](/docs/arch1.jpg)
36+
![](/docs/img/arch1.jpg)
3637

3738
- 1x 5nm GCD (graphics compute die)
3839
- 6x 6nm MCD (memory cache die)

docs/CU.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
It's where compute happens
44

5-
![](/docs/big_compute-unit-pair.jpg)
5+
![](/docs/img/big_compute-unit-pair.jpg)
66

77
7900XTX has 96 compute units (48 work-group processors)
88

docs/HSA.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# HSA stands for Heterogeneous System Architecture
2+
3+
[HSA](https://en.wikipedia.org/wiki/Heterogeneous_System_Architecture) is a cross-vendor set of specifications that allow for the integration of central processing units and graphics processors on the same bus, with shared memory and tasks.
4+
5+
Idea of HSA is to reduce communication latency between CPUs, GPUs and to make it easier to offload calculations to the GPU
6+
![](/docs/img/gpu_with_hsa.png)
7+
8+
HSA defines a unified virtual address space for compute.
9+
10+
Usually GPU and CPU have their own memory, HSA requires them to share page tables, to exchange data by sharing pointers. Needs to be supported by HSA specific [memory management units](https://web.archive.org/web/20140328140823/http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/hsa10.pdf)
11+
12+
HSA should support both GPUs and CPUs and high-level languages.
13+
14+
The CPU's [MMU](https://en.wikipedia.org/wiki/Memory_management_unit) and the GPU's [IOMMU](https://en.wikipedia.org/wiki/IOMMU) must both comply with HSA hardware specifications.
15+
![](/docs/img/mmu_iommu.png)
16+
17+
Some of the HSA-specific features implemented in the hardware need to be supported by the operating system kernel and specific device drivers.
18+
19+
`amdkfd` supports heterogeneous queuing (HQ), which aims to simplify the distribution of computational jobs among multiple CPUs and GPUs from the programmer's perspective. Support for heterogeneous memory management (HMM), suited only for graphics hardware featuring version 2 of the AMD's IOMMU,
20+
21+
22+
## Graphics Core Next (GCN)
23+
24+
HSA kernel driver resides in the directory `/drivers/gpu/hsa`, while the DRM graphics device drivers reside in `/drivers/gpu/drm`
25+
26+
Hardware schedulers are used to perform scheduling and offload the assignment of compute queues to the ACEs from the driver to hardware, by buffering these queues until there is at least one empty queue in at least one ACE. This causes the HWS to immediately assign buffered queues to the ACEs until all queues are full or there are no more queues to safely assign
27+
28+
Part of the scheduling work performed includes prioritized queues which allow critical tasks to run at a higher priority than other tasks without requiring the lower priority tasks to be preempted to run the high priority task, therefore allowing the tasks to run concurrently with the high priority tasks scheduled to hog the GPU as much as possible while letting other tasks use the resources that the high priority tasks are not using. These are essentially Asynchronous Compute Engines that lack dispatch controllers. They were first introduced in the fourth generation [GCN](https://en.wikipedia.org/wiki/Graphics_Core_Next) microarchitectur
File renamed without changes.
File renamed without changes.

docs/img/gpu_with_hsa.png

27.9 KB
Loading

docs/img/mmu_iommu.png

46.6 KB
Loading

0 commit comments

Comments
 (0)