Skip to content

Commit a955eac

Browse files
Disable L3 cache for debug surface
Related-To: NEO-5783 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
1 parent 2c770ba commit a955eac

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

level_zero/core/source/cmdlist/cmdlist_hw_base.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
128128
auto *ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE);
129129
auto surfaceState = neoDevice->getDebugger()->getDebugSurfaceReservedSurfaceState(*ssh);
130130
auto debugSurface = device->getDebugSurface();
131-
auto mocs = device->getMOCS(true, false);
131+
auto mocs = device->getMOCS(false, false);
132132
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(surfaceState, debugSurface->getGpuAddress(),
133133
debugSurface->getUnderlyingBufferSize(), mocs,
134134
false, false, false, neoDevice->getNumAvailableDevices(),

level_zero/core/source/cmdlist/cmdlist_hw_xehp_plus.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(z
193193
auto *ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE);
194194
auto surfaceState = neoDevice->getDebugger()->getDebugSurfaceReservedSurfaceState(*ssh);
195195
auto debugSurface = device->getDebugSurface();
196-
auto mocs = device->getMOCS(true, false);
196+
auto mocs = device->getMOCS(false, false);
197197
NEO::EncodeSurfaceState<GfxFamily>::encodeBuffer(surfaceState, debugSurface->getGpuAddress(),
198198
debugSurface->getUnderlyingBufferSize(), mocs,
199199
false, false, false, neoDevice->getNumAvailableDevices(),

level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,27 @@ HWTEST_F(L0DebuggerTest, givenDebuggerWhenAppendingKernelToCommandListThenBindle
415415
EXPECT_EQ(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT, debugSurfaceState->getCoherencyType());
416416
}
417417

418+
HWTEST_F(L0DebuggerTest, givenDebuggerWhenAppendingKernelToCommandListThenDebugSurfaceiIsProgrammedWithL3DisabledMOCS) {
419+
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
420+
421+
Mock<::L0::Kernel> kernel;
422+
ze_result_t returnValue;
423+
std::unique_ptr<L0::CommandList> commandList(L0::CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue));
424+
ze_group_count_t groupCount{1, 1, 1};
425+
auto result = commandList->appendLaunchKernel(kernel.toHandle(), &groupCount, nullptr, 0, nullptr);
426+
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
427+
428+
commandList->close();
429+
430+
auto *ssh = commandList->commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE);
431+
auto debugSurfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(ssh->getCpuBase());
432+
433+
const auto mocsNoCache = device->getNEODevice()->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
434+
const auto actualMocs = debugSurfaceState->getMemoryObjectControlState();
435+
436+
EXPECT_EQ(actualMocs, mocsNoCache);
437+
}
438+
418439
using IsSklOrAbove = IsAtLeastProduct<IGFX_SKYLAKE>;
419440
HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenSbaBufferIsPushedToResidencyContainer, IsSklOrAbove) {
420441
ze_command_queue_desc_t queueDesc = {};

0 commit comments

Comments
 (0)