Skip to content

Commit 0bb5b34

Browse files
Jaime ArteagaCompute-Runtime-Automation
Jaime Arteaga
authored andcommitted
feature: Disable nonblocking exec support on Xe HPC
When receiving EAGAIN, UMD should retry the submission again. On scenarios where KMD runs out of ring-space, an error should be propagated up to the user. Those scenarios are more rare, but still we will need KMD support in the future to differentiate those two cases: retry and propagate error to user, since right now, KMD returns the same error code. Related-To: NEO-8040 Signed-off-by: Jaime Arteaga <[email protected]> Source: 09fcfbb
1 parent 14d31a5 commit 0bb5b34

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

shared/source/xe_hpc_core/linux/product_helper_xe_hpc_core.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
3131

3232
template <>
3333
bool ProductHelperHw<gfxProduct>::isNonBlockingGpuSubmissionSupported() const {
34-
return true;
34+
return false;
3535
}
3636

3737
} // namespace NEO

shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp

+36-4
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,21 @@ TEST(IoctlPrelimHelperFabricLatencyTest, givenPrelimWhenGettingFabricLatencyAndI
427427
drm->mockBandwidth = 0;
428428
EXPECT_FALSE(ioctlHelper.getFabricLatency(fabricId, latency, bandwidth));
429429
}
430-
HWTEST2_F(IoctlPrelimHelperTests, givenXeHpcWhenCallingIoctlWithGemExecbufferThenShouldBreakOnWouldBlock, IsXeHpcCore) {
430+
HWTEST2_F(IoctlPrelimHelperTests, givenXeHpcWhenCallingIoctlWithGemExecbufferThenShouldNotBreakOnWouldBlock, IsXeHpcCore) {
431+
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EAGAIN, DrmIoctl::GemExecbuffer2));
432+
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EAGAIN, DrmIoctl::GemVmBind));
433+
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EBUSY, DrmIoctl::GemExecbuffer2));
434+
}
435+
436+
HWTEST2_F(IoctlPrelimHelperTests, givenXeHpcWhenCallingIoctlWithGemExecbufferAndForceNonblockingExecbufferCallsThenShouldBreakOnWouldBlock, IsXeHpcCore) {
437+
DebugManagerStateRestore restorer;
438+
DebugManager.flags.ForceNonblockingExecbufferCalls.set(1);
439+
440+
MockExecutionEnvironment executionEnvironment{};
441+
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
442+
443+
IoctlHelperPrelim20 ioctlHelper{*drm};
444+
431445
EXPECT_FALSE(ioctlHelper.checkIfIoctlReinvokeRequired(EAGAIN, DrmIoctl::GemExecbuffer2));
432446
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EAGAIN, DrmIoctl::GemVmBind));
433447
EXPECT_TRUE(ioctlHelper.checkIfIoctlReinvokeRequired(EBUSY, DrmIoctl::GemExecbuffer2));
@@ -449,9 +463,27 @@ HWTEST2_F(IoctlPrelimHelperTests, givenXeHpcWhenCreatingIoctlHelperThenProperFla
449463

450464
IoctlHelperPrelim20 ioctlHelper{*drm};
451465

452-
EXPECT_EQ(1, SysCalls::getFileDescriptorFlagsCalled);
453-
EXPECT_EQ(1, SysCalls::setFileDescriptorFlagsCalled);
454-
EXPECT_EQ((O_RDWR | O_NONBLOCK), SysCalls::passedFileDescriptorFlagsToSet);
466+
EXPECT_EQ(0, SysCalls::getFileDescriptorFlagsCalled);
467+
EXPECT_EQ(0, SysCalls::setFileDescriptorFlagsCalled);
468+
EXPECT_EQ(0, SysCalls::passedFileDescriptorFlagsToSet);
469+
}
470+
471+
HWTEST2_F(IoctlPrelimHelperTests, givenXeHpcWhenCreatingIoctlHelperWithForceNonblockingExecbufferCallsThenProperFlagsAreSetToFileDescriptor, IsXeHpcCore) {
472+
DebugManagerStateRestore restorer;
473+
DebugManager.flags.ForceNonblockingExecbufferCalls.set(0);
474+
475+
MockExecutionEnvironment executionEnvironment{};
476+
std::unique_ptr<Drm> drm{Drm::create(std::make_unique<HwDeviceIdDrm>(0, ""), *executionEnvironment.rootDeviceEnvironments[0])};
477+
478+
VariableBackup<decltype(SysCalls::getFileDescriptorFlagsCalled)> backupGetFlags(&SysCalls::getFileDescriptorFlagsCalled, 0);
479+
VariableBackup<decltype(SysCalls::setFileDescriptorFlagsCalled)> backupSetFlags(&SysCalls::setFileDescriptorFlagsCalled, 0);
480+
VariableBackup<decltype(SysCalls::passedFileDescriptorFlagsToSet)> backupPassedFlags(&SysCalls::passedFileDescriptorFlagsToSet, 0);
481+
482+
IoctlHelperPrelim20 ioctlHelper{*drm};
483+
484+
EXPECT_EQ(0, SysCalls::getFileDescriptorFlagsCalled);
485+
EXPECT_EQ(0, SysCalls::setFileDescriptorFlagsCalled);
486+
EXPECT_EQ(0, SysCalls::passedFileDescriptorFlagsToSet);
455487
}
456488

457489
HWTEST2_F(IoctlPrelimHelperTests, givenNonXeHpcWhenCreatingIoctlHelperThenProperFlagsAreSetToFileDescriptor, IsNotXeHpcCore) {

0 commit comments

Comments
 (0)