diff options
Diffstat (limited to 'nvidia_preemption.md')
| -rw-r--r-- | nvidia_preemption.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nvidia_preemption.md b/nvidia_preemption.md new file mode 100644 index 0000000..051d4a5 --- /dev/null +++ b/nvidia_preemption.md | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # NVIDIA GPU Preemption | ||
| 2 | |||
| 3 | MVP: Preempt current work on the GPU on the Jetson Xavier | ||
| 4 | |||
| 5 | Summary of approach: Create new runlist that excludes the current work and point the GPU to it | ||
| 6 | |||
| 7 | 1. Obtain current runlist | ||
| 8 | 2. Copy runlist to new location, skipping TSG of target to preempt | ||
| 9 | 3. Write new runlist address to NV_PFIFO_RUNLIST, which will preempt current work | ||
| 10 | |||
| 11 | It's unclear if this approach is lower-overhead than that of Capodieci et al. | ||
| 12 | See approach Alternate 1 which is our new priority. | ||
| 13 | |||
| 14 | Notes: | ||
| 15 | - Each TSG (timeslice group) corresponds to one context (?) | ||
| 16 | - Runlist base must be 4k aligned | ||
| 17 | - nvgpu driver gets gk20a struct via container_of an inode which is a struct nvgpu_os_linux | ||
| 18 | - gk20a_writel is nvgpu_writel. Define is: `void nvgpu_writel(struct gk20a *g, u32 reg_addr, u32 value);` | ||
| 19 | - gk20a_readl is nvgpu_readl. Define is: `u32 nvgpu_readl(struct gk20a *g, u32 reg_addr);` | ||
| 20 | |||
| 21 | ## Other approaches: | ||
| 22 | |||
| 23 | ### Alternate 1: | ||
| 24 | "2. Disable all channels in the containing TSG by writing ENABLE_CLR to TRUE | ||
| 25 | in their channel RAM entries in NV_PCCSR_CHANNEL (see dev_fifo.ref). | ||
| 26 | 3. Initiate a preempt of the TSG via NV_PFIFO_PREEMPT or | ||
| 27 | NV_PFIFO_RUNLIST_PREEMPT." (PBDMA, "Recovery procedure") | ||
| 28 | |||
| 29 | ### Alternate 2: | ||
| 30 | "3. Initiate a preempt of the engine by writing the bit associated with its | ||
| 31 | runlist to NV_PFIFO_RUNLIST_PREEMPT. This allows us to begin the preempt | ||
| 32 | process prior to doing the slow register reads needed to determine whether | ||
| 33 | the context has hit any interrupts or is hung. Do not poll | ||
| 34 | NV_PFIFO_RUNLIST_PREEMPT for the preempt to complete." (FIFO, "Context TSG tear-down procedure") | ||
| 35 | |||
| 36 | See `nvdebug.c` and `nvdebug.h` for implementation details. | ||
