From d10d691e76fb1177abac836521f1e57cc730813d Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Sat, 9 May 2020 11:31:09 -0700 Subject: [PATCH] Add env var to toggle large bar support in runtime Use ROC_ENABLE_LARGE_BAR (0/1) to toggle. The support is enabled by default. Change-Id: I6cb93a46594cb6f5e90bf6057738330225efb553 --- rocclr/device/rocm/rocdevice.cpp | 2 +- rocclr/utils/flags.hpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index 284023526d..e12240a8fd 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -896,7 +896,7 @@ hsa_status_t Device::iterateGpuMemoryPoolCallback(hsa_amd_memory_pool_t pool, vo if (tmp == HSA_AMD_MEMORY_POOL_ACCESS_NEVER_ALLOWED) { dev->info_.largeBar_ = false; } else { - dev->info_.largeBar_ = true; + dev->info_.largeBar_ = ROC_ENABLE_LARGE_BAR; } } diff --git a/rocclr/utils/flags.hpp b/rocclr/utils/flags.hpp index f67aa46e48..8e01366c38 100644 --- a/rocclr/utils/flags.hpp +++ b/rocclr/utils/flags.hpp @@ -72,8 +72,6 @@ release(bool, GPU_FLUSH_ON_EXECUTION, false, \ "Submit commands to HW on every operation. 0 - Disable, 1 - Enable") \ release(bool, GPU_USE_SYNC_OBJECTS, true, \ "If enabled, use sync objects instead of polling") \ -release(size_t, GPU_FORCE_BLIT_COPY_SIZE, 0, \ - "Size in KB of the threshold below which to force blit instead for sdma") \ release(bool, CL_KHR_FP64, true, \ "Enable/Disable support for double precision") \ release(cstring, AMD_OCL_BUILD_OPTIONS, 0, \ @@ -233,7 +231,11 @@ release(uint, AMD_OPT_FLUSH, 1, \ "0x1 = Use device-scope fence operations when possible.") \ release(uint, HIP_HIDDEN_FREE_MEM, 0, \ "Reserve free mem reporting in Mb" \ - "0 = Disable") + "0 = Disable") \ +release(size_t, GPU_FORCE_BLIT_COPY_SIZE, 0, \ + "Size in KB of the threshold below which to force blit instead for sdma") \ +release(bool, ROC_ENABLE_LARGE_BAR, true, \ + "Enable Large Bar if supported by the device") namespace amd {