diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 22acf6c8c4..154d60316e 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -215,3 +215,10 @@ bool HwInfoConfigHw::isStorageInfoAdjustmentRequired() const { return false; } } + +void adjustRcsExposure(HardwareInfo *hwInfo) { + hwInfo->featureTable.flags.ftrRcsNode = false; + if (DebugManager.flags.NodeOrdinal.get() == static_cast(aub_stream::EngineType::ENGINE_RCS)) { + hwInfo->featureTable.flags.ftrRcsNode = true; + } +} diff --git a/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp b/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp index e4c69eba3b..b9147fbbd7 100644 --- a/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp +++ b/shared/source/xe_hpg_core/linux/hw_info_config_dg2.cpp @@ -35,6 +35,8 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS DG2::adjustHardwareInfo(hwInfo); enableBlitterOperationsSupport(hwInfo); + adjustRcsExposure(hwInfo); + auto &kmdNotifyProperties = hwInfo->capabilityTable.kmdNotifyProperties; kmdNotifyProperties.enableKmdNotify = true; kmdNotifyProperties.delayKmdNotifyMicroseconds = 150; diff --git a/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp b/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp index d6c4c9cf29..a47392af05 100644 --- a/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp +++ b/shared/source/xe_hpg_core/windows/hw_info_config_dg2.cpp @@ -33,6 +33,8 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OS DG2::adjustHardwareInfo(hwInfo); enableBlitterOperationsSupport(hwInfo); + adjustRcsExposure(hwInfo); + return 0; } diff --git a/shared/test/unit_test/xe_hpg_core/dg2/hw_helper_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/hw_helper_tests_dg2.cpp index 8b8d84a7b8..65427a9888 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/hw_helper_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/hw_helper_tests_dg2.cpp @@ -7,8 +7,10 @@ #include "shared/source/helpers/hw_helper.h" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" +#include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/gtest_helpers.h" +#include "shared/test/common/helpers/hw_helper_tests.h" #include "shared/test/common/mocks/ult_device_factory.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" @@ -24,3 +26,59 @@ DG2TEST_F(HwHelperTestDg2, whenGetExtensionsIsCalledThenMatrixMultiplyAccumulate EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate"))); EXPECT_TRUE(hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate"))); } + +DG2TEST_F(HwHelperTestDg2, givenRcsDisabledWhenGetGpgpuEnginesCalledThenDontSetRcs) { + HardwareInfo hwInfo = *defaultHwInfo; + auto hwInfoConfig = HwInfoConfig::get(productFamily); + hwInfo.featureTable.flags.ftrCCSNode = true; + hwInfo.featureTable.ftrBcsInfo = 1; + hwInfo.featureTable.flags.ftrRcsNode = true; + hwInfo.capabilityTable.blitterOperationsSupported = true; + hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; + hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4; + hwInfoConfig->configureHardwareCustom(&hwInfo, nullptr); + + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + + EXPECT_EQ(8u, device->allEngines.size()); + auto &engines = HwHelperHw::get().getGpgpuEngineInstances(hwInfo); + EXPECT_EQ(8u, engines.size()); + + EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first); + EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first); + EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first); + EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first); + EXPECT_EQ(aub_stream::ENGINE_CCS, engines[4].first); + EXPECT_EQ(aub_stream::ENGINE_CCS, engines[5].first); + EXPECT_EQ(aub_stream::ENGINE_BCS, engines[6].first); + EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first); +} + +DG2TEST_F(HwHelperTestDg2, givenRcsDisabledButDebugVariableSetWhenGetGpgpuEnginesCalledThenSetRcs) { + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.featureTable.flags.ftrCCSNode = true; + hwInfo.featureTable.ftrBcsInfo = 1; + hwInfo.featureTable.flags.ftrRcsNode = false; + hwInfo.capabilityTable.blitterOperationsSupported = true; + hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS; + hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 4; + + DebugManagerStateRestore restore; + DebugManager.flags.NodeOrdinal.set(static_cast(aub_stream::EngineType::ENGINE_RCS)); + + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + + EXPECT_EQ(9u, device->allEngines.size()); + auto &engines = HwHelperHw::get().getGpgpuEngineInstances(hwInfo); + EXPECT_EQ(9u, engines.size()); + + EXPECT_EQ(aub_stream::ENGINE_CCS, engines[0].first); + EXPECT_EQ(aub_stream::ENGINE_CCS1, engines[1].first); + EXPECT_EQ(aub_stream::ENGINE_CCS2, engines[2].first); + EXPECT_EQ(aub_stream::ENGINE_CCS3, engines[3].first); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[4].first); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[5].first); + EXPECT_EQ(aub_stream::ENGINE_RCS, engines[6].first); + EXPECT_EQ(aub_stream::ENGINE_BCS, engines[7].first); + EXPECT_EQ(aub_stream::ENGINE_BCS, engines[8].first); +}