From 01c2727a3ad28a55ee843194e0f502a3fc90509e Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Mon, 15 Jun 2020 18:28:59 -0400 Subject: [PATCH] Disable P2P emulation for HIP Some apps use P2P transfer without any validation for peer access. Report an error if runtime has found such a request. Change-Id: I3bf728f1fc3969697ade97bb1d2f1dce294078e2 --- rocclr/platform/command.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rocclr/platform/command.cpp b/rocclr/platform/command.cpp index ffa9f7cc04..1f48a0e57a 100644 --- a/rocclr/platform/command.cpp +++ b/rocclr/platform/command.cpp @@ -614,7 +614,11 @@ bool CopyMemoryP2PCommand::validateMemory() { // Validate P2P memories on the current device, if any of them is null, then it's p2p staging if ((nullptr == memory1_->getDeviceMemory(queue()->device())) || (nullptr == memory2_->getDeviceMemory(queue()->device()))) { - p2pStaging = true; + // HIP doesn't support emulation + p2pStaging = !amd::IS_HIP; + if (!p2pStaging) { + return false; + } } if (devices[0]->P2PStage() != nullptr && p2pStaging) {