From 655732efababa85160db1299c347da1386933a65 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 10 Apr 2018 15:53:40 -0400 Subject: [PATCH] P4 to Git Change 1539091 by vsytchen@vsytchen-ocl-win10 on 2018/04/10 14:57:40 SWDEV-150166 - [OCL][LC][Ellesmere][Windows] oclcompiler.OCLStructOperations[30] causing crash 1. Set the default amount of command buffer allocated per queue to 4 for pre-gfx9 and 12 for gfx9+ pal devices. 2. Limit the amount of command buffers allocated for device queue to 2. ReviewBoardURL = http://ocltc.amd.com/reviews/r/14594/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#50 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#89 edit --- rocclr/runtime/device/pal/palsettings.cpp | 9 +++++++-- rocclr/runtime/device/pal/palvirtual.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp index 1bf6e31112..5acdb5dc32 100644 --- a/rocclr/runtime/device/pal/palsettings.cpp +++ b/rocclr/runtime/device/pal/palsettings.cpp @@ -142,8 +142,7 @@ Settings::Settings() { subAllocationMaxSize_ = std::min(static_cast(GPU_MAX_SUBALLOC_SIZE) * Ki, subAllocationChunkSize_); - // Note: More command buffers may cause a HW hang with HWSC on VI family in OCLPerfKernelArguments - maxCmdBuffers_ = 8; + maxCmdBuffers_ = 12; } bool Settings::create(const Pal::DeviceProperties& palProp, @@ -293,6 +292,12 @@ bool Settings::create(const Pal::DeviceProperties& palProp, maxAllocSize_ = 3ULL * Gi; } + // Note: More than 4 command buffers may cause a HW hang + // with HWSC on pre-gfx9 devices in OCLPerfKernelArguments + if (!aiPlus_) { + maxCmdBuffers_ = 4; + } + supportRA_ = false; partialDispatch_ = GPU_PARTIAL_DISPATCH; numMemDependencies_ = GPU_NUM_MEM_DEPENDENCY; diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp index 1463b81cad..e6a81d9ad4 100644 --- a/rocclr/runtime/device/pal/palvirtual.cpp +++ b/rocclr/runtime/device/pal/palvirtual.cpp @@ -784,7 +784,7 @@ bool VirtualGPU::create(bool profiling, uint deviceQueueSize, uint rtCUs, uint idx = index() % (dev().numComputeEngines() - firstQueue); uint64_t residency_limit = dev().properties().gpuMemoryProperties.flags.supportPerSubmitMemRefs ? 0 : (dev().properties().gpuMemoryProperties.maxLocalMemSize >> 2); - uint max_cmd_buffers = dev().settings().maxCmdBuffers_; + uint max_cmd_buffers = (idx == 0) ? 2 : dev().settings().maxCmdBuffers_; if (dev().numComputeEngines()) { //! @todo There is a hang with a mix of user and non user queues.