Skip to content

[BUG]: PinnedMemoryResource returns an unusable buffer when host memory pools are unsupported #2486

Description

@uday1o1

Is this a duplicate?

Type of Bug

Runtime Error

Component

cuda.core

Describe the bug

On a device where device.properties.host_memory_pools_supported is False, PinnedMemoryResource.allocate() returns a buffer instead of reporting that host memory pools are unsupported.

The first host-to-device transfer using the returned buffer then fails with CUDA_ERROR_INVALID_VALUE.

Synchronizing the stream immediately after allocation does not expose the failure earlier or change the result.

LegacyPinnedMemoryResource completes the same allocation and transfer sequence successfully.

This makes the transfer appear invalid even though the underlying limitation is that the stream's device does not support host memory pools.

How to Reproduce

  1. Use a CUDA device where host_memory_pools_supported is False.
  2. Allocate pinned memory with PinnedMemoryResource.
  3. Copy from the returned buffer to device memory.
  4. Observe CUDA_ERROR_INVALID_VALUE.

Expected behavior

PinnedMemoryResource.allocate() should report that the stream's device does not support host memory pools instead of returning an unusable buffer.

The documentation should state this requirement and recommend LegacyPinnedMemoryResource when host memory pools are unavailable and stream-ordered allocation is not required:

System information

Operating System

  • Jetson AGX Orin
  • Jetson Linux R39.2
  • Python 3.12.3
  • CUDA 13.2.1
  • cuda-core 1.1.0
  • cuda-bindings 13.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions