Curriculum / Part 5 · The GPU data path: RDMA and GPUDirect
Lesson 21

Bounce buffers

The classic path from storage to GPU memory through a CPU bounce buffer, and what the extra copy costs.

⏱ 30 min5-question quiz

The simple version

A parcel goes to the post office, then to your neighbour's house, then finally to you. It arrives, but it took an extra trip and someone had to carry it twice. A bounce buffer is the neighbour's house.

The classic path

  1. The storage driver DMAs data into host (CPU) memory, often via the page cache.
  2. The application copies it to a pinned (page-locked) buffer if needed.
  3. cudaMemcpy (or an async copy) moves it across PCIe into GPU memory.

Data crosses host memory at least once and the PCIe fabric twice (device → CPU, then CPU → GPU), and CPU cores spend time managing copies.

What it costs

  • Bandwidth: host memory and the CPU's PCIe root ports carry every byte twice.
  • CPU: cores orchestrate copies instead of decoding or augmenting data.
  • Latency: an extra hop per transfer.
PCIe Gen5 x16 ≈ 16 × ~4 GB/s ≈ 64 GB/s per direction (link ceiling, before overhead)

Eight GPUs each loading at 10 GB/s through bounce buffers means 80 GB/s into host memory and 80 GB/s back out, on top of everything else the CPUs are doing.

Measuring the difference

gdsio from NVIDIA's GPUDirect Storage tools can run the same transfer different ways: -x 0 GPU direct, -x 1 storage to CPU only, -x 2 storage → CPU → GPU (the bounce path). Comparing -x 0 with -x 2 on your hardware shows what the bounce buffer costs there.

Tools

gdsio -x 2 ...
Storage → CPU → GPU (bounce buffer) transfer benchmark.
gdsio -x 0 ...
GPUDirect transfer for comparison.
nvidia-smi dmon -s t
Per-GPU PCIe receive/transmit throughput.

Quiz

Lab

Related lab

Lab 5.1 · GDS in compatibility mode

An engineer benchmarked GPUDirect Storage with gdsio -x 0 (GPUD) on /scratch from GPU 0. The output says XferType: GPUD, but the throughput matches the CPU bounce-buffer path.

Start lab 5.1 →