From afd5fd4446db17debfef6eda5897a7e236f5185c Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:50:57 +0530 Subject: [PATCH] SWDEV-382074 - Check for peer access. (#169) Change-Id: I8b931a92fc97c68556d74332984ddf17c53df7d4 [ROCm/hip-tests commit: 92f0da368ff0f4bc32e234e69e5e5cbb0c648ab0] --- .../hip-tests/catch/include/memcpy1d_tests_common.hh | 2 +- projects/hip-tests/catch/unit/graph/hipGraphUpload.cc | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/hip-tests/catch/include/memcpy1d_tests_common.hh b/projects/hip-tests/catch/include/memcpy1d_tests_common.hh index fe0d46788b..72c1500fc8 100644 --- a/projects/hip-tests/catch/include/memcpy1d_tests_common.hh +++ b/projects/hip-tests/catch/include/memcpy1d_tests_common.hh @@ -141,7 +141,7 @@ void MemcpyDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream = HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device)); if (!can_access_peer) { INFO("Peer access cannot be enabled between devices " << src_device << " " << dst_device); - REQUIRE(can_access_peer); + return; } HIP_CHECK(hipDeviceEnablePeerAccess(dst_device, 0)); } diff --git a/projects/hip-tests/catch/unit/graph/hipGraphUpload.cc b/projects/hip-tests/catch/unit/graph/hipGraphUpload.cc index d17fb27236..05aac91c8b 100644 --- a/projects/hip-tests/catch/unit/graph/hipGraphUpload.cc +++ b/projects/hip-tests/catch/unit/graph/hipGraphUpload.cc @@ -161,8 +161,17 @@ TEST_CASE("Unit_hipGraphUpload_Functional_multidevice_test") { SECTION("Pass a common stream for all device") { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); - + int currDevice = -1; + HIP_CHECK(hipGetDevice(&currDevice)); for (int i = 0; i < numDevices; i++) { + if (i != currDevice) { + int can_access_peer = 0; + HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, currDevice, i)); + if (!can_access_peer) { + INFO("Peer access cannot be enabled between devices " << currDevice << " " << i); + continue; + } + } HIP_CHECK(hipSetDevice(i)); hipGraphUploadFunctional_with_hipStreamBeginCapture(stream); hipGraphUploadFunctional_with_stream(stream);