mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: set eudebug extension property when debugging enabled
In order to debug on XE, XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG needs to be set up. Related-To: NEO-12691 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3092725df2
commit
25f2504bf5
@@ -140,7 +140,6 @@ class GfxCoreHelper {
|
||||
virtual size_t getTimestampPacketAllocatorAlignment() const = 0;
|
||||
virtual size_t getSingleTimestampPacketSize() const = 0;
|
||||
virtual void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const = 0;
|
||||
virtual bool isRunaloneModeRequired(DebuggingMode debuggingMode) const = 0;
|
||||
virtual void applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const = 0;
|
||||
virtual bool unTypedDataPortCacheFlushRequired() const = 0;
|
||||
virtual bool isEngineTypeRemappingToHwSpecificRequired() const = 0;
|
||||
@@ -377,8 +376,6 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
void applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const override;
|
||||
|
||||
bool isRunaloneModeRequired(DebuggingMode debuggingMode) const override;
|
||||
|
||||
void applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const override;
|
||||
|
||||
bool unTypedDataPortCacheFlushRequired() const override;
|
||||
|
||||
@@ -581,11 +581,6 @@ size_t GfxCoreHelperHw<GfxFamily>::getPreemptionAllocationAlignment() const {
|
||||
template <typename GfxFamily>
|
||||
void GfxCoreHelperHw<GfxFamily>::applyAdditionalCompressionSettings(Gmm &gmm, bool isNotCompressed) const {}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool GfxCoreHelperHw<GfxFamily>::isRunaloneModeRequired(DebuggingMode debuggingMode) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void GfxCoreHelperHw<GfxFamily>::applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const {
|
||||
gmm.resourceParams.Flags.Info.RenderCompressed = isCompressed;
|
||||
|
||||
@@ -1563,12 +1563,11 @@ void IoctlHelperXe::setOptionalContextProperties(Drm &drm, void *extProperties,
|
||||
|
||||
auto &ext = *reinterpret_cast<std::array<drm_xe_ext_set_property, maxContextSetProperties> *>(extProperties);
|
||||
|
||||
auto &gfxCoreHelper = drm.getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
if ((contextParamEngine[0].engine_class == DRM_XE_ENGINE_CLASS_RENDER) || (contextParamEngine[0].engine_class == DRM_XE_ENGINE_CLASS_COMPUTE)) {
|
||||
if (gfxCoreHelper.isRunaloneModeRequired(drm.getRootDeviceEnvironment().executionEnvironment.getDebuggingMode())) {
|
||||
if (drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled()) {
|
||||
ext[extIndexInOut].base.next_extension = 0;
|
||||
ext[extIndexInOut].base.name = DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY;
|
||||
ext[extIndexInOut].property = getRunaloneExtProperty();
|
||||
ext[extIndexInOut].property = getEudebugExtProperty();
|
||||
ext[extIndexInOut].value = 1;
|
||||
extIndexInOut++;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ class IoctlHelperXe : public IoctlHelper {
|
||||
int debuggerOpenIoctl(DrmIoctl request, void *arg);
|
||||
int debuggerMetadataCreateIoctl(DrmIoctl request, void *arg);
|
||||
int debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg);
|
||||
int getRunaloneExtProperty();
|
||||
int getEudebugExtProperty();
|
||||
virtual bool isExtraEngineClassAllowed(uint16_t engineClass) const { return false; }
|
||||
virtual std::optional<uint32_t> getCxlType() { return {}; }
|
||||
virtual uint32_t getNumEngines(uint64_t *enginesData) const;
|
||||
|
||||
@@ -57,7 +57,7 @@ int IoctlHelperXe::debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int IoctlHelperXe::getRunaloneExtProperty() {
|
||||
int IoctlHelperXe::getEudebugExtProperty() {
|
||||
return DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ int IoctlHelperXe::debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IoctlHelperXe::getRunaloneExtProperty() {
|
||||
int IoctlHelperXe::getEudebugExtProperty() {
|
||||
UNRECOVERABLE_IF(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -298,11 +298,6 @@ uint32_t GfxCoreHelperHw<Family>::overrideMaxWorkGroupSize(uint32_t maxWG) const
|
||||
return std::min(maxWG, 2048u);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::isRunaloneModeRequired(DebuggingMode debuggingMode) const {
|
||||
return (debuggingMode == DebuggingMode::online);
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::calculateNumThreadsPerThreadGroup(uint32_t simd, uint32_t totalWorkItems, uint32_t grfCount, bool isHwLocalIdGeneration, const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
uint32_t numThreadsPerThreadGroup = getThreadsPerWG(simd, totalWorkItems);
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace NEO;
|
||||
|
||||
struct MockIoctlHelperXeDebug : IoctlHelperXe {
|
||||
using IoctlHelperXe::bindInfo;
|
||||
using IoctlHelperXe::getRunaloneExtProperty;
|
||||
using IoctlHelperXe::getEudebugExtProperty;
|
||||
using IoctlHelperXe::IoctlHelperXe;
|
||||
using IoctlHelperXe::tileIdToGtId;
|
||||
};
|
||||
|
||||
@@ -1710,12 +1710,6 @@ HWTEST2_F(GfxCoreHelperTest, givenParamsWhenCalculateNumThreadsPerThreadGroupThe
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, givenDebugModeWhenCheckingIfRunaloneModeRequiredThenMethodReturnFalseValue, IsAtMostXeHpcCore) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_FALSE(gfxCoreHelper.isRunaloneModeRequired(DebuggingMode::offline));
|
||||
EXPECT_FALSE(gfxCoreHelper.isRunaloneModeRequired(DebuggingMode::online));
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, givenFlagRemoveRestrictionsOnNumberOfThreadsInGpgpuThreadGroupWhenCalculateNumThreadsPerThreadGroupThenMethodReturnProperValue) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.RemoveRestrictionsOnNumberOfThreadsInGpgpuThreadGroup.set(1);
|
||||
|
||||
@@ -58,26 +58,20 @@ TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetIoctForDebuggerThenCorre
|
||||
verifyIoctlRequestValue(DRM_IOCTL_XE_EUDEBUG_CONNECT, DrmIoctl::debuggerOpen);
|
||||
}
|
||||
|
||||
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetRunaloneExtPropertyThenCorrectValueReturned) {
|
||||
TEST(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetEudebugExtPropertyThenCorrectValueReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::offline);
|
||||
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXeDebug *>(drm->ioctlHelper.get());
|
||||
EXPECT_EQ(xeIoctlHelper->getRunaloneExtProperty(), DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG);
|
||||
EXPECT_EQ(xeIoctlHelper->getEudebugExtProperty(), DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG);
|
||||
}
|
||||
|
||||
using IoctlHelperXeTestFixture = ::testing::Test;
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenRunaloneModeRequiredReturnFalseWhenCreateDrmContextThenRunAloneContextIsNotRequested) {
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenDebuggingDisabledWhenCreateDrmContextThenEuDebuggableContextIsNotRequested) {
|
||||
DebugManagerStateRestore restorer;
|
||||
struct MockGfxCoreHelperHw : NEO::GfxCoreHelperHw<FamilyType> {
|
||||
bool isRunaloneModeRequired(DebuggingMode debuggingMode) const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::disabled);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment->rootDeviceEnvironments[0];
|
||||
auto raiiFactory = RAIIGfxCoreHelperFactory<MockGfxCoreHelperHw>(rootDeviceEnvironment);
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
@@ -124,17 +118,12 @@ HWTEST_F(IoctlHelperXeTestFixture, givenDeviceIndexWhenCreatingContextThenSetCor
|
||||
EXPECT_EQ(expectedGtId, drm->execQueueEngineInstances[0].gt_id);
|
||||
}
|
||||
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenRunaloneModeRequiredReturnTrueWhenCreateDrmContextThenRunAloneContextIsRequested) {
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenDebuggingEnabledWhenCreateDrmContextThenEuDebuggableContextIsRequested) {
|
||||
DebugManagerStateRestore restorer;
|
||||
struct MockGfxCoreHelperHw : NEO::GfxCoreHelperHw<FamilyType> {
|
||||
bool isRunaloneModeRequired(DebuggingMode debuggingMode) const override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::online);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment->rootDeviceEnvironments[0];
|
||||
auto raiiFactory = RAIIGfxCoreHelperFactory<MockGfxCoreHelperHw>(rootDeviceEnvironment);
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
@@ -154,17 +143,12 @@ HWTEST_F(IoctlHelperXeTestFixture, GivenRunaloneModeRequiredReturnTrueWhenCreate
|
||||
EXPECT_EQ(ext.value, 1ULL);
|
||||
}
|
||||
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenContextCreatedForCopyEngineWhenCreateDrmContextThenRunAloneContextIsNotRequested) {
|
||||
HWTEST_F(IoctlHelperXeTestFixture, GivenContextCreatedForCopyEngineWhenCreateDrmContextThenEuDebuggableContextIsNotRequested) {
|
||||
DebugManagerStateRestore restorer;
|
||||
struct MockGfxCoreHelperHw : NEO::GfxCoreHelperHw<FamilyType> {
|
||||
bool isRunaloneModeRequired(DebuggingMode debuggingMode) const override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
executionEnvironment->setDebuggingMode(DebuggingMode::online);
|
||||
auto &rootDeviceEnvironment = *executionEnvironment->rootDeviceEnvironments[0];
|
||||
auto raiiFactory = RAIIGfxCoreHelperFactory<MockGfxCoreHelperHw>(rootDeviceEnvironment);
|
||||
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
|
||||
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
|
||||
auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
Reference in New Issue
Block a user