-
Notifications
You must be signed in to change notification settings - Fork 453
UCT/CUDA/CUDA_IPC: cuCtxPushCurrent before cuIpcCloseMemHandle. #10618
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
UCT/CUDA/CUDA_IPC: cuCtxPushCurrent before cuIpcCloseMemHandle. #10618
Conversation
if (status == UCS_OK) { | ||
return UCT_CUDADRV_FUNC_LOG_WARN(cuMemAddressFree( | ||
status = UCT_CUDADRV_FUNC_LOG_WARN(cuMemAddressFree( | ||
(CUdeviceptr)region->mapped_addr, region->key.b_len)); | ||
} | ||
|
||
return status; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe smth like
status = UCT_CUDADRV_FUNC_LOG_WARN(cuMemUnmap(...));
if (status != UCS_OK) {
return status;
}
return UCT_CUDADRV_FUNC_LOG_WARN(cuMemAddressFree(...));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ucs_status_t status; | ||
|
||
status = uct_cuda_primary_ctx_retain(cuda_device, 1, &cuda_ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: imo no need to force, as primary context is supposed to be active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it forced in uct_cuda_ipc_open_memhandle_legacy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably leftover from the time we thought we need this focring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to 0
.
ed1dc49
to
9a52b3c
Compare
What?
Push the primary device context before calling
cuIpcCloseMemHandle
.Why?
There is a warning if there is no CUDA context bound to the current CPU thread while closing memory handle.