diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp index 0faec34786..12b4cc47fe 100644 --- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp @@ -1294,6 +1294,15 @@ bool Device::init() { info.pSettingsPath = "OCL"; info.maxSvmSize = static_cast(OCL_SET_SVM_SIZE * Mi); + if (IS_LINUX) { + //! @note: Linux may have a deadlock if runtime will attempt to reserve + //! VA range, which is much bigger than sysmem size + size_t maxVirtualReserve = amd::Os::getPhysicalMemSize() << 1; + if (info.maxSvmSize > maxVirtualReserve) { + info.maxSvmSize = maxVirtualReserve; + } + } + // PAL init if (Pal::Result::Success != Pal::CreatePlatform(info, platformObj_, &platform_)) { return false; diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp index ec357bd826..1c48880088 100644 --- a/projects/clr/rocclr/runtime/utils/flags.hpp +++ b/projects/clr/rocclr/runtime/utils/flags.hpp @@ -129,7 +129,7 @@ release(bool, DISABLE_DEFERRED_ALLOC, false, \ "Disables deferred memory allocation on device") \ release(int, AMD_GPU_FORCE_SINGLE_FP_DENORM, -1, \ "Force denorm for single precision: -1 - don't force, 0 - disable, 1 - enable") \ -release(uint, OCL_SET_SVM_SIZE, 16384, \ +release(uint, OCL_SET_SVM_SIZE, 4*16384, \ "set SVM space size for discrete GPU") \ debug(uint, OCL_SYSMEM_REQUIREMENT, 2, \ "Use flag to change the minimum requirement of system memory not to downgrade") \