From b66ec1a03141022b5324bc6e203f6f7ed00a565c Mon Sep 17 00:00:00 2001 From: Anusha Godavarthy Surya Date: Sun, 24 Jul 2022 21:55:53 -0700 Subject: [PATCH] SWDEV-345683 - Fix HIP out of memory If for every eventRecord handler is not submitted, memory is not getting released during hipFree and leads to OOM. Change-Id: I19b61a0c523502e9e1a3564ce8b791f3e2cea02c [ROCm/clr commit: 7b1c6d06d5b9cfe39a02b183d3084309dfa77319] --- projects/clr/rocclr/platform/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/platform/command.cpp b/projects/clr/rocclr/platform/command.cpp index 50c850d98a..2a6729d33a 100644 --- a/projects/clr/rocclr/platform/command.cpp +++ b/projects/clr/rocclr/platform/command.cpp @@ -336,7 +336,7 @@ void Command::releaseResources() { } } -static constexpr uint32_t kMarkerTsCount = 64; +static constexpr uint32_t kMarkerTsCount = 1; // ================================================================================================ void Command::enqueue() { assert(queue_ != NULL && "Cannot be enqueued"); @@ -372,7 +372,7 @@ void Command::enqueue() { bool submitBatch = !profilingInfo().marker_ts_; // Flush the batch if ther marker_ts have been continuously submitted until a threashold // is reached. This helps recycling the commands and frees memory. - if (queue_->GetMarkerTsCount() > kMarkerTsCount) { + if (queue_->GetMarkerTsCount() >= kMarkerTsCount) { submitBatch = true; queue_->ResetMarkerTsCount(); }