Migración de páginas bajo demanda
Los fallos mueven los datos al lugar donde se usan.
Migración de páginas bajo demanda es una lección gratuita de CUDA Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de CUDA Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de CUDA Academy incluye 4 lecciones en total.
Partes de esta lección aún no han sido traducidas y se muestran en inglés.
Where Does the Data Live?
With managed memory the data has no fixed home. It quietly moves between CPU and GPU through on-demand page migration, following wherever you use it.
Memory Comes in Pages
The system tracks memory in fixed chunks called pages, often 4 KB or 64 KB. Migration happens one page at a time, not byte by byte.
A Page Fault Triggers It
When the GPU touches a page that lives on the CPU, it raises a page fault. The driver pauses, copies that page over, then lets the thread continue.
Data Follows the Access
The rule is simple: data migrates to whoever uses it. Write on the CPU and pages live there; read in a kernel and they move to the GPU.
First Touch Is the Slow One
The cost shows up on the first access from a new side. After the page arrives, later reads on that same device are fast and local.
Ping-Pong Hurts
If the CPU and GPU keep touching the same pages in turns, they bounce back and forth. This ping-pong migration can quietly wreck your throughput.
Faults Add Up
Each fault carries setup overhead, so thousands of tiny faults are costly. Migrating in bulk beats faulting one scattered page after another.
Locality Still Matters
Even with automatic migration, good access patterns win. Threads reading nearby addresses pull in whole pages efficiently instead of scattering faults.
Oversubscription Is Allowed
Migration lets you allocate more than the GPU holds. Pages flow in as needed and old ones evict, so huge datasets still run, just slower.
You Can See the Faults
Profilers like Nsight Systems show migration traffic and fault counts. Spotting heavy migration tells you exactly where to add hints next.
Convenience With a Catch
On-demand migration is wonderfully automatic, but the faults are not free. Knowing the cost is what lets you fix it with prefetch and advice.
Quick Check
Let us make sure you know what kicks off a migration.
Recap: On-Demand Migration
You saw that managed pages migrate on a fault to whoever uses them. First touch is slow, ping-pong hurts, and bulk movement wins. Onward! 🚀
Preguntas frecuentes
¿La lección «Migración de páginas bajo demanda» es gratis?
Sí — el texto completo de «Migración de páginas bajo demanda» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de CUDA Academy, actualiza a CoddyKit PRO. El curso de CUDA Academy incluye 4 lecciones en total.
¿Qué aprenderé en «Migración de páginas bajo demanda»?
Los fallos mueven los datos al lugar donde se usan. Practicas CUDA Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.
¿Necesito experiencia previa para empezar CUDA Academy?
No se requiere experiencia previa. CUDA Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.
¿Cuánto tiempo toma la lección «Migración de páginas bajo demanda»?
La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.
¿Puedo escribir y ejecutar código en esta lección de CUDA Academy?
Sí. Cada lección de CUDA Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.
Todas las lecciones de este curso
- Un puntero para ambos lados
- Migración de páginas bajo demanda
- Prefetching con cudaMemPrefetchAsync
- Sugerencias mediante cudaMemAdvise