Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't presume pointers location infers usability. #2480

Conversation

robertmaynard
Copy link
Contributor

Here is the results of looking at the cudaPointerGetAttributes of different allocation types on Grace + Hopper. Allocations of malloc are still usable on the GPU.

ccudaPointerGetAttributes attributes malloc ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 1
  memory loc  -> unregistered

cudaPointerGetAttributes attributes cudaMalloc ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 0
  memory loc  -> device

cudaPointerGetAttributes attributes cudaMallocManaged cudaMemAttachGlobal ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 1
  memory loc  -> managed

Here is the results of looking at the cudaPointerGetAttributes
of different allocation types on Grace + Hopper. Allocations
of `malloc` are still usable on the GPU.
```
ccudaPointerGetAttributes attributes malloc ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 1
  memory loc  -> unregistered

cudaPointerGetAttributes attributes cudaMalloc ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 0
  memory loc  -> device

cudaPointerGetAttributes attributes cudaMallocManaged cudaMemAttachGlobal ptr
  is_dev_ptr  -> 1
  is_host_ptr -> 1
  memory loc  -> managed

```
@robertmaynard robertmaynard added bug Something isn't working non-breaking Non-breaking change labels Nov 1, 2024
@robertmaynard robertmaynard requested a review from a team as a code owner November 1, 2024 21:08
@github-actions github-actions bot added the cpp label Nov 1, 2024
Copy link
Contributor

@lowener lowener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robertmaynard
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 53b9caa into rapidsai:branch-24.12 Nov 6, 2024
70 checks passed
@robertmaynard robertmaynard deleted the bug/device_ptrs_can_be_host_ptrs branch November 6, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants