You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cuda.core: PinnedMemoryResource.is_device_accessible returns True without granting device access to the pool #3205
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:
A test that launches a kernel which reads and writes a PinnedMemoryResource buffer, on the allocating device, with and without numa_id set.
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