﻿# RDMA notification is not GPU consumer visibility

Separate network write completion from GPU memory ordering before a CUDA kernel consumes data delivered through GPUDirect RDMA.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/gpudirect-write-completion-kernel-visibility/
Language: en

## The notification arrives before safe consumption

A receiver observes that a network operation has progressed and lets a persistent GPU kernel consume the written region. The kernel occasionally sees inconsistent content. The relevant question is not only whether the NIC completed its write, but what orders that independent data path with the GPU consumer. A control notification, a local work completion and visibility to a running kernel are distinct observations.

## Separate the transport operation

The [RDMA programming guide](https://networking-docs.nvidia.com/doca/archive/3-5-0/rdma-aware-networks-programming-guide) distinguishes ordinary RDMA Write, which does not notify the remote host in the same way, from Write with Immediate, which supplies a remote notification. That difference can help an application coordinate progress, but does not itself specify CUDA memory ordering. Identify the exact operation, the CPU or GPU receiving the signal and the data region associated with it. A notification for another buffer generation cannot establish this generation's readiness.

## A concurrent kernel has its own boundary

The [GPUDirect RDMA documentation](https://docs.nvidia.com/cuda/archive/13.0.1/gpudirect-rdma/index.html) warns that a concurrently running kernel can observe stale, partially written or out-of-order data from the independent network-write path. Its documented integration requires completing DMA with respect to the CPU thread that will launch dependent CUDA work, together with applicable registration and synchronization behavior. Merely reading back fresh content through another mechanism does not prove that a concurrent GPU consumer was race-free.

## Apply the actual visibility contract

The [CUDA device API](https://docs.nvidia.com/cuda/archive/13.0.1/cuda-driver-api/group__CUDA__DEVICE.html) documents cuFlushGPUDirectRDMAWrites, its target and visibility scope, and how native ordering capabilities can make a flush unnecessary. Support must be queried; the function is not a universal repair for every device or transport. The same reference warns about multiple hardware paths forming separate ordering domains, whose combined ordering can require mechanisms outside CUDA. Preserve allocation method, device capabilities and the actual dependency chain instead of inserting an unqualified flush call into every path.

## Build a content-based qualification

In an isolated supported integration, use generation-tagged payloads and verify complete expected content in the dependent GPU work. Exercise the real handoff sequence, delayed notification and buffer reuse boundaries. Compare a documented ordered producer-consumer path with a deliberately invalid concurrent-consumption fixture only where safe and controlled. Record transport completion, CPU handoff, CUDA ordering action and consumer outcome separately. Acceptance must reject a mixed-generation or partially updated payload even when all API calls appear successful.

## Bound the accepted claim

The result qualifies one documented memory and synchronization arrangement; it does not prove remote application commit, universal device coherence or safe arbitrary persistent-kernel polling. The [completion evidence guide](/journal/guide-net-rdma-completion/) helps interpret transport outcomes, while [memory registration lifetime](/journal/guide-net-rdma-memory-registration/) covers mapping validity. Both are necessary context but neither replaces GPU visibility. Any latency cost belongs in a separate measurement using the same correctness checks, because removing a synchronization boundary can make an invalid consumer appear faster.
