Disable host ptr tracking for GEN12LP

Related-To: NEO-3661

Change-Id: I1774aad8ef32f294192a9b679cb9f66e4091198c
Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
Pawel Wilma
2019-12-04 13:42:41 +01:00
committed by sys_ocldev
parent cd198fac0a
commit 632134db30
24 changed files with 68 additions and 24 deletions

View File

@@ -64,7 +64,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable EHL::workaroundTable = {};

View File

@@ -66,7 +66,8 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@@ -65,7 +65,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable LKF::workaroundTable = {};

View File

@@ -66,7 +66,8 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
false // hostPtrTrackingEnabled
};
WorkaroundTable TGLLP::workaroundTable = {};

View File

@@ -70,7 +70,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable BDW::workaroundTable = {};

View File

@@ -67,7 +67,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
false // supportsDeviceEnqueue
false, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable BXT::workaroundTable = {};

View File

@@ -62,7 +62,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable CFL::workaroundTable = {};

View File

@@ -62,7 +62,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
false // supportsDeviceEnqueue
false, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable GLK::workaroundTable = {};

View File

@@ -62,7 +62,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable KBL::workaroundTable = {};

View File

@@ -70,7 +70,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true // supportsDeviceEnqueue
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
};
WorkaroundTable SKL::workaroundTable = {};
FeatureTable SKL::featureTable = {};

View File

@@ -283,7 +283,7 @@ Buffer *Buffer::create(Context *context,
if (memoryProperties.flags.useHostPtr) {
if (!zeroCopyAllowed && !isHostPtrSVM) {
AllocationProperties properties{rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false};
AllocationProperties properties{rootDeviceIndex, false, size, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false};
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr);
}

View File

@@ -281,7 +281,7 @@ Image *Image::create(Context *context,
zeroCopy = true;
}
if (memory) {
AllocationProperties properties{rootDeviceIndex, false, hostPtrMinSize, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false};
AllocationProperties properties{rootDeviceIndex, false, hostPtrMinSize, GraphicsAllocation::AllocationType::MAP_ALLOCATION, false};
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = true;
mapAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, hostPtr);
}
@@ -380,7 +380,7 @@ Image *Image::create(Context *context,
} else {
errcodeRet = cmdQ->enqueueWriteImage(image, CL_TRUE, &copyOrigin[0], &copyRegion[0],
hostPtrRowPitch, hostPtrSlicePitch,
hostPtr, nullptr, 0, nullptr, nullptr);
hostPtr, mapAllocation, 0, nullptr, nullptr);
}
} else {
image->transferData(memory->getUnderlyingBuffer(), imgInfo.rowPitch, imgInfo.slicePitch,

View File

@@ -332,7 +332,8 @@ void *MemObj::getBasePtrForMap(uint32_t rootDeviceIndex) {
} else {
auto memory = memoryManager->allocateSystemMemory(getSize(), MemoryConstants::pageSize);
setAllocatedMapPtr(memory);
AllocationProperties properties{rootDeviceIndex, false, getSize(), GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR, false};
AllocationProperties properties{rootDeviceIndex, false, getSize(), GraphicsAllocation::AllocationType::MAP_ALLOCATION, false};
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, memory);
setMapAllocation(allocation);
return getAllocatedMapPtr();

View File

@@ -260,6 +260,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR:
case GraphicsAllocation::AllocationType::GLOBAL_SURFACE:
case GraphicsAllocation::AllocationType::IMAGE:
case GraphicsAllocation::AllocationType::MAP_ALLOCATION:
case GraphicsAllocation::AllocationType::PIPE:
case GraphicsAllocation::AllocationType::SHARED_BUFFER:
case GraphicsAllocation::AllocationType::SHARED_IMAGE:
@@ -278,6 +279,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
case GraphicsAllocation::AllocationType::DEVICE_QUEUE_BUFFER:
case GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR:
case GraphicsAllocation::AllocationType::FILL_PATTERN:
case GraphicsAllocation::AllocationType::MAP_ALLOCATION:
case GraphicsAllocation::AllocationType::MCS:
case GraphicsAllocation::AllocationType::PREEMPTION:
case GraphicsAllocation::AllocationType::PROFILING_TAG_BUFFER:
@@ -340,7 +342,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
return allocateGraphicsMemoryForImage(allocationData);
}
if (allocationData.type == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR &&
(!peekExecutionEnvironment().isFullRangeSvm() || !DebugManager.flags.EnableHostPtrTracking.get())) {
(!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled())) {
auto allocation = allocateGraphicsMemoryForNonSvmHostPtr(allocationData);
if (allocation) {
allocation->setFlushL3Required(allocationData.flags.flushL3);
@@ -485,4 +487,11 @@ void *MemoryManager::getReservedMemory(size_t size, size_t alignment) {
return reservedMemory;
}
bool MemoryManager::isHostPointerTrackingEnabled() {
if (DebugManager.flags.EnableHostPtrTracking.get() != -1) {
return !!DebugManager.flags.EnableHostPtrTracking.get();
}
return (peekExecutionEnvironment().getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit);
}
} // namespace NEO

View File

@@ -140,6 +140,8 @@ class MemoryManager {
::alignedFree(ptr);
}
MOCKABLE_VIRTUAL bool isHostPointerTrackingEnabled();
const ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, aub_stream::EngineType engineType,

View File

@@ -87,7 +87,7 @@ DECLARE_DEBUG_VARIABLE(bool, DisableConcurrentBlockExecution, false, "disables c
DECLARE_DEBUG_VARIABLE(bool, UseNoRingFlushesKmdMode, true, "Windows only, passes flag to KMD that informs KMD to not emit any ring buffer flushes.")
DECLARE_DEBUG_VARIABLE(bool, DisableZeroCopyForUseHostPtr, false, "When active all buffer allocations created with CL_MEM_USE_HOST_PTR flag will not share memory with CPU.")
DECLARE_DEBUG_VARIABLE(bool, DisableZeroCopyForBuffers, false, "When active all buffer allocations will not share memory with CPU.")
DECLARE_DEBUG_VARIABLE(bool, EnableHostPtrTracking, true, "Enable host ptr tracking")
DECLARE_DEBUG_VARIABLE(int32_t, EnableHostPtrTracking, -1, "Enable host ptr tracking: -1 - default platform setting, 0 - disabled, 1 - enabled")
DECLARE_DEBUG_VARIABLE(bool, DisableDcFlushInEpilogue, false, "Disable DC flush in epilogue")
/*FEATURE FLAGS*/

View File

@@ -143,7 +143,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(co
wddmAllocation->setDefaultGmm(gmm);
if (!createWddmAllocation(wddmAllocation.get(), wddmAllocation->getAlignedCpuPtr())) {
if (!createWddmAllocation(wddmAllocation.get(), nullptr)) {
delete gmm;
return nullptr;
}