﻿# Identify staging behind a pageable host-memory transfer

Separate pageable staging, host API duration and device copy completion before diagnosing overlap or replacing the source allocation.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-perf-pageable-transfer/
Language: en

A host-to-device copy named Async occupies the host thread long enough to delay the next request's launch. The source buffer is ordinary pageable memory. Investigate the documented staging and synchronization path before treating the interval as GPU transfer duration or evidence that a copy engine cannot overlap computation.

## Record direction and allocation

Preserve the exact copy API, transfer direction, source allocation method, byte count and stream. A high-level tensor conversion can combine allocation, packing and copying. Identify which call consumes the host interval. Host-to-device and device-to-host operations have different synchronization contracts, so a result from the reverse direction is not an interchangeable control.

## Read Async conditionally

The runtime synchronization guide explicitly rejects a universal rule that every Async function is nonblocking. Pageable transfers may require staging through pinned memory and may synchronize with a stream. The observed host behavior must be interpreted with that memory and direction contract. It does not establish that the entire device transfer finished when the host call returned.

## Separate timeline intervals

In a representative trace, distinguish host API duration, the device copy interval and the next kernel's submission and execution. Staging can delay host progress while the eventual device transfer remains short. Conversely, a short API interval can precede a long transfer. A single wall-clock measurement around submission cannot distinguish these cases or quantify actual overlap.

## Construct a bounded comparison

Compare the same useful bytes and direction using an ordinary source and an already prepared page-locked source where supported. Keep source values, device destination and dependencies unchanged. Measure preparation separately as well as in the application cycle when it recurs. Replacing every pageable allocation with a new pinned allocation per request can exchange one host cost for another.

## Preserve reuse and host headroom

Retain each source until its actual consumers complete and bound any prepared-buffer pool by concurrent ownership. Report whether the change reduces host submission delay and completed request latency, not merely the isolated copy interval. Acceptance supports a staging explanation for the tested path. It does not define a universal pinning budget, guarantee overlap for every copy or remove other host-side packing work.

## Primary references

[CUDA API Synchronization Behavior](https://docs.nvidia.com/cuda/cuda-runtime-api/api-sync-behavior.html).

[CUDA Runtime Memory Management](https://docs.nvidia.com/cuda/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html).

[Nsight Systems Timeline Collection](https://docs.nvidia.com/nsight-systems/UserGuide/index.html).

Related reading: [Pinned GPU host memory: setting a page-locked buffer budget](/journal/gpu-pinned-host-memory-budget/); [CUDA events and request time: different measurement boundaries](/journal/gpu-cuda-events-wall-time/).
