Skip to content

Commit

Permalink
UCT/ROCM: don't try to lock host pinned memory
Browse files Browse the repository at this point in the history
newer ROCm releases don't like locking host pinned memory (e.g. hipHostMalloc).
avoid the lock operation in the rocm_copy path.

(cherry picked from commit 745df30)
  • Loading branch information
edgargabriel committed May 17, 2023
1 parent 66f77de commit 38a7987
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/uct/rocm/copy/rocm_copy_ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ ucs_status_t uct_rocm_copy_ep_zcopy(uct_ep_h tl_ep,
return UCS_ERR_IO_ERROR;
}

if ((remote_addr_mem_type == HSA_EXT_POINTER_TYPE_HSA) &&
(dev_type == HSA_DEVICE_TYPE_GPU)) {
/* UCS_MEMORY_TYPE_ROCM */
if (remote_addr_mem_type == HSA_EXT_POINTER_TYPE_HSA) {
remote_addr_mod = (void*)remote_addr;
agent = tmp_agent;
if (dev_type == HSA_DEVICE_TYPE_GPU) {
/* UCS_MEMORY_TYPE_ROCM */
agent = tmp_agent;
} else {
remote_addr_is_host = 1;
}
} else if ((remote_addr_mem_type == HSA_EXT_POINTER_TYPE_LOCKED) &&
(size == dev_size)) {
/* locked host memory, e.g. hipHostRegister, OR previously registered */
Expand Down Expand Up @@ -152,11 +155,14 @@ ucs_status_t uct_rocm_copy_ep_zcopy(uct_ep_h tl_ep,
return UCS_ERR_IO_ERROR;
}

if ((iov_buffer_mem_type == HSA_EXT_POINTER_TYPE_HSA) &&
(dev_type == HSA_DEVICE_TYPE_GPU)) {
/* UCS_MEMORY_TYPE_ROCM */
if (iov_buffer_mem_type == HSA_EXT_POINTER_TYPE_HSA) {
iov_buffer_mod = iov->buffer;
agent = tmp_agent;
if (dev_type == HSA_DEVICE_TYPE_GPU) {
/* UCS_MEMORY_TYPE_ROCM */
agent = tmp_agent;
} else {
iov_buffer_is_host = 1;
}
} else if ((iov_buffer_mem_type == HSA_EXT_POINTER_TYPE_LOCKED) &&
(size == dev_size)) {
/* locked host memory (e.g. hipHostRegister) OR previously registered */
Expand Down

0 comments on commit 38a7987

Please sign in to comment.