Hello CUDA experts,
I’m running into an issue where using cuStreamWriteValue32 on memory allocated via cuMemCreate + cuMemAddressReserve + cuMemMap + cuMemSetAccess leads to “invalid argument” error. It works fine for memory allocated via cudaMalloc. Is cuStreamWriteValue32 not supported for memory allocated via cuMemCreate?
I’m asking here because I wasn’t able to find any documentation confirming or denying this. The only possible lead I could find is the documentation for cuCtxDestroy, which says “cuCtxDestroy() will not destroy memory allocations by cuMemCreate()… These memory allocations are not associated with any CUDA context and need to be destroyed explicitly.” I wonder if the limitation is related to the allocation not being associated with a context.
Relevant allocation properties I used:
// Properties for cuMemCreate
CUmemAllocationProp prop = {};
prop.type = CU_MEM_ALLOCATION_TYPE_PINNED;
prop.location.type = CU_MEM_LOCATION_TYPE_DEVICE;
prop.location.id = device_idx;
prop.requestedHandleTypes = CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR;
// Properties for cuMemSetAccess
CUmemAccessDesc desc;
desc.location.type = CU_MEM_LOCATION_TYPE_DEVICE;
desc.location.id = static_cast<int>(device_idx);
desc.flags = CU_MEM_ACCESS_FLAGS_PROT_READWRITE;
Environment:
H100 SXM, Driver Version: 535.154.05, CUDA Version: 12.2
Thanks for your help!