mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Revert "performance: Memory handling improvements"
This reverts commit 5b80bd4d7c.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1434872427
commit
8c155a2e89
@@ -52,7 +52,7 @@ class MockWddmMemoryManager : public MemoryManagerCreate<WddmMemoryManager> {
|
||||
return BaseClass::allocateGraphicsMemoryInDevicePool(allocationData, status);
|
||||
}
|
||||
|
||||
size_t hugeGfxMemoryChunkSize = BaseClass::getHugeGfxMemoryChunkSize(MockWddmMemoryManager::getPreferredAllocationMethod());
|
||||
size_t hugeGfxMemoryChunkSize = BaseClass::getHugeGfxMemoryChunkSize(preferredAllocationMethod);
|
||||
size_t getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod allocationMethod) const override { return hugeGfxMemoryChunkSize; }
|
||||
|
||||
MockWddmMemoryManager(ExecutionEnvironment &executionEnvironment) : MemoryManagerCreate(false, false, executionEnvironment) {
|
||||
|
||||
@@ -532,7 +532,7 @@ ExitOnSubmissionMode = 0
|
||||
ForceInOrderImmediateCmdListExecution = -1
|
||||
ForceTlbFlush = -1
|
||||
DebugSetMemoryDiagnosticsDelay = -1
|
||||
EnableCpuCacheForResources = 0
|
||||
EnableCpuCacheForResources = 1
|
||||
OverrideHwIpVersion = -1
|
||||
PrintGlobalTimestampInNs = 0
|
||||
EnableDeviceStateVerification = -1
|
||||
|
||||
@@ -55,9 +55,4 @@ bool TestChecks::supportsSvm(const std::unique_ptr<HardwareInfo> &pHardwareInfo)
|
||||
}
|
||||
bool TestChecks::supportsSvm(const Device *pDevice) {
|
||||
return supportsSvm(&pDevice->getHardwareInfo());
|
||||
}
|
||||
|
||||
bool TestChecks::supportsCpuMemAccess(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
return productHelper.isCachingOnCpuAvailable();
|
||||
}
|
||||
@@ -18,7 +18,6 @@ struct RootDeviceEnvironment;
|
||||
namespace TestChecks {
|
||||
bool supportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
bool fullySupportsBlitter(const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
bool supportsCpuMemAccess(const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
bool supportsImages(const HardwareInfo &hardwareInfo);
|
||||
bool supportsImages(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
|
||||
bool supportsSvm(const HardwareInfo *pHardwareInfo);
|
||||
@@ -57,8 +56,3 @@ bool supportsSvm(const Device *pDevice);
|
||||
if (NEO::TestChecks::supportsImages(param) == false) { \
|
||||
GTEST_SKIP(); \
|
||||
}
|
||||
|
||||
#define REQUIRE_CPU_MEM_ACCESS_OR_SKIP(rootDeviceEnvironment) \
|
||||
if (NEO::TestChecks::supportsCpuMemAccess(rootDeviceEnvironment) == false) { \
|
||||
GTEST_SKIP(); \
|
||||
}
|
||||
|
||||
@@ -748,9 +748,6 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenInitializeEngineIs
|
||||
}
|
||||
|
||||
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInitFileIsCalledThenMemTraceCommentWithDriverVersionIsPutIntoAubStream) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
|
||||
auto mockAubManager = std::make_unique<MockAubManager>();
|
||||
auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(false, true, true);
|
||||
auto aubCsr = aubExecutionEnvironment->template getCsr<AUBCommandStreamReceiverHw<FamilyType>>();
|
||||
@@ -989,7 +986,6 @@ HWTEST_F(AubFileStreamTests, givenGenerateAubFilePerProcessIdDebugFlagAndAubComm
|
||||
HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWithAubManagerWhenInitFileIsCalledThenCommentWithNonDefaultFlagsAreAdded) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
DebugManager.flags.MakeAllBuffersResident.set(1);
|
||||
DebugManager.flags.ZE_AFFINITY_MASK.set("non-default");
|
||||
|
||||
|
||||
@@ -193,9 +193,6 @@ TEST(ExecutionEnvironment, givenNeoCalEnabledWhenCreateExecutionEnvironmentThenS
|
||||
{"UseKmdMigration", 0},
|
||||
{"SplitBcsSize", 256}};
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
|
||||
EXPECT_EQ(defaultValue, DebugManager.flags.variableName.getRef());
|
||||
@@ -206,6 +203,7 @@ TEST(ExecutionEnvironment, givenNeoCalEnabledWhenCreateExecutionEnvironmentThenS
|
||||
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.NEO_CAL_ENABLED.set(1);
|
||||
ExecutionEnvironment exeEnv;
|
||||
|
||||
|
||||
@@ -304,8 +304,6 @@ int main(int argc, char **argv) {
|
||||
revId = platform.usRevId;
|
||||
}
|
||||
|
||||
NEO::DebugManager.flags.ForcePreferredAllocationMethod.set(0); // Force allocation in system for ULTs
|
||||
|
||||
adjustHwInfoForTests(hwInfoForTests, euPerSubSlice, sliceCount, subSlicePerSliceCount, dieRecovery);
|
||||
|
||||
binaryNameSuffix.append(hardwarePrefix[hwInfoForTests.platform.eProductFamily]);
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "shared/source/os_interface/windows/wddm/um_km_data_translator.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/source/os_interface/windows/wddm_memory_manager.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
@@ -628,9 +627,6 @@ TEST_F(WddmLinuxConfigureReduced48bitDeviceAddressSpaceTest, givenTwoSvmAddressS
|
||||
}
|
||||
|
||||
TEST_F(WddmLinuxTest, givenRequestFor32bitAllocationWithoutPreexistingHostPtrWhenAllocatingThroughKmdIsPreferredThenAllocateThroughKmdAndLockAllocation) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::AllocateByKmd));
|
||||
|
||||
osEnvironment->gdi->reserveGpuVirtualAddress = reserveDeviceAddressSpaceMock;
|
||||
osEnvironment->gdi->createAllocation2 = createAllocation2Mock;
|
||||
osEnvironment->gdi->mapGpuVirtualAddress = mapGpuVirtualAddressMock;
|
||||
|
||||
@@ -76,7 +76,7 @@ class MockAllocateGraphicsMemoryWithAlignmentWddm : public MemoryManagerCreate<W
|
||||
size_t getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod allocationMethod) const override {
|
||||
return hugeGfxMemoryChunkSize;
|
||||
}
|
||||
size_t hugeGfxMemoryChunkSize = WddmMemoryManager::getHugeGfxMemoryChunkSize(MockWddmMemoryManager::getPreferredAllocationMethod());
|
||||
size_t hugeGfxMemoryChunkSize = WddmMemoryManager::getHugeGfxMemoryChunkSize(preferredAllocationMethod);
|
||||
};
|
||||
|
||||
class WddmMemoryManagerTests : public ::testing::Test {
|
||||
@@ -109,7 +109,7 @@ TEST_F(WddmMemoryManagerTests, GivenAllocDataWithSVMCPUSetWhenAllocateGraphicsMe
|
||||
allocData.makeGPUVaDifferentThanCPUPtr = true;
|
||||
memoryManager->allocateGraphicsMemoryWithAlignment(allocData);
|
||||
|
||||
if (MockWddmMemoryManager::getPreferredAllocationMethod() == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
EXPECT_TRUE(memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVACalled);
|
||||
} else {
|
||||
EXPECT_TRUE(memoryManager->allocateSystemMemoryAndCreateGraphicsAllocationFromItCalled);
|
||||
@@ -230,9 +230,6 @@ class WddmMemoryManagerAllocPathTests : public ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMapItToCpuVAWhenPreferedAllocationMethodThenProperArgumentsAreSet) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
|
||||
{
|
||||
NEO::AllocationData allocData = {};
|
||||
allocData.type = NEO::AllocationType::SVM_CPU;
|
||||
@@ -240,7 +237,7 @@ TEST_F(WddmMemoryManagerAllocPathTests, givenAllocateGraphicsMemoryUsingKmdAndMa
|
||||
allocData.makeGPUVaDifferentThanCPUPtr = true;
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryUsingKmdAndMapItToCpuVA(allocData, false);
|
||||
|
||||
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd && !is32bit) {
|
||||
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
EXPECT_FALSE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
|
||||
} else {
|
||||
EXPECT_TRUE(memoryManager->mapGpuVirtualAddressWithCpuPtr);
|
||||
@@ -497,7 +494,7 @@ TEST_F(WddmMemoryManagerTests, givenTypeWhenCallIsStatelessAccessRequiredThenPro
|
||||
|
||||
TEST_F(WddmMemoryManagerTests, givenForcePreferredAllocationMethodFlagSetWhenGettingPreferredAllocationMethodThenValueFlagIsReturned) {
|
||||
DebugManagerStateRestore restorer;
|
||||
EXPECT_EQ(preferredAllocationMethod, GfxMemoryAllocationMethod::AllocateByKmd);
|
||||
EXPECT_EQ(preferredAllocationMethod, MockWddmMemoryManager::getPreferredAllocationMethod());
|
||||
|
||||
for (const auto &allocationMethod : {GfxMemoryAllocationMethod::UseUmdSystemPtr, GfxMemoryAllocationMethod::AllocateByKmd}) {
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(allocationMethod));
|
||||
@@ -572,7 +569,6 @@ class WddmMemoryManagerSimpleTest : public ::testing::Test {
|
||||
} else {
|
||||
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
wddm->init();
|
||||
wddm->mapGpuVaStatus = true;
|
||||
VariableBackup<bool> restorer{&wddm->callBaseMapGpuVa, false};
|
||||
@@ -1426,9 +1422,6 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAlignmentRequirementExceedsPageSizeThenA
|
||||
} callCount;
|
||||
};
|
||||
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
|
||||
MockWddmMemoryManagerAllocateWithAlignment memoryManager(true, true, executionEnvironment);
|
||||
|
||||
AllocationData allocData = {};
|
||||
@@ -3172,9 +3165,6 @@ TEST_F(MockWddmMemoryManagerTest, givenAllocateGraphicsMemoryForBufferAndRequest
|
||||
}
|
||||
|
||||
TEST_F(MockWddmMemoryManagerTest, givenDefaultMemoryManagerWhenItIsCreatedThenCorrectHugeGfxMemoryChunkIsSet) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.ForcePreferredAllocationMethod.set(-1);
|
||||
|
||||
MockWddmMemoryManager memoryManager(executionEnvironment);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::AllocateByKmd), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
EXPECT_EQ(memoryManager.getHugeGfxMemoryChunkSize(GfxMemoryAllocationMethod::UseUmdSystemPtr), 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k);
|
||||
|
||||
@@ -56,7 +56,7 @@ TEST_F(WddmFrontWindowPoolAllocatorTests, givenAllocateInFrontWindowPoolFlagWhen
|
||||
auto gmmHelper = memManager->getGmmHelper(allocData.rootDeviceIndex);
|
||||
EXPECT_EQ(allocation->getGpuBaseAddress(), gmmHelper->canonize(allocation->getGpuAddress()));
|
||||
|
||||
if (MockWddmMemoryManager::getPreferredAllocationMethod() == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
if (preferredAllocationMethod == GfxMemoryAllocationMethod::AllocateByKmd) {
|
||||
EXPECT_TRUE(allocation->isAllocationLockable());
|
||||
} else {
|
||||
EXPECT_FALSE(allocation->isAllocationLockable());
|
||||
|
||||
Reference in New Issue
Block a user