Skip to content

Commit 9553e15

Browse files
committed
[libc] Allocate fine-grained memory for the RPC host symbol
Summary: This pointer has been causing issues. Allocating and reading from coarse memory on the CPU is not guaranteed and varies depending on the kernel version and support. Previously we attempted to pin the memory but this caused unexpected failures. This should be a legal operation and work around the problem as fine-grained memory should be always legal to write to by both sides.
1 parent 1a013b6 commit 9553e15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc/utils/gpu/loader/amdgpu/Loader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,10 @@ int load(int argc, char **argv, char **envp, void *image, size_t size,
466466

467467
void *rpc_client_host;
468468
if (hsa_status_t err =
469-
hsa_amd_memory_pool_allocate(coarsegrained_pool, sizeof(void *),
469+
hsa_amd_memory_pool_allocate(finegrained_pool, sizeof(void *),
470470
/*flags=*/0, &rpc_client_host))
471471
handle_error(err);
472+
hsa_amd_agents_allow_access(1, &dev_agent, nullptr, rpc_client_host);
472473

473474
void *rpc_client_dev;
474475
if (hsa_status_t err = hsa_executable_symbol_get_info(

0 commit comments

Comments
 (0)