← Glossary
CUDA glossaryMemory
CC depends on managed-memory attributes; lesson requires 7.5

What is page migration in CUDA unified memory?

The unified-memory driver moving a virtual-memory page to the processor that touches it, either after a fault or ahead of use through prefetch.

Unified memory gives CPU and GPU one pointer, but a discrete card and host do not share physical DRAM. When the other processor touches a managed page, the driver may fault, copy the page across PCIe, update mappings and restart access. Convenience moves the copy decision into the runtime; it does not remove the bytes.

cudaMemPrefetchAsync requests migration before a kernel needs the pages, turning hidden fault service into an explicit timed move. cudaMemAdviseSetReadMostly tells the driver that read-only pages may be duplicated rather than repeatedly stolen between processors. Preferred-location and accessed-by hints describe expected ownership. Hints are not commands, and their effect depends on the device's managed-memory attributes.

The common mistake is timing only the kernel. A faulting kernel includes migration stalls, while prefetch moves them into another column and host touches can move pages again later. Total, kernel, move and remaining host time must be read together.

Measured

On a Tesla T4 (driver 580.173.02, CUDA 12.6), day 93 ran the same four-round workload five ways. Naive managed memory took 350.363 ms total with 141.171 ms inside kernels. Advice plus prefetch took 165.086 ms, split into 6.143 ms kernel, 25.601 ms prefetch and 133.342 ms host time. Explicit allocation and copies took 153.315 ms. The first naive kernel round cost 75.764 ms; later rounds were about 22 ms. No Nsight Systems report was captured, so this entry claims no page-fault count.

Diagram: managed pages alternate between host and GPU for the naive path, then move once before launch for prefetch. The takeaway is that prefetch schedules migration; it does not make it free.

Related terms

Where you meet this

Sources

Byline

Written by: pending. Reviewed by: pending. Written on: pending. Last checked on: pending. Verified numbers were captured on 2026-09-02; publication still requires named author and reviewer sign-off.