fix: Use Rcs engine in blender on DG2

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2024-02-07 16:36:04 +00:00
committed by Compute-Runtime-Automation
parent 371788210d
commit ce17580b28
26 changed files with 102 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -72,6 +72,8 @@ class AILConfiguration {
virtual bool useLegacyValidationLogic() = 0;
virtual bool forceRcs() = 0;
protected:
virtual void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) = 0;
std::string processName;
@@ -81,6 +83,7 @@ class AILConfiguration {
};
extern const std::set<std::string_view> applicationsContextSyncFlag;
extern const std::set<std::string_view> applicationsForceRcsDg2;
template <PRODUCT_FAMILY product>
class AILConfigurationHw : public AILConfiguration {
@@ -96,6 +99,9 @@ class AILConfigurationHw : public AILConfiguration {
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override;
bool isContextSyncFlagRequired() override;
bool useLegacyValidationLogic() override;
bool forceRcs() override;
bool shouldForceRcs = false;
};
template <PRODUCT_FAMILY product>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Intel Corporation
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -50,4 +50,9 @@ inline bool AILConfigurationHw<product>::useLegacyValidationLogic() {
return false;
}
template <PRODUCT_FAMILY product>
inline bool AILConfigurationHw<product>::forceRcs() {
return shouldForceRcs;
}
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -26,6 +26,8 @@ std::map<std::string_view, std::vector<AILEnumeration>> applicationMap = {{"blen
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapMTL = {{"svchost", {AILEnumeration::disableDirectSubmission}}};
const std::set<std::string_view> applicationsForceRcsDg2 = {};
const std::set<std::string_view> applicationsContextSyncFlag = {};
AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -56,6 +56,14 @@ bool AILConfigurationHw<IGFX_DG2>::useLegacyValidationLogic() {
return it != applicationsLegacyValidationPathDg2.end() ? true : false;
}
template <>
inline void AILConfigurationHw<IGFX_DG2>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
auto search = applicationsForceRcsDg2.find(processName);
if (search != applicationsForceRcsDg2.end()) {
shouldForceRcs = true;
}
}
template class AILConfigurationHw<IGFX_DG2>;
} // namespace NEO

View File

@@ -44,6 +44,7 @@ struct PipeControlArgs;
struct KernelDescriptor;
class ProductHelper;
class GfxCoreHelper;
class AILConfiguration;
using EngineInstancesContainer = StackVec<EngineTypeUsage, 32>;
using GfxCoreHelperCreateFunctionType = std::unique_ptr<GfxCoreHelper> (*)();
@@ -61,7 +62,7 @@ class GfxCoreHelper {
virtual size_t getKernelIsaPointerAlignment() const = 0;
virtual uint32_t getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
virtual uint32_t getPitchAlignmentForImage(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) = 0;
virtual void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) = 0;
virtual SipKernelType getSipKernelType(bool debuggingActive) const = 0;
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
virtual bool is1MbAlignmentSupported(const HardwareInfo &hwInfo, bool isCompressionEnabled) const = 0;
@@ -237,7 +238,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
uint32_t getPitchAlignmentForImage(const RootDeviceEnvironment &rootDeviceEnvironment) const override;
void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) override;
void adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) override;
SipKernelType getSipKernelType(bool debuggingActive) const override;

View File

@@ -13,7 +13,7 @@
namespace NEO {
template <typename GfxFamily>
void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) {
}
template <typename GfxFamily>

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/source/aub/aub_helper.h"
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/command_container/implicit_scaling.h"
@@ -64,14 +65,15 @@ const EngineInstancesContainer GfxCoreHelperHw<GfxFamily>::getGpgpuEngineInstanc
EngineInstancesContainer engines;
if (hwInfo.featureTable.flags.ftrCCSNode) {
if (hwInfo.featureTable.flags.ftrCCSNode && !rootDeviceEnvironment.getAILConfigurationHelper()->forceRcs()) {
for (uint32_t i = 0; i < hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled; i++) {
engines.push_back({static_cast<aub_stream::EngineType>(i + aub_stream::ENGINE_CCS), EngineUsage::regular});
}
}
if ((debugManager.flags.NodeOrdinal.get() == static_cast<int32_t>(aub_stream::EngineType::ENGINE_RCS)) ||
hwInfo.featureTable.flags.ftrRcsNode) {
hwInfo.featureTable.flags.ftrRcsNode ||
rootDeviceEnvironment.getAILConfigurationHelper()->forceRcs()) {
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::regular});
}

View File

@@ -149,7 +149,7 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
outHwInfo->capabilityTable.ftrSupportsCoherency = false;
gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this);
gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this, rootDeviceEnvironment.ailConfiguration.get());
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
drm->checkQueueSliceSupport();

View File

@@ -23,7 +23,7 @@ int ProductHelper::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInf
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.flags.ftrSVM;
gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this);
gfxCoreHelper.adjustDefaultEngineType(outHwInfo, *this, rootDeviceEnvironment.ailConfiguration.get());
outHwInfo->capabilityTable.defaultEngineType = getChosenEngineType(*outHwInfo);
this->setCapabilityCoherencyFlag(*outHwInfo, outHwInfo->capabilityTable.ftrSupportsCoherency);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -111,7 +111,7 @@ EngineGroupType GfxCoreHelperHw<Family>::getEngineGroupType(aub_stream::EngineTy
}
template <>
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) {
if (!pHwInfo->featureTable.flags.ftrCCSNode) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::EngineType::ENGINE_CCCS;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -47,11 +47,11 @@ uint32_t GfxCoreHelperHw<Family>::getMetricsLibraryGenId() const {
}
template <>
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
void GfxCoreHelperHw<Family>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper, AILConfiguration *ailConfiguration) {
if (!pHwInfo->featureTable.flags.ftrCCSNode) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
}
if (productHelper.isDefaultEngineTypeAdjustmentRequired(*pHwInfo)) {
if (productHelper.isDefaultEngineTypeAdjustmentRequired(*pHwInfo) || (ailConfiguration && ailConfiguration->forceRcs())) {
pHwInfo->capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
}
}