Home Knowledge Base Peer-to-Peer (P2P) GPU Communication

Peer-to-Peer (P2P) GPU Communication is the hardware and software capability that allows one GPU to directly access another GPU's memory without routing data through CPU main memory — eliminating the host memory copy bottleneck in multi-GPU systems, reducing transfer latency by 2-5×, and enabling programming models where GPUs transparently share data, essential for multi-GPU deep learning training, scientific simulation, and real-time rendering.

P2P Communication Paths

PathHowBandwidthLatency
Traditional (staged)GPU A → CPU RAM → GPU BLimited by PCIe + memcpy~10-20 µs
P2P over PCIeGPU A → PCIe switch → GPU BPCIe speed (32-64 GB/s)~3-5 µs
P2P over NVLinkGPU A → NVLink → GPU BNVLink speed (600-900 GB/s)~1-2 µs
GPUDirect RDMANetwork → GPU (bypass CPU)Network speed (25-100 GB/s)~2-5 µs

CUDA P2P API

// Check P2P support
int canAccess;
cudaDeviceCanAccessPeer(&canAccess, gpu0, gpu1);

// Enable P2P access
cudaSetDevice(gpu0);
cudaDeviceEnablePeerAccess(gpu1, 0);

// Direct copy between GPUs (no CPU staging)
cudaMemcpyPeer(dst_ptr_gpu1, gpu1, src_ptr_gpu0, gpu0, size);

// Async P2P copy
cudaMemcpyPeerAsync(dst, gpu1, src, gpu0, size, stream);

// Direct pointer access (Unified Virtual Addressing)
// GPU 0 kernel can dereference pointer to GPU 1 memory
my_kernel<<<grid, block>>>(gpu1_ptr);  // Access remote GPU memory

GPUDirect Technologies (NVIDIA)

TechnologyWhatBypass
GPUDirect P2PGPU-to-GPU over PCIe/NVLinkCPU memory
GPUDirect RDMANetwork NIC → GPU directlyCPU memory + CPU
GPUDirect StorageNVMe SSD → GPU directlyCPU memory + filesystem
GPUDirect AsyncAsync control of all aboveCPU involvement

GPUDirect RDMA (Network → GPU)

P2P Topology Awareness

    GPU 0 ←NVLink→ GPU 1
      ↑               ↑
    NVLink           NVLink
      ↓               ↓
    GPU 2 ←NVLink→ GPU 3
      ↑               ↑
    PCIe             PCIe
      ↓               ↓
    CPU Socket 0    CPU Socket 1

Impact on ML Training

Peer-to-peer GPU communication is the physical foundation of multi-GPU computing — by enabling GPUs to share data at NVLink or PCIe speeds without CPU intermediation, P2P transforms a collection of discrete GPUs into a unified computational fabric where tensor and pipeline parallelism can operate at the bandwidth required by modern large-scale AI training.

peer to peer gpup2p cudagpu directgpu direct rdmagpu to gpu transfer

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.