fix: Defer MOCS to PAT

Related-To: NEO-10556

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-05-27 09:27:22 +00:00
committed by Compute-Runtime-Automation
parent a787686ac5
commit a9269939f6
14 changed files with 93 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
#include "shared/source/command_stream/csr_definitions.h"
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/command_stream/stream_properties.h"
#include "shared/source/gmm_helper/cache_settings_helper.h"
#include "shared/source/helpers/blit_properties_container.h"
#include "shared/source/helpers/cache_policy.h"
#include "shared/source/helpers/common_types.h"
@@ -600,7 +601,7 @@ class CommandStreamReceiver {
std::chrono::microseconds gpuHangCheckPeriod{500'000};
uint32_t lastSentL3Config = 0;
uint32_t latestSentStatelessMocsConfig = 0;
uint32_t latestSentStatelessMocsConfig = CacheSettings::unknownMocs;
uint64_t lastSentSliceCount = QueueSliceCount::defaultSliceCount;
uint32_t requiredScratchSlot0Size = 0;

View File

@@ -9,7 +9,7 @@
#include "shared/source/gmm_helper/gmm_lib.h"
namespace CacheSettings {
inline constexpr uint32_t unknownMocs = GMM_RESOURCE_USAGE_UNKNOWN;
inline constexpr uint32_t unknownMocs = -1;
} // namespace CacheSettings
namespace NEO {

View File

@@ -15,6 +15,7 @@
#include "shared/source/helpers/gfx_core_helper.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/os_interface/product_helper.h"
#include <algorithm>
@@ -37,6 +38,10 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const {
type = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
}
if (this->deferMOCSToPatIndex()) {
return 0u;
}
MEMORY_OBJECT_CONTROL_STATE mocs = gmmClientContext->cachePolicyGetMemoryObject(nullptr, static_cast<GMM_RESOURCE_USAGE_TYPE>(type));
return static_cast<uint32_t>(mocs.DwordValue);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -33,6 +33,7 @@ class GmmHelper {
void setAddressWidth(uint32_t width) { addressWidth = width; };
bool isValidCanonicalGpuAddress(uint64_t address);
bool deferMOCSToPatIndex() const;
GmmClientContext *getClientContext() const;

View File

@@ -45,6 +45,7 @@ set(NEO_CORE_OS_INTERFACE_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/drm_wrappers.h
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_drm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/file_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id.h
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id_linux.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kmd_notify_properties_linux.cpp

View File

@@ -0,0 +1,14 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gmm_helper/gmm_helper.h"
namespace NEO {
bool GmmHelper::deferMOCSToPatIndex() const {
return false;
}
} // namespace NEO

View File

@@ -69,6 +69,7 @@ set(NEO_CORE_OS_INTERFACE_WDDM
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_logging.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gdi_interface_logging.h
${CMAKE_CURRENT_SOURCE_DIR}/gdi_profiling.h
${CMAKE_CURRENT_SOURCE_DIR}/gmm_helper_win.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id_win.cpp
${CMAKE_CURRENT_SOURCE_DIR}/hw_device_id.h
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_wddm.cpp

View File

@@ -0,0 +1,16 @@
/*
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/os_interface/product_helper.h"
namespace NEO {
bool GmmHelper::deferMOCSToPatIndex() const {
return this->rootDeviceEnvironment.getProductHelper().isNewCoherencyModelSupported();
}
} // namespace NEO

View File

@@ -447,6 +447,10 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(co
GmmRequirements gmmRequirements{};
gmmRequirements.allowLargePages = true;
gmmRequirements.preferCompressed = false;
if (productHelper.overrideAllocationCacheable(allocationData)) {
gmmRequirements.overriderCacheable.enableOverride = true;
gmmRequirements.overriderCacheable.value = true;
}
auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), alignedPtr, alignedSize, 0u,
CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), {}, gmmRequirements);