Skip to content

Commit

Permalink
[Offload] Stop the RPC server faiilng with more than one GPU (#125982)
Browse files Browse the repository at this point in the history
Summary:
Pretty dumb mistake of me, forgot that this is run per-device and
per-plugin, which fell through the cracks with my testing because I have
two GPUs that use different plugins.

(cherry picked from commit 7a87794)
  • Loading branch information
jhuber6 authored and tstellar committed Feb 8, 2025
1 parent e407908 commit dbb2699
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions offload/plugins-nextgen/common/src/PluginInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,9 @@ Error GenericDeviceTy::setupRPCServer(GenericPluginTy &Plugin,
if (auto Err = Server.initDevice(*this, Plugin.getGlobalHandler(), Image))
return Err;

if (auto Err = Server.startThread())
return Err;
if (!Server.Thread->Running.load(std::memory_order_acquire))
if (auto Err = Server.startThread())
return Err;

RPCServer = &Server;
DP("Running an RPC server on device %d\n", getDeviceId());
Expand Down Expand Up @@ -1633,7 +1634,7 @@ Error GenericPluginTy::deinit() {
if (GlobalHandler)
delete GlobalHandler;

if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_relaxed))
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_acquire))
if (Error Err = RPCServer->shutDown())
return Err;

Expand Down

0 comments on commit dbb2699

Please sign in to comment.