Seit迁移 bei Bedarf
Fehler verschieben Daten dorthin, wo sie verwendet werden.
Seit迁移 bei Bedarf ist eine kostenlose CUDA Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des CUDA Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der CUDA Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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! 🚀
Häufig gestellte Fragen
Ist die Lektion „Seit迁移 bei Bedarf“ kostenlos?
Ja — der vollständige Text von „Seit迁移 bei Bedarf“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des CUDA Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der CUDA Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Seit迁移 bei Bedarf“?
Fehler verschieben Daten dorthin, wo sie verwendet werden. Du übst CUDA Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um CUDA Academy zu starten?
Keine Vorkenntnisse erforderlich. CUDA Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „Seit迁移 bei Bedarf“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser CUDA Academy-Lektion Code schreiben und ausführen?
Ja. Jede CUDA Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Ein Pointer, beide Seiten
- Seit迁移 bei Bedarf
- Prefetching mit cudaMemPrefetchAsync
- Hinweise mit cudaMemAdvise