Add ForceAllResourcesUncached debug variable

Resolves: NEO-6563

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2022-02-21 13:33:41 +00:00
committed by Compute-Runtime-Automation
parent faba32daf0
commit 086a70ca52
12 changed files with 75 additions and 17 deletions

View File

@@ -406,6 +406,7 @@ DECLARE_DEBUG_VARIABLE(bool, SkipFlushingEventsOnGetStatusCalls, false, "When se
DECLARE_DEBUG_VARIABLE(bool, AllowUnrestrictedSize, false, "Allow allocating memory with greater size than MAX_MEM_ALLOC_SIZE")
DECLARE_DEBUG_VARIABLE(int32_t, ProgramExtendedPipeControlPriorToNonPipelinedStateCommand, -1, "-1: default, 0: disable, 1: enable, Program additional extended version of PIPE CONTROL command before non pipelined state command")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideDrmRegion, -1, "-1: disable, 0+: override to given memory region for all allocations")
DECLARE_DEBUG_VARIABLE(bool, ForceAllResourcesUncached, false, "When set, all memory operations ifor all resources are forced to UC. This overrides all caching-related debug variables and globally disables all caches")
/* Binary Cache */
DECLARE_DEBUG_VARIABLE(bool, BinaryCacheTrace, false, "enable cl_cache to produce .trace files with information about hash computation")

View File

@@ -220,7 +220,7 @@ bool Device::createDeviceImpl() {
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (getDebugger() && hwHelper.disableL3CacheForDebug(hwInfo)) {
getGmmHelper()->disableL3CacheForDebug();
getGmmHelper()->forceAllResourcesUncached();
}
if (!createEngines()) {

View File

@@ -376,5 +376,9 @@ void Gmm::applyDebugOverrides() {
if (-1 != DebugManager.flags.OverrideGmmResourceUsageField.get()) {
resourceParams.Usage = static_cast<GMM_RESOURCE_USAGE_TYPE>(DebugManager.flags.OverrideGmmResourceUsageField.get());
}
if (true == (DebugManager.flags.ForceAllResourcesUncached.get())) {
resourceParams.Usage = GMM_RESOURCE_USAGE_SURFACE_UNCACHED;
}
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Intel Corporation
* Copyright (C) 2019-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -30,7 +30,7 @@ const HardwareInfo *GmmHelper::getHardwareInfo() {
}
uint32_t GmmHelper::getMOCS(uint32_t type) const {
if (l3CacheForDebugDisabled) {
if (allResourcesUncached || (DebugManager.flags.ForceAllResourcesUncached.get() == true)) {
type = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -23,7 +23,7 @@ class GmmHelper {
const HardwareInfo *getHardwareInfo();
uint32_t getMOCS(uint32_t type) const;
void disableL3CacheForDebug() { l3CacheForDebugDisabled = true; };
void forceAllResourcesUncached() { allResourcesUncached = true; };
static constexpr uint64_t maxPossiblePitch = (1ull << 31);
@@ -45,6 +45,6 @@ class GmmHelper {
static uint32_t addressWidth;
const HardwareInfo *hwInfo = nullptr;
std::unique_ptr<GmmClientContext> gmmClientContext;
bool l3CacheForDebugDisabled = false;
bool allResourcesUncached = false;
};
} // namespace NEO

View File

@@ -27,9 +27,13 @@ namespace ClosHelper {
7 2 WB (11)
*/
constexpr uint64_t getPatIndex(CacheRegion closIndex, CachePolicy memType) {
UNRECOVERABLE_IF((closIndex > CacheRegion::Default) && (memType < CachePolicy::WriteThrough));
static inline uint64_t getPatIndex(CacheRegion closIndex, CachePolicy memType) {
if ((DebugManager.flags.ForceAllResourcesUncached.get() == true)) {
closIndex = CacheRegion::Default;
memType = CachePolicy::Uncached;
}
UNRECOVERABLE_IF((closIndex > CacheRegion::Default) && (memType < CachePolicy::WriteThrough));
return (static_cast<uint32_t>(memType) + (static_cast<uint16_t>(closIndex) * 2));
}
} // namespace ClosHelper

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,6 +11,6 @@
namespace NEO {
struct MockGmmHelper : GmmHelper {
using GmmHelper::addressWidth;
using GmmHelper::l3CacheForDebugDisabled;
using GmmHelper::allResourcesUncached;
};
} // namespace NEO