Skip to content

cuda.core: PinnedMemoryResource.is_device_accessible returns True without granting device access to the pool #3205

Open

Description

@Andy-Jost

PinnedMemoryResource.is_device_accessible returns True unconditionally, and its docstring says the resource "provides device-accessible buffers" (cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx, the is_device_accessible property). The resource creates its pool with CUmemPoolProps only and never calls cuMemPoolSetAccess.

The driver documents the default differently. From cuMemPoolCreate: "In the case of pools created with CU_MEM_LOCATION_TYPE_HOST_NUMA or CU_MEM_LOCATION_TYPE_HOST, their default accessibility will be from the host CPU." Device access to such a pool is granted with cuMemPoolSetAccess.

Nothing in the test suite settles which is right in practice: every kernel launch on pinned memory uses LegacyPinnedMemoryResource, and the pool-backed tests only copy on the host.

Asks:

  1. A test that launches a kernel which reads and writes a PinnedMemoryResource buffer, on the allocating device, with and without numa_id set.
  2. If the kernel faults: grant access for the device at pool creation (cuMemPoolSetAccess with CU_MEM_ACCESS_FLAGS_PROT_READWRITE for the current device, or expose the choice), and keep is_device_accessible as True. If it does not fault: keep the behavior, and make the docstring say what the access rule is, so it does not promise more than the pool provides.

Found while reviewing #2713, whose docstring text for allocate touched the same question.

Activity

  1. added this to the cuda.core next milestone on Oct 23, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. added
    bugSomething isn't working
    P2Low priority - Nice to have
    cuda.coreEverything related to the cuda.core module
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Low priority - Nice to havebugSomething isn't workingcuda.coreEverything related to the cuda.core module

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions