diff --git a/projects/clr/rocclr/runtime/device/pal/palresource.cpp b/projects/clr/rocclr/runtime/device/pal/palresource.cpp index 598ba7bcac..b6557bf473 100644 --- a/projects/clr/rocclr/runtime/device/pal/palresource.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palresource.cpp @@ -1258,18 +1258,22 @@ Resource::partialMemCopyTo( calSize[2] = size[2]; uint64_t gpuMemoryOffset, gpuMemoryRowPitch, imageOffsetx; + bool img1Darray = false; if (desc().buffer_ && !dstResource.desc().buffer_) { imageOffsetx = calDstOrigin[0] % dstResource.elementSize(); gpuMemoryOffset = calSrcOrigin[0] + offset(); gpuMemoryRowPitch = (calSrcOrigin[1]) ? calSrcOrigin[1] : calSize[0] * dstResource.elementSize(); + img1Darray = (dstResource.desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY); } else if (!desc().buffer_ && dstResource.desc().buffer_) { imageOffsetx = calSrcOrigin[0] % elementSize(); gpuMemoryOffset = calDstOrigin[0] + dstResource.offset(); gpuMemoryRowPitch = (calDstOrigin[1]) ? calDstOrigin[1] : calSize[0] * elementSize(); + img1Darray = (desc().topology_ == CL_MEM_OBJECT_IMAGE1D_ARRAY); + } if ((desc().buffer_ && !dstResource.desc().buffer_) || @@ -1281,7 +1285,8 @@ Resource::partialMemCopyTo( // another DRM restriciton... SI has 4 pixels (gpuMemoryOffset % 4 != 0) || (dev().settings().sdamPageFaultWar_ && - (imageOffsetx != 0))) { + (imageOffsetx != 0)) || + (dev().settings().disableSdmaMemoryToImage_ && img1Darray)) { return false; } diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp index 9a90c4f91e..f653eaf50c 100644 --- a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp @@ -137,6 +137,9 @@ Settings::Settings() // Disable SDMA workaround by default sdamPageFaultWar_ = false; + + // Disable SDMA copy for Image to Mem and Mem to Image by default + disableSdmaMemoryToImage_ = false; } bool @@ -176,6 +179,11 @@ Settings::create( switch (palProp.gfxLevel) { case Pal::GfxIpLevel::GfxIp9: aiPlus_ = true; + if (!apuSystem_) + // This is a temporary workaround to disable sDMA for MemToImage and + // ImageToMem copies and needs be removed later once we have a fix + // for Conf. images(mipmaps) 1Darray failures on Vega10 + disableSdmaMemoryToImage_ = GPU_DISABLE_SDMA_MEMORY_TO_IMAGE; break; default: assert(0 && "Unknown GfxIP type!"); diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.hpp b/projects/clr/rocclr/runtime/device/pal/palsettings.hpp index 0f9f23e648..a38d0a58d1 100644 --- a/projects/clr/rocclr/runtime/device/pal/palsettings.hpp +++ b/projects/clr/rocclr/runtime/device/pal/palsettings.hpp @@ -66,8 +66,9 @@ public: uint apuSystem_: 1; //!< Device is APU system with shared memory uint useDeviceQueue_: 1; //!< Submit to separate device queue uint singleFpDenorm_: 1; //!< Support Single FP Denorm - uint sdamPageFaultWar_: 1; //!< SDAM page fault workaround - uint reserved_: 9; + uint sdamPageFaultWar_: 1; //!< SDMA page fault workaround + uint disableSdmaMemoryToImage_ : 1;//!< Disable sDMA copy for Memory to Image + uint reserved_: 8; }; uint value_; }; diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp index 9b185ef41b..0dcbfdd03a 100644 --- a/projects/clr/rocclr/runtime/utils/flags.hpp +++ b/projects/clr/rocclr/runtime/utils/flags.hpp @@ -202,7 +202,9 @@ release_on_stg(cstring, GPU_WAVE_LIMIT_TRACE, "", \ release(bool, OCL_CODE_CACHE_ENABLE, false, \ "1 = Enable compiler code cache") \ release(bool, OCL_CODE_CACHE_RESET, false, \ - "1 = Reset the compiler code cache storage") + "1 = Reset the compiler code cache storage") \ +release(bool, GPU_DISABLE_SDMA_MEMORY_TO_IMAGE, true, \ + "0 = Enable sDMA for Memory to Image and Image to Memory copies") namespace amd {