Fix(L0Debug): Fix thread creation on dg2 128EU

Not enough EUThread objects were being created
resulting in a crash during breeakpoint
processing

Related-to: LOCI-3937

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
This commit is contained in:
Yates, Brandon
2023-01-27 21:01:48 +00:00
committed by Compute-Runtime-Automation
parent 78cb79912c
commit f53d9103ad
2 changed files with 24 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ void DebugSession::createEuThreads() {
tileIndex = Math::log2(static_cast<uint32_t>(connectedDevice->getNEODevice()->getDeviceBitfield().to_ulong()));
}
for (uint32_t sliceID = 0; sliceID < hwInfo.gtSystemInfo.MaxSlicesSupported; sliceID++) {
for (uint32_t sliceID = 0; sliceID < NEO::GfxCoreHelper::getHighestEnabledSlice(hwInfo); sliceID++) {
for (uint32_t subsliceID = 0; subsliceID < numSubslicesPerSlice; subsliceID++) {
for (uint32_t euID = 0; euID < numEuPerSubslice; euID++) {

View File

@@ -30,6 +30,29 @@ namespace ult {
using DebugSessionTest = ::testing::Test;
TEST(DeviceWithDebugSessionTest, GivenSlicesEnabledWithEarlierSlicesDisabledThenAllThreadsIsPopulatedCorrectly) {
auto hwInfo = *NEO::defaultHwInfo;
hwInfo.gtSystemInfo.MaxSlicesSupported = 2;
hwInfo.gtSystemInfo.MaxEuPerSubSlice = 8;
hwInfo.gtSystemInfo.MaxSubSlicesSupported = 64;
hwInfo.gtSystemInfo.MaxDualSubSlicesSupported = 32;
hwInfo.gtSystemInfo.IsDynamicallyPopulated = true;
hwInfo.gtSystemInfo.MaxSlicesSupported = 2;
for (int i = 0; i < GT_MAX_SLICE; i++) {
hwInfo.gtSystemInfo.SliceInfo[i].Enabled = false;
}
hwInfo.gtSystemInfo.SliceInfo[2].Enabled = true;
hwInfo.gtSystemInfo.SliceInfo[3].Enabled = true;
NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
Mock<L0::DeviceImp> deviceImp(neoDevice, neoDevice->getExecutionEnvironment());
auto sessionMock = std::make_unique<MockDebugSession>(zet_debug_config_t{0x1234}, &deviceImp);
const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxDualSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported;
EXPECT_EQ(1u, sessionMock->allThreads.count(EuThread::ThreadId(0, 0, numSubslicesPerSlice - 1, 0, 0)));
EXPECT_EQ(1u, sessionMock->allThreads.count(EuThread::ThreadId(0, 1, numSubslicesPerSlice - 1, 7, 0)));
EXPECT_EQ(1u, sessionMock->allThreads.count(EuThread::ThreadId(0, 2, numSubslicesPerSlice - 1, 0, 0)));
}
TEST(DeviceWithDebugSessionTest, GivenDeviceWithDebugSessionWhenCallingReleaseResourcesThenCloseConnectionIsCalled) {
ze_result_t returnValue = ZE_RESULT_SUCCESS;
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);