aboutsummaryrefslogtreecommitdiff
path: root/libc/utils
diff options
context:
space:
mode:
authorJoseph Huber <35342157+jhuber6@users.noreply.github.com>2023-09-26 16:03:34 -0500
committerGitHub <noreply@github.com>2023-09-26 16:03:34 -0500
commit0f88be77ea59360ae43f4e5683e23f7edce6aceb (patch)
treea99020afe8bb715215e1a3500f227a1915658aad /libc/utils
parent79b9d41bd7187cbfe7da5bd0534f8c11b149bf34 (diff)
downloadllvm-0f88be77ea59360ae43f4e5683e23f7edce6aceb.zip
llvm-0f88be77ea59360ae43f4e5683e23f7edce6aceb.tar.gz
llvm-0f88be77ea59360ae43f4e5683e23f7edce6aceb.tar.bz2
[Libomptarget] Fix Nvidia offloading hanging on dataRetrieve using RPC (#66817)
Summary: The RPC server is responsible for providing host services from the GPU. Generally, the client running on the GPU will spin in place until the host checks the server. Inside the runtime, we elected to have the user thread do this checking while it would be otherwise waiting for the kernel to finish. However, for Nvidia this caused problems when offloading to a target region that requires a copy back. This is caused by the implementation of `dataRetrieve` on Nvidia. We initialize an asynchronous copy-back on the same stream that the kernel is running on. This creates an implicit sync on the kernel to finish before we issue the D2H copy, which we then wait on. This implicit sync happens inside of the CUDA runtime. This is problematic when running the RPC server because we need someone to check the RPC server. If no one checks the RPC server then the kernel will never finish, meaning that the memcpy will never be issued and the program hangs. This patch adds an explicit check for unfinished work on the stream and waits for it to complete.
Diffstat (limited to 'libc/utils')
0 files changed, 0 insertions, 0 deletions