Skip to content

Warn when creating ManagedMemoryResource on platforms without concurrent managed access #1607

@Andy-Jost

Description

@Andy-Jost

Summary

On platforms where CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS is 0 (e.g., certain Windows/WSL configurations), Unified Memory cannot be safely accessed from the host while any GPU kernel is in flight on any stream. This makes ManagedMemoryResource effectively unusable in general-purpose code on these platforms.

Proposed Changes

  1. Runtime warning: When ManagedMemoryResource is created, query CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS. If it is 0, emit a prominent warning stating that host access to managed memory requires explicit synchronization at every point or the process will segfault, with a link to the CUDA Programming Guide.
  2. Test coverage: Skip managed memory tests on affected platforms.

Context

See discussion in #1539.

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!cuda.coreEverything related to the cuda.core moduleenhancementAny code-related improvements

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions