KatInterview

GPU Rendering, Pipeline Hazards and Workload Fit

System DesignModel answer
EasyModel answerSystem Designgpu-architecturegraphics-pipelinepipeline-hazards

Last updated

Walk through how a GPU turns triangles into pixels, how pipelines resolve register read-after-write hazards, and which workloads GPUs handle well or badly.

You are asked three connected questions about processor and graphics hardware. Answer each one in a structured way, using concrete hardware terms.

  1. Rendering a triangle. Describe the path a triangle takes on a modern GPU, from the input vertices to the final pixels in the framebuffer. Name the stages in order and say which are programmable and which are fixed-function.
  2. Register dependencies. In a pipelined processor or a GPU execution pipeline, an instruction can need a register value that an earlier instruction has not finished producing (a read-after-write, or RAW, dependency). Explain how such dependencies are detected and handled, and how the GPU approach differs from the classic CPU approach.
  3. Workload fit. Which kinds of operations are GPUs especially good at, which are they poor at, and why?

Concentrate on throughput, memory behavior and how execution is scheduled. You do not need to write production code, but a small illustration of your reasoning is welcome.

Hints

Hint 1

For part 1, list the stages in order (fetch, vertex shading, assembly and clipping, rasterization, depth test, fragment shading, blending) and label each as programmable or fixed-function. Then mention how tile-based and immediate-mode designs differ in memory traffic.

Hint 2

For part 2, start with the CPU toolbox (forwarding, stalls, scoreboarding, out-of-order execution, compiler scheduling). Then ask what a GPU does when a memory load takes hundreds of cycles and there is no big out-of-order engine.

Hint 3

For part 3, think in terms of arithmetic intensity, uniform control flow and regular memory access. Then flip each property to find what GPUs are bad at (divergence, pointer chasing, serial code).