SWDEV-485866 - Return OOM if stream creation fails due to insufficient memory.

Change-Id: I4e57ecc81921bde274bb6a4e0890f0fc6a17955a


[ROCm/clr commit: 5ccc140e1b]
This commit is contained in:
Jaydeep Patel
2024-09-19 06:59:43 +00:00
committed by Jaydeepkumar Patel
parent da59165313
commit 7983801b0c
4 changed files with 11 additions and 3 deletions
@@ -1461,9 +1461,11 @@ bool VirtualGPU::initPool(size_t kernarg_pool_size) {
roc_device_.info().largeBar_) {
kernarg_pool_base_ =
reinterpret_cast<address>(roc_device_.deviceLocalAlloc(kernarg_pool_size_));
// @note Workaround first access penalty.
// KFD may update CPU page tables on the first CPU access
*kernarg_pool_base_ = 0;
if (kernarg_pool_base_ != nullptr) {
// @note Workaround first access penalty.
// KFD may update CPU page tables on the first CPU access
*kernarg_pool_base_ = 0;
}
} else {
kernarg_pool_base_ = reinterpret_cast<address>(roc_device_.hostAlloc(kernarg_pool_size_, 0,
Device::MemorySegment::kKernArg));