GPU
When the GPU stops asking the CPU
A GPU thread rings its own doorbell
In every GPU workload you have seen so far the CPU does the asking. It writes the commands, adds the ring entry, moves the write index and rings the doorbell. The GPU answers and never starts anything by itself. That puts the host CPU in a convenient place: it sees every transfer being requested, so the host is where you would enforce a rule about what data moves where. Now take the CPU out of that position. Let it prepare a copy but leave the doorbell alone, and have a thread on the GPU ring it. This is an experiment today. It shows where the data path is going, and it raises a hard question about where policy will have to live.
- Today
- the CPU rings every doorbell
- The experiment
- a GPU thread rings it instead
- The whole GPU program
- one line: *dst = token
- The question
- who still sees the data move?
Read the whole lesson as text
1. Prepared, and not sent
The CPU starts as it always does. On one channel, call it A, it writes a copy-engine command into the pushbuffer, adds an entry to the ring and moves the write index forward. Then it stops. It does not ring the doorbell. From the GPU's point of view nothing has happened: its front end is not watching host memory, and nobody has told it to look. A complete request for a 4 MiB copy sits in host memory, waiting for a signal that the CPU is not going to send.
- The CPU prepares a copy on channel A and stops just short of ringing the doorbell.
2. A program for the GPU, by hand
On a second channel, B, the CPU launches a tiny program on the GPU's compute cores. Writing the program is trivial. Launching it without CUDA is the hard part, because three things have to be built by hand. A launch descriptor, 384 bytes long on this GPU generation, that describes the grid of threads, the program's address and its constants. Only 13 of its 96 words end up non-zero. A constant buffer that holds the program's two arguments at fixed offsets: the doorbell's address and channel A's token. And the program itself, 256 bytes of the GPU's native machine code.
- The CPU builds by hand what a compute launch needs: a descriptor, the arguments and the program.
- The CPU rings the doorbell once, for channel B, to start the little program.
- The front end hands the descriptor to the GPU's scheduler, which starts one thread on a compute core.
3. A doorbell the GPU can reach
One piece of setup is still missing. A GPU thread can only store to addresses in the GPU's own virtual address space, and the doorbell is a register that was mapped for the host. So the region holding the doorbell is allocated with a flag that makes it mappable from the GPU side, and is then mapped into the GPU's address space as well. The program is given that address plus 0x90. A second trap waited here: the default window for shared memory overlapped the scratch memory the experiment used, and the program faulted inside the compute core, an Xid 13, until the window was moved.
- During setup the doorbell's page is also mapped into the GPU's own address space.
4. One thread, one store
The program is one line: store the token at the doorbell's address. The compiler turns it into a single instruction, a system-scope global store. The thread runs, the token lands in the doorbell register, and the GPU's front end wakes up for channel A exactly as if the CPU had rung. The store travelled over the GPU's internal path. No transaction was seen leaving the card over PCIe. A first test changed a memory cell from 0xcafebabe to 0xdeadbeef, proof that the thread had run and stored.
- A thread on the GPU stores channel A's token to the doorbell, from inside the GPU.
- The front end sees a token for channel A and goes to fetch the work the CPU left there.
5. The copy runs
The rest is the ordinary path. The front end reads channel A's ring entry and the command it points at, and the copy engine moves a 4 MiB pattern from GPU memory to host memory. The data arrives intact and no error is logged. The next step is the obvious one: have the GPU write the whole submission itself, command, ring entry, write index and doorbell. At that point the CPU is not in the data path at all. It set things up once, and after that the GPU decides what moves and when.
- The front end reads the ring entry the CPU prepared earlier.
- The copy engine gets its commands and starts.
- The data arrives in host memory, moved by a copy that no CPU instruction started.
6. Not just a lab trick
Nobody will ship hand-written GPU machine code, and this exact program runs on one GPU generation only. The direction is real and some of it is already in products. GPUDirect RDMA lets a network card read and write GPU memory directly, without staging data in host RAM. GPUDirect Storage does the same for NVMe. Libraries for GPU-initiated networking let GPU programs send and receive over the fabric themselves, because waiting for the CPU to ring a doorbell between compute steps is too slow for tightly coupled work. Follow that line and the host CPU stops being where data movement is decided. It sets things up and then watches.
- Between workers, data can already go from one GPU's memory to the network and into another's without touching either host's memory.
7. Where policy has to live
Tenant isolation, egress control and the record of who talked to what all need an enforcement point the data really passes through. That splits into two decisions. The first: is there a network boundary in the AI platform at all, one layer that owns tenancy, ingress, egress, policy and inference-aware routing? That is a choice for day zero, it doesn't depend on hardware, and it gets made whether or not anyone makes it on purpose. The second: where does that boundary run? On the host CPU, or on a DPU beside the GPUs, in the same data path as their traffic. BNK is built for both. Host mode needs no DPU and can be added to a running cluster. DPU mode sees traffic that never touches the host, and a DPU has to be in the bill of materials from the start.
- Whatever moves off the host CPU, the tenant boundary has to sit somewhere the data still goes.
Summary
A thread on a GPU stored four bytes to a doorbell and started a data transfer the CPU had only prepared. Building it took a launch descriptor, a constant buffer and 256 bytes of machine code by hand, a second mapping of the doorbell, and two Xids along the way. As an experiment it is narrow. As a direction it is where GPUDirect and GPU-initiated networking are already going: the host sets things up and the devices talk to each other. That breaks an assumption many security designs rest on, that the host sees the traffic. So decide early that the AI platform has a network boundary, and decide where it runs. The more the data path leaves the host CPU, the more that boundary belongs where the data still goes.
Next lesson: The network is part of the computer