Skip to content

Commit d70b1a2

Browse files
bmyatesCompute-Runtime-Automation
authored andcommitted
Filter L0 Debugger support by platfom
Related-To: NEO-6678 Signed-off-by: Brandon Yates <[email protected]>
1 parent 489dd4d commit d70b1a2

File tree

22 files changed

+70
-20
lines changed

22 files changed

+70
-20
lines changed

level_zero/core/source/device/device_imp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,11 @@ ze_result_t DeviceImp::getDebugProperties(zet_device_debug_properties_t *pDebugP
730730
isDebugAttachAvailable = false;
731731
}
732732

733+
auto &hwInfo = neoDevice->getHardwareInfo();
734+
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
735+
isDebugAttachAvailable = false;
736+
}
737+
733738
if (isDebugAttachAvailable && !isSubdevice) {
734739
pDebugProperties->flags = zet_device_debug_property_flag_t::ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH;
735740
} else {

level_zero/core/source/dll/linux/debugger_l0_linux.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2021 Intel Corporation
2+
* Copyright (C) 2020-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -13,6 +13,10 @@
1313

1414
namespace L0 {
1515
std::unique_ptr<NEO::Debugger> DebuggerL0::create(NEO::Device *device) {
16+
auto &hwInfo = device->getHardwareInfo();
17+
if (!hwInfo.capabilityTable.l0DebuggerSupported) {
18+
return nullptr;
19+
}
1620
auto success = initDebuggingInOs(device->getRootDeviceEnvironment().osInterface.get());
1721
if (success) {
1822
auto debugger = debuggerL0Factory[device->getHardwareInfo().platform.eRenderCoreFamily](device);

level_zero/tools/test/unit_tests/sources/debug/test_debug_api.inl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -63,7 +63,8 @@ TEST_F(DebugApiTest, givenSubDeviceWhenCallingDebugAttachThenErrorIsReturned) {
6363
EXPECT_EQ(nullptr, debugSession);
6464
}
6565

66-
TEST_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesReturnsCorrectFlag) {
66+
using isDebugSupportedProduct = IsWithinProducts<IGFX_DG1, IGFX_PVC>;
67+
HWTEST2_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesReturnsCorrectFlag, isDebugSupportedProduct) {
6768
zet_device_debug_properties_t debugProperties = {};
6869
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;
6970

@@ -75,6 +76,19 @@ TEST_F(DebugApiTest, givenDeviceWhenDebugAttachIsAvaialbleThenGetPropertiesRetur
7576
EXPECT_EQ(ZET_DEVICE_DEBUG_PROPERTY_FLAG_ATTACH, debugProperties.flags);
7677
}
7778

79+
using isDebugNotSupportedProduct = IsNotWithinProducts<IGFX_DG1, IGFX_PVC>;
80+
HWTEST2_F(DebugApiTest, givenDeviceWhenDebugIsNotSupportedThenGetPropertiesReturnsCorrectFlag, isDebugNotSupportedProduct) {
81+
zet_device_debug_properties_t debugProperties = {};
82+
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;
83+
84+
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new OsInterfaceWithDebugAttach);
85+
86+
auto result = zetDeviceGetDebugProperties(device->toHandle(), &debugProperties);
87+
88+
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
89+
EXPECT_EQ(0u, debugProperties.flags);
90+
}
91+
7892
TEST_F(DebugApiTest, givenStateSaveAreaHeaderUnavailableWhenGettingDebugPropertiesThenAttachFlagIsNotReturned) {
7993
zet_device_debug_properties_t debugProperties = {};
8094
debugProperties.flags = ZET_DEVICE_DEBUG_PROPERTY_FLAG_FORCE_UINT32;

shared/source/gen11/hw_info_ehl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{
8282
true, // supportsMediaBlock
8383
false, // p2pAccessSupported
8484
false, // p2pAtomicAccessSupported
85-
false // fusedEuEnabled
85+
false, // fusedEuEnabled
86+
false // l0DebuggerSupported;
8687
};
8788

8889
WorkaroundTable EHL::workaroundTable = {};

shared/source/gen11/hw_info_icllp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
8383
true, // supportsMediaBlock
8484
false, // p2pAccessSupported
8585
false, // p2pAtomicAccessSupported
86-
false // fusedEuEnabled
86+
false, // fusedEuEnabled
87+
false // l0DebuggerSupported;
8788
};
8889

8990
WorkaroundTable ICLLP::workaroundTable = {};

shared/source/gen11/hw_info_lkf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{
8282
true, // supportsMediaBlock
8383
false, // p2pAccessSupported
8484
false, // p2pAtomicAccessSupported
85-
false // fusedEuEnabled
85+
false, // fusedEuEnabled
86+
false // l0DebuggerSupported;
8687
};
8788

8889
WorkaroundTable LKF::workaroundTable = {};

shared/source/gen12lp/hw_info_adlp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
8080
true, // supportsMediaBlock
8181
false, // p2pAccessSupported
8282
false, // p2pAtomicAccessSupported
83-
true // fusedEuEnabled
83+
true, // fusedEuEnabled
84+
false // l0DebuggerSupported;
8485
};
8586

8687
WorkaroundTable ADLP::workaroundTable = {};

shared/source/gen12lp/hw_info_adls.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
8080
true, // supportsMediaBlock
8181
false, // p2pAccessSupported
8282
false, // p2pAtomicAccessSupported
83-
true // fusedEuEnabled
83+
true, // fusedEuEnabled
84+
false // l0DebuggerSupported;
8485
};
8586

8687
WorkaroundTable ADLS::workaroundTable = {};

shared/source/gen12lp/hw_info_dg1.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ const RuntimeCapabilityTable DG1::capabilityTable{
8888
true, // supportsMediaBlock
8989
true, // p2pAccessSupported
9090
false, // p2pAtomicAccessSupported
91-
true // fusedEuEnabled
91+
true, // fusedEuEnabled
92+
true, // l0DebuggerSupported;
9293
};
9394

9495
WorkaroundTable DG1::workaroundTable = {};

shared/source/gen12lp/hw_info_rkl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ const RuntimeCapabilityTable RKL::capabilityTable{
8080
true, // supportsMediaBlock
8181
false, // p2pAccessSupported
8282
false, // p2pAtomicAccessSupported
83-
true // fusedEuEnabled
83+
true, // fusedEuEnabled
84+
false, // l0DebuggerSupported;
8485
};
8586

8687
WorkaroundTable RKL::workaroundTable = {};

shared/source/gen12lp/hw_info_tgllp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
8484
true, // supportsMediaBlock
8585
false, // p2pAccessSupported
8686
false, // p2pAtomicAccessSupported
87-
true // fusedEuEnabled
87+
true, // fusedEuEnabled
88+
false, // l0DebuggerSupported;
8889
};
8990

9091
WorkaroundTable TGLLP::workaroundTable = {};

shared/source/gen8/hw_info_bdw.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
8787
true, // supportsMediaBlock
8888
false, // p2pAccessSupported
8989
false, // p2pAtomicAccessSupported
90-
false // fusedEuEnabled
90+
false, // fusedEuEnabled
91+
false // l0DebuggerSupported;
9192
};
9293

9394
WorkaroundTable BDW::workaroundTable = {};

shared/source/gen9/hw_info_bxt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
8484
true, // supportsMediaBlock
8585
false, // p2pAccessSupported
8686
false, // p2pAtomicAccessSupported
87-
false // fusedEuEnabled
87+
false, // fusedEuEnabled
88+
false // l0DebuggerSupported;
8889
};
8990

9091
WorkaroundTable BXT::workaroundTable = {};

shared/source/gen9/hw_info_cfl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
7979
true, // supportsMediaBlock
8080
false, // p2pAccessSupported
8181
false, // p2pAtomicAccessSupported
82-
false // fusedEuEnabled
82+
false, // fusedEuEnabled
83+
false // l0DebuggerSupported;
8384
};
8485

8586
WorkaroundTable CFL::workaroundTable = {};

shared/source/gen9/hw_info_glk.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
7979
true, // supportsMediaBlock
8080
false, // p2pAccessSupported
8181
false, // p2pAtomicAccessSupported
82-
false // fusedEuEnabled
82+
false, // fusedEuEnabled
83+
false // l0DebuggerSupported;
8384
};
8485

8586
WorkaroundTable GLK::workaroundTable = {};

shared/source/gen9/hw_info_kbl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
7979
true, // supportsMediaBlock
8080
false, // p2pAccessSupported
8181
false, // p2pAtomicAccessSupported
82-
false // fusedEuEnabled
82+
false, // fusedEuEnabled
83+
false // l0DebuggerSupported;
8384
};
8485

8586
WorkaroundTable KBL::workaroundTable = {};

shared/source/gen9/hw_info_skl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
8787
true, // supportsMediaBlock
8888
false, // p2pAccessSupported
8989
false, // p2pAtomicAccessSupported
90-
false // fusedEuEnabled
90+
false, // fusedEuEnabled
91+
false // l0DebuggerSupported;
9192
};
9293

9394
WorkaroundTable SKL::workaroundTable = {};

shared/source/helpers/hw_info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct RuntimeCapabilityTable {
6868
bool p2pAccessSupported;
6969
bool p2pAtomicAccessSupported;
7070
bool fusedEuEnabled;
71+
bool l0DebuggerSupported;
7172
};
7273

7374
inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilityTable &rhs) {
@@ -133,6 +134,7 @@ inline bool operator==(const RuntimeCapabilityTable &lhs, const RuntimeCapabilit
133134
result &= (lhs.isIntegratedDevice == rhs.isIntegratedDevice);
134135
result &= (lhs.supportsMediaBlock == rhs.supportsMediaBlock);
135136
result &= (lhs.fusedEuEnabled == rhs.fusedEuEnabled);
137+
result &= (lhs.l0DebuggerSupported == rhs.l0DebuggerSupported);
136138

137139
return result;
138140
}

shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const RuntimeCapabilityTable XE_HP_SDV::capabilityTable{
8484
true, // supportsMediaBlock
8585
true, // p2pAccessSupported
8686
false, // p2pAtomicAccessSupported
87-
true // fusedEuEnabled
87+
true, // fusedEuEnabled
88+
true // l0DebuggerSupported;
8889
};
8990

9091
WorkaroundTable XE_HP_SDV::workaroundTable = {};

shared/source/xe_hpc_core/hw_info_pvc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ const RuntimeCapabilityTable PVC::capabilityTable{
9393
false, // supportsMediaBlock
9494
true, // p2pAccessSupported
9595
true, // p2pAtomicAccessSupported
96-
false // fusedEuEnabled
96+
false, // fusedEuEnabled
97+
true // l0DebuggerSupported;
9798
};
9899

99100
void PVC::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {

shared/source/xe_hpg_core/hw_info_dg2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ const RuntimeCapabilityTable DG2::capabilityTable{
8484
true, // supportsMediaBlock
8585
true, // p2pAccessSupported
8686
false, // p2pAtomicAccessSupported
87-
true // fusedEuEnabled
87+
true, // fusedEuEnabled
88+
true // l0DebuggerSupported
8889
};
8990

9091
WorkaroundTable DG2::workaroundTable = {};

shared/test/common/test_macros/test.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,14 @@ struct IsWithinProducts {
849849
}
850850
};
851851

852+
template <PRODUCT_FAMILY productFamilyMin, PRODUCT_FAMILY productFamilyMax>
853+
struct IsNotWithinProducts {
854+
template <PRODUCT_FAMILY productFamily>
855+
static constexpr bool isMatched() {
856+
return (productFamily < productFamilyMin) || (productFamily > productFamilyMax);
857+
}
858+
};
859+
852860
struct MatchAny {
853861
template <PRODUCT_FAMILY productFamily>
854862
static constexpr bool isMatched() { return true; }

0 commit comments

Comments
 (0)