fix: disable deferring MOCS on WSL for LNL

Related-To: NEO-14643

Source: e376e738f3

Signed-off-by: Tomasz Biernacik <tomasz.biernacik@intel.com>
This commit is contained in:
Tomasz Biernacik 2025-05-14 13:51:18 +00:00 committed by Compute-Runtime-Automation
parent eecf0b8617
commit 491be40cbc
17 changed files with 47 additions and 13 deletions

View File

@ -72,7 +72,7 @@ XE2_HPG_CORETEST_F(BlitXe2HpgCoreTests, givenBufferWhenProgrammingBltCommandThen
ASSERT_NE(hwParser.cmdList.end(), itorBltCmd);
MEM_COPY *bltCmd = (MEM_COPY *)*itorBltCmd;
if (clDevice->getProductHelper().deferMOCSToPatIndex()) {
if (clDevice->getProductHelper().deferMOCSToPatIndex(clDevice->getRootDeviceEnvironment().isWddmOnLinux())) {
EXPECT_EQ(0u, bltCmd->getDestinationMOCS());
EXPECT_EQ(0u, bltCmd->getSourceMOCS());
} else {

View File

@ -73,7 +73,7 @@ XE3_CORETEST_F(BlitXe3CoreTests, givenBufferWhenProgrammingBltCommandThenSetMocs
ASSERT_NE(hwParser.cmdList.end(), itorBltCmd);
MEM_COPY *bltCmd = (MEM_COPY *)*itorBltCmd;
if (clDevice->getProductHelper().deferMOCSToPatIndex()) {
if (clDevice->getProductHelper().deferMOCSToPatIndex(clDevice->getRootDeviceEnvironment().isWddmOnLinux())) {
EXPECT_EQ(0u, bltCmd->getDestinationMOCS());
EXPECT_EQ(0u, bltCmd->getSourceMOCS());
} else {

View File

@ -44,7 +44,7 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const {
type = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
}
if (this->rootDeviceEnvironment.getProductHelper().deferMOCSToPatIndex()) {
if (this->rootDeviceEnvironment.getProductHelper().deferMOCSToPatIndex(this->rootDeviceEnvironment.isWddmOnLinux())) {
return 0u;
}

View File

@ -245,7 +245,7 @@ class ProductHelper {
virtual std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const = 0;
virtual bool isCachingOnCpuAvailable() const = 0;
virtual bool isNewCoherencyModelSupported() const = 0;
virtual bool deferMOCSToPatIndex() const = 0;
virtual bool deferMOCSToPatIndex(bool isWddmOnLinux) const = 0;
virtual const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const = 0;
virtual uint32_t getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const = 0;

View File

@ -15,7 +15,7 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex() const {
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
return false;
}

View File

@ -183,7 +183,7 @@ class ProductHelperHw : public ProductHelper {
std::optional<GfxMemoryAllocationMethod> getPreferredAllocationMethod(AllocationType allocationType) const override;
bool isCachingOnCpuAvailable() const override;
bool isNewCoherencyModelSupported() const override;
bool deferMOCSToPatIndex() const override;
bool deferMOCSToPatIndex(bool isWddmOnLinux) const override;
bool supportReadOnlyAllocations() const override;
const std::vector<uint32_t> getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const override;
uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const override;

View File

@ -15,7 +15,7 @@ bool ProductHelperHw<gfxProduct>::useGemCreateExtInAllocateMemoryByKMD() const {
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex() const {
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
return true;
}

View File

@ -34,5 +34,10 @@ bool ProductHelperHw<gfxProduct>::isDisableScratchPagesSupported() const {
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
return !isWddmOnLinux;
}
template class ProductHelperHw<gfxProduct>;
} // namespace NEO

View File

@ -184,7 +184,7 @@ bool ProductHelperHw<IGFX_UNKNOWN>::isNewResidencyModelSupported() const {
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::deferMOCSToPatIndex() const {
bool ProductHelperHw<IGFX_UNKNOWN>::deferMOCSToPatIndex(bool isWddmOnLinux) const {
return false;
}

View File

@ -1226,8 +1226,9 @@ TEST(GmmHelperTest, givenNewCoherencyModelWhenGetMocsThenDeferToPat) {
GmmHelper::createGmmContextWrapperFunc = GmmClientContext::create<MockGmmClientContext>;
MockExecutionEnvironment executionEnvironment{};
auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper();
if (!executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().deferMOCSToPatIndex()) {
auto &rootDeviceEnvironment = executionEnvironment.rootDeviceEnvironments[0];
auto gmmHelper = rootDeviceEnvironment->getGmmHelper();
if (!rootDeviceEnvironment->getProductHelper().deferMOCSToPatIndex(rootDeviceEnvironment->isWddmOnLinux())) {
GTEST_SKIP();
}

View File

@ -86,3 +86,8 @@ BMGTEST_F(BmgProductHelperLinux, WhenGtIsSetupThenGtSystemInfoIsCorrect) {
EXPECT_GT(gtSystemInfo.DualSubSliceCount, 0u);
EXPECT_GT(gtSystemInfo.MaxDualSubSlicesSupported, 0u);
}
BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(true));
}

View File

@ -128,3 +128,7 @@ BMGTEST_F(BmgProductHelper, whenAdjustScratchSizeThenSizeIsDoubled) {
productHelper->adjustScratchSize(scratchSize);
EXPECT_EQ(initialScratchSize * 2, scratchSize);
}
BMGTEST_F(BmgProductHelper, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true));
}

View File

@ -702,7 +702,7 @@ XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenProductHelperWhenCallIsNewC
XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenProductHelperWhenCallDeferMOCSToPatThenTrueIsReturned) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_TRUE(productHelper.deferMOCSToPatIndex());
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(false));
}
XE2_HPG_CORETEST_F(ProductHelperTestXe2HpgCore, givenPatIndexWhenCheckIsCoherentAllocationThenReturnProperValue) {

View File

@ -64,6 +64,11 @@ LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenCheckIsCopyBufferRectSpli
EXPECT_TRUE(productHelper->isCopyBufferRectSplitSupported());
}
LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenFalseIsReturned) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(true));
}
using LnlHwInfoLinux = ::testing::Test;
LNLTEST_F(LnlHwInfoLinux, WhenGtIsSetupThenGtSystemInfoIsCorrect) {

View File

@ -89,3 +89,7 @@ LNLTEST_F(LnlProductHelperWindows, givenOverrideDirectSubmissionTimeoutsCalledTh
EXPECT_EQ(timeout.count(), 2'000);
EXPECT_EQ(maxTimeout.count(), 3'000);
}
LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
EXPECT_TRUE(productHelper->deferMOCSToPatIndex(true));
}

View File

@ -702,7 +702,12 @@ XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenAskingForGlobalFe
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenCallDeferMOCSToPatThenTrueIsReturned) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_TRUE(productHelper.deferMOCSToPatIndex());
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(false));
}
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenTrueIsReturned) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_TRUE(productHelper.deferMOCSToPatIndex(true));
}
XE3_CORETEST_F(ProductHelperTestXe3Core, givenProductHelperWhenAskingForCooperativeEngineSupportThenReturnFalse) {

View File

@ -360,7 +360,12 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallIsNewCoherencyModel
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallDeferMOCSToPatThenFalseIsReturned, IsXeLpg) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_FALSE(productHelper.deferMOCSToPatIndex());
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(false));
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallDeferMOCSToPatOnWSLThenFalseIsReturned, IsXeLpg) {
const auto &productHelper = getHelper<ProductHelper>();
EXPECT_FALSE(productHelper.deferMOCSToPatIndex(true));
}
HWTEST2_F(XeLpgProductHelperTests, givenPatIndexWhenCheckIsCoherentAllocationThenReturnProperValue, IsXeLpg) {