From 465e4b302e41d003ddecb844cc275eb59289ac13 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 15 Nov 2019 12:27:42 -0500
Subject: [PATCH] P4 to Git Change 2031436 by gandryey@gera-win10 on 2019/11/15
12:23:57
SWDEV-79445 - OCL generic changes and code clean-up
- Disable SDMA and use 32KB LDS for VanGoghLite
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#105 edit
---
rocclr/runtime/device/pal/palsettings.cpp | 25 ++++++++++++++---------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/rocclr/runtime/device/pal/palsettings.cpp b/rocclr/runtime/device/pal/palsettings.cpp
index 156dfe7808..03ffb41e2f 100644
--- a/rocclr/runtime/device/pal/palsettings.cpp
+++ b/rocclr/runtime/device/pal/palsettings.cpp
@@ -150,7 +150,7 @@ Settings::Settings() {
lcWavefrontSize64_ = true;
enableHwP2P_ = false;
imageBufferWar_ = false;
- disableSdma_ = PAL_DISABLE_SDMA;
+ disableSdma_ = false;
mallPolicy_ = 0;
alwaysResident_ = amd::IS_HIP ? true : false;
}
@@ -207,6 +207,12 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
// GFX10.1 HW doesn't support custom pitch. Enable double copy workaround
imageBufferWar_ = GPU_IMAGE_BUFFER_WAR;
}
+ if (false) {
+ // UnknownDevice0 HW doesn't have SDMA engine
+ disableSdma_ = true;
+ // And LDS is limited to 32KB
+ hwLDSSize_ = 32 * Ki;
+ }
// Fall through to AI (gfx9) ...
case Pal::AsicRevision::Vega20:
// Enable HW P2P path for Vega20+. Runtime still relies on KMD/PAL for support
@@ -387,7 +393,10 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
enableExtension(ClAMDLiquidFlash);
}
- hwLDSSize_ = (IS_LINUX || gfx10Plus_) ? 64 * Ki : 32 * Ki;
+ if (hwLDSSize_ == 0) {
+ // Use hardcoded values for now, since PAL properties aren't available with offline devices
+ hwLDSSize_ = (IS_LINUX || gfx10Plus_) ? 64 * Ki: 32 * Ki;
+ }
imageSupport_ = true;
@@ -415,14 +424,6 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
// Enable bus addressable memory extension
enableExtension(ClAMDBusAddressableMemory);
}
- //! @todo
- /*
- if (calAttr.longIdleDetect) {
- // KMD is unable to detect if we map the visible memory for CPU access, so
- // accessing persistent staged buffer may fail if LongIdleDetct is enabled.
- disablePersistent_ = true;
- }
- */
svmFineGrainSystem_ = palProp.gpuMemoryProperties.flags.iommuv2Support;
svmAtomics_ = svmFineGrainSystem_;
@@ -550,6 +551,10 @@ void Settings::override() {
if (!flagIsDefault(PAL_ALWAYS_RESIDENT)) {
alwaysResident_ = PAL_ALWAYS_RESIDENT;
}
+
+ if (!flagIsDefault(PAL_DISABLE_SDMA)) {
+ disableSdma_ = PAL_DISABLE_SDMA;
+ }
}
} // namespace pal