﻿# CUDA memory-pool peer access is a pool permission, not a copy operation

Distinguish CUDA memory-pool location, peer capability, cudaMemPoolSetAccess permissions, and producer lifetime when another GPU consumes an allocation.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-cuda-memory-pool-peer-access-permissions/
Language: en

## A pointer travels farther than its permissions

Imagine a producer GPU allocating a staging buffer through a stream-ordered pool. An application passes its pointer to a consumer on another GPU and assumes ordinary peer enablement is sufficient. The pointer identifies storage, but the consumer also needs an appropriate access policy and a dependency on completed production.

The [multi-GPU programming guide](https://docs.nvidia.com/cuda/cuda-programming-guide/03-advanced/multi-gpu-systems.html) provides the system context. Address visibility should be reviewed separately from where the underlying allocation resides.

## Pool access has its own API

The [stream-ordered allocator guide](https://docs.nvidia.com/cuda/cuda-programming-guide/04-special-topics/stream-ordered-memory-allocation.html) explicitly distinguishes memory-pool access control from `cudaDeviceEnablePeerAccess`. For pool allocations, `cudaMemPoolSetAccess` changes which devices may access the pool resources.

Check peer capability using `cudaDeviceCanAccessPeer` for the accessing and resident devices. A permitted peer relationship is a prerequisite, not an instruction to copy or migrate the contents. Keep resident-device identity and consumer-device identity explicit in configuration rather than inferring them from the current host-thread device.

## Permissions apply to the pool domain

The access setting covers allocations from that pool, including existing allocations, rather than only a selected pointer created afterward. This makes a pool a meaningful policy boundary. Grouping unrelated buffers into a shared pool can therefore broaden the resources covered by an access change.

Review the corresponding `cudaMemPoolGetAccess` query in the [runtime allocator reference](https://docs.nvidia.com/cuda/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY__POOLS.html). Record the pool handle association and device location with a failing case so a successful permission change is attributed to the intended allocation domain.

## Visibility does not establish readiness

The consumer must wait for allocation and producer operations to complete before accessing the buffer. The allocation must also remain alive until every consumer is finished. Access permission does not introduce these temporal dependencies automatically.

Draw the allocation, write, remote read, and free relationships before choosing events or streams. This is application reasoning based on allocator ordering requirements; it is not a claim that any particular topology provides measured overlap. The [GPU evidence guide](/journal/gpu-acceptance-evidence/) explains how to retain the relevant system configuration.

## Test location and lifetime independently

A useful reproducer changes consumer device, pool selection, and synchronization separately. It should verify contents, not merely successful API returns. Distinguish unsupported peer capability from incorrect permissions and premature reuse.

Only after correctness is established should [benchmark methodology](/journal/inference-benchmark-method/) evaluate remote access against an explicit copy path. The permission API does not promise equal bandwidth, automatic migration, or a universally faster placement strategy.
