Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7a87794

Browse files
authoredFeb 6, 2025
[Offload] Stop the RPC server faiilng with more than one GPU (#125982)
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.
1 parent ed8a6d6 commit 7a87794

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎offload/plugins-nextgen/common/src/PluginInterface.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1058,8 +1058,9 @@ Error GenericDeviceTy::setupRPCServer(GenericPluginTy &Plugin,
10581058
if (auto Err = Server.initDevice(*this, Plugin.getGlobalHandler(), Image))
10591059
return Err;
10601060

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

10641065
RPCServer = &Server;
10651066
DP("Running an RPC server on device %d\n", getDeviceId());
@@ -1634,7 +1635,7 @@ Error GenericPluginTy::deinit() {
16341635
if (GlobalHandler)
16351636
delete GlobalHandler;
16361637

1637-
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_relaxed))
1638+
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_acquire))
16381639
if (Error Err = RPCServer->shutDown())
16391640
return Err;
16401641

0 commit comments

Comments
 (0)
Failed to load comments.