mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
feature: enable tbx fault manager by default
Related-To: NEO-13748 Signed-off-by: Jack Myers <jack.myers@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b462f990b6
commit
f2b5126598
@@ -85,7 +85,7 @@ bool TbxCommandStreamReceiverHw<GfxFamily>::isAllocTbxFaultable(GraphicsAllocati
|
||||
}
|
||||
auto allocType = gfxAlloc->getAllocationType();
|
||||
|
||||
if (allocType == AllocationType::bufferHostMemory || allocType == AllocationType::timestampPacketTagBuffer) {
|
||||
if (allocType == AllocationType::bufferHostMemory) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -198,7 +198,10 @@ class DebugSettingsManager : NEO::NonCopyableAndNonMovableClass {
|
||||
auto setCsr = flags.SetCommandStreamReceiver.get();
|
||||
auto isTbxMode = (setCsr == static_cast<int32_t>(CommandStreamReceiverType::tbx)) ||
|
||||
(setCsr == static_cast<int32_t>(CommandStreamReceiverType::tbxWithAub));
|
||||
auto isFaultManagerEnabledInEnvVars = flags.EnableTbxPageFaultManager.get();
|
||||
auto isFaultManagerEnabledInEnvVars = true;
|
||||
if (flags.EnableTbxPageFaultManager.get() == 0) {
|
||||
isFaultManagerEnabledInEnvVars = false;
|
||||
}
|
||||
return isFaultManagerEnabledInEnvVars && isTbxMode;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ DECLARE_DEBUG_VARIABLE(bool, AUBDumpAllocsOnEnqueueSVMMemcpyOnly, false, "Force
|
||||
DECLARE_DEBUG_VARIABLE(bool, AUBDumpForceAllToLocalMemory, false, "Force placing every allocation in local memory address space")
|
||||
DECLARE_DEBUG_VARIABLE(bool, GenerateAubFilePerProcessId, true, "Generate aub file with process id")
|
||||
DECLARE_DEBUG_VARIABLE(bool, SetBufferHostMemoryAlwaysAubWritable, false, "Make buffer host memory allocation always uploaded to AUB/TBX")
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableTbxPageFaultManager, false, "Enables experimental page fault manager for host buffers and some other alloc types, replaces SetBufferHostMemoryAlwaysAubWritable")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableTbxPageFaultManager, -1, "Enable/Disable TbxPageFaultManager, overrides SetBufferHostMemoryAlwaysAubWritable to false if enabled: default 1, 0 - disable, 1 - enable")
|
||||
|
||||
/*DEBUG FLAGS*/
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableSWTags, false, "Enable software tagging in batch buffer")
|
||||
|
||||
@@ -24,7 +24,7 @@ bool TbxPageFaultManager::verifyAndHandlePageFault(void *ptr, bool handleFault)
|
||||
if (allocPtr != nullptr) {
|
||||
auto faultData = memoryData[allocPtr];
|
||||
if (faultData.domain == CpuPageFaultManager::AllocationDomain::gpu) {
|
||||
this->allowCPUMemoryAccess(ptr, faultData.size);
|
||||
this->allowCPUMemoryAccess(allocPtr, faultData.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ AUBDumpAllocsOnEnqueueSVMMemcpyOnly = 0
|
||||
AUBDumpForceAllToLocalMemory = 0
|
||||
GenerateAubFilePerProcessId = 1
|
||||
SetBufferHostMemoryAlwaysAubWritable = 0
|
||||
EnableTbxPageFaultManager = 0
|
||||
EnableTbxPageFaultManager = -1
|
||||
EnableSWTags = 0
|
||||
DumpSWTagsBXML = 0
|
||||
ForceDeviceId = unk
|
||||
|
||||
@@ -1303,7 +1303,7 @@ class MockTbxCsrForPageFaultTests : public MockTbxCsr<FamilyType> {
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHostWritesHostAllocThenAllocShouldBeDownloadedAndWritable) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1358,7 +1358,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHostWritesHostAllocThenAllocShou
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxWithModeWhenHostBufferNotWritableAndProtectedThenDownloadShouldNotCrash) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1390,7 +1390,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxWithModeWhenHostBufferNotWritableAndProt
|
||||
HWTEST_F(TbxCommandStreamTests, givenAllocationWithNoDriverAllocatedCpuPtrThenIsAllocTbxFaultableShouldReturnFalse) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1417,7 +1417,7 @@ HWTEST_F(TbxCommandStreamTests, givenAllocationWithNoDriverAllocatedCpuPtrThenIs
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHostReadsHostAllocThenAllocShouldBeDownloadedButNotWritable) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1466,7 +1466,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHostReadsHostAllocThenAllocShoul
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHandleFaultFalseThenTbxFaultableTypesShouldNotBeHandled) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1510,7 +1510,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenHandleFaultFalseThenTbxFaultable
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenPageFaultManagerIsDisabledThenIsAllocTbxFaultableShouldReturnFalse) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(false);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(0);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1531,7 +1531,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenPageFaultManagerIsDisabledThenIs
|
||||
HWTEST_F(TbxCommandStreamTests, givenTbxModeWhenPageFaultManagerIsNotAvailableThenIsAllocTbxFaultableShouldReturnFalse) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(false);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(0);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
tbxCsr->tbxFaultManager.reset(nullptr);
|
||||
@@ -1574,7 +1574,7 @@ static constexpr std::array onceWritableAllocTypesForTbx{
|
||||
HWTEST_F(TbxCommandStreamTests, givenAubOneTimeWritableAllocWhenTbxFaultManagerIsAvailableAndAllocIsTbxFaultableThenTbxFaultableTypesShouldReturnTrue) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
@@ -1590,7 +1590,7 @@ HWTEST_F(TbxCommandStreamTests, givenAubOneTimeWritableAllocWhenTbxFaultManagerI
|
||||
|
||||
for (const auto &allocType : onceWritableAllocTypesForTbx) {
|
||||
gfxAlloc1->setAllocationType(allocType);
|
||||
if (allocType == AllocationType::bufferHostMemory || allocType == AllocationType::timestampPacketTagBuffer) {
|
||||
if (allocType == AllocationType::bufferHostMemory) {
|
||||
EXPECT_TRUE(tbxCsr->isAllocTbxFaultable(gfxAlloc1));
|
||||
}
|
||||
}
|
||||
@@ -1603,7 +1603,7 @@ HWTEST_F(TbxCommandStreamTests, givenAubOneTimeWritableAllocWhenTbxFaultManagerI
|
||||
HWTEST_F(TbxCommandStreamTests, givenAubOneTimeWritableAllocWhenTbxFaultManagerIsAvailableAndAllocIsNotTbxFaultableThenTbxFaultableTypesShouldReturnFalse) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
debugManager.flags.SetCommandStreamReceiver.set(static_cast<int32_t>(CommandStreamReceiverType::tbx));
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
std::unique_ptr<MockTbxCsrForPageFaultTests<FamilyType>> tbxCsr(new MockTbxCsrForPageFaultTests<FamilyType>(*pDevice->executionEnvironment, pDevice->getDeviceBitfield()));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ TEST(DurationLogTest, givenDurationGetTimeStringThenTimeStringIsCorrect) {
|
||||
|
||||
TEST(DebugSettingsManager, GivenTbxOrTbxWithAubCsrTypeAndTbxFaultsEnabledWhenCallingIsTbxMngrEnabledThenReturnTrue) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
|
||||
NEO::debugManager.flags.SetCommandStreamReceiver.set(2);
|
||||
EXPECT_TRUE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
@@ -523,16 +523,25 @@ TEST(DebugSettingsManager, GivenTbxOrTbxWithAubCsrTypeAndTbxFaultsEnabledWhenCal
|
||||
EXPECT_TRUE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, GivenTbxOrTbxWithAubCsrTypeAndAllElseDefaultWhenCallingIsTbxMngrEnabledThenReturnTrue) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::debugManager.flags.SetCommandStreamReceiver.set(2);
|
||||
EXPECT_TRUE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
|
||||
NEO::debugManager.flags.SetCommandStreamReceiver.set(4);
|
||||
EXPECT_TRUE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, GivenTbxFaultsDisabledWhenCallingIsTbxMngrEnabledThenReturnFalse) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(false);
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(0);
|
||||
|
||||
EXPECT_FALSE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, GivenHardwareOrHardwareWithAubCsrTypeAndTbxFaultsEnabledWhenCallingIsTbxMngrEnabledThenReturnFalse) {
|
||||
DebugManagerStateRestore restorer;
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(true);
|
||||
NEO::debugManager.flags.EnableTbxPageFaultManager.set(1);
|
||||
|
||||
NEO::debugManager.flags.SetCommandStreamReceiver.set(1);
|
||||
EXPECT_FALSE(NEO::debugManager.isTbxPageFaultManagerEnabled());
|
||||
|
||||
Reference in New Issue
Block a user