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

Some question about cuMemImportFromShareableHandle #437

Closed
MARD1NO opened this issue Feb 5, 2025 · 3 comments
Closed

Some question about cuMemImportFromShareableHandle #437

MARD1NO opened this issue Feb 5, 2025 · 3 comments
Assignees
Labels
triage Needs the team's attention

Comments

@MARD1NO
Copy link

MARD1NO commented Feb 5, 2025

Hi cuda-python developers, I meet a problem that when I pass a CUmemFabricHandle to cuMemImportFromShareableHandle, it raise a error like:

Provided argument is of type <class 'cuda.bindings.driver.CUmemFabricHandle'> but expected Type <class 'NoneType'>, <class 'type'> or object with Buffer Protocol

My code is:

import cuda.bindings.driver as cudriver 

# equal to CU_MEM_HANDLE_TYPE_FABRIC
handle_type = cudriver.CUmemAllocationHandleType(8)
peer_handle = cudriver.CUmemFabricHandle()
peer_handle.data = xxx

err, buf = cudriver.cuMemImportFromShareableHandle(peer_handle, handle_type)

Is there something wrong with my code or it just a type check bug in cuda-python?

@github-actions github-actions bot added the triage Needs the team's attention label Feb 5, 2025
@MARD1NO
Copy link
Author

MARD1NO commented Feb 5, 2025

Or should I pass peer_handle.data or peer_handle.getPtr() ?....

@leofang
Copy link
Member

leofang commented Feb 5, 2025

@vzhurba01 could you take a look?

@MARD1NO
Copy link
Author

MARD1NO commented Feb 6, 2025

@vzhurba01 could you take a look?

I find it need to use peer_handle.data, thanks :D

@MARD1NO MARD1NO closed this as completed Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs the team's attention
Projects
None yet
Development

No branches or pull requests

3 participants