mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Revert "Add debug flag for EOT WA"
This reverts commit cf3817e058.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6292a3304a
commit
f53ae0a50e
@@ -500,25 +500,6 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, WhenFlushingThenScratchAllocationI
|
||||
EXPECT_TRUE(commandStreamReceiver->isMadeNonResident(scratchAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenAdditionalAllocationForResidencyWhenFlushingThenHandleResidency) {
|
||||
auto commandStreamReceiver = new MockCsrHw<FamilyType>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
pDevice->resetCommandStreamReceiver(commandStreamReceiver);
|
||||
|
||||
MockGraphicsAllocation allocation{};
|
||||
commandStreamReceiver->addAdditionalAllocationForResidency(&allocation);
|
||||
|
||||
flushTask(*commandStreamReceiver);
|
||||
|
||||
auto tagAllocation = commandStreamReceiver->getTagAllocation();
|
||||
ASSERT_NE(tagAllocation, nullptr);
|
||||
|
||||
EXPECT_TRUE(commandStreamReceiver->isMadeResident(tagAllocation));
|
||||
EXPECT_TRUE(commandStreamReceiver->isMadeResident(&allocation));
|
||||
|
||||
EXPECT_TRUE(commandStreamReceiver->isMadeNonResident(tagAllocation));
|
||||
EXPECT_TRUE(commandStreamReceiver->isMadeNonResident(&allocation));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCommandStreamReceiverWhenFenceAllocationIsRequiredAndFlushTaskIsCalledThenFenceAllocationIsMadeResident) {
|
||||
RAIIHwHelperFactory<MockHwHelperWithFenceAllocation<FamilyType>> hwHelperBackup{pDevice->getHardwareInfo().platform.eRenderCoreFamily};
|
||||
|
||||
|
||||
@@ -337,9 +337,6 @@ class CommandStreamReceiver {
|
||||
DispatchMode getDispatchMode() const {
|
||||
return this->dispatchMode;
|
||||
}
|
||||
void addAdditionalAllocationForResidency(GraphicsAllocation *graphicsAllocation) {
|
||||
this->additionalAllocationsForResidency.push_back(graphicsAllocation);
|
||||
}
|
||||
|
||||
LogicalStateHelper *getLogicalStateHelper() const;
|
||||
|
||||
@@ -392,7 +389,6 @@ class CommandStreamReceiver {
|
||||
GraphicsAllocation *perDssBackedBuffer = nullptr;
|
||||
GraphicsAllocation *clearColorAllocation = nullptr;
|
||||
GraphicsAllocation *workPartitionAllocation = nullptr;
|
||||
StackVec<GraphicsAllocation *, 1> additionalAllocationsForResidency;
|
||||
|
||||
MultiGraphicsAllocation *tagsMultiAllocation = nullptr;
|
||||
|
||||
|
||||
@@ -515,10 +515,6 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
|
||||
this->makeResident(*tagAllocation);
|
||||
|
||||
for (auto &additionalAllocationForResidency : additionalAllocationsForResidency) {
|
||||
this->makeResident(*additionalAllocationForResidency);
|
||||
}
|
||||
|
||||
if (globalFenceAllocation) {
|
||||
makeResident(*globalFenceAllocation);
|
||||
}
|
||||
@@ -776,9 +772,6 @@ inline bool CommandStreamReceiverHw<GfxFamily>::flushBatchedSubmissions() {
|
||||
for (auto &surface : resourcePackage) {
|
||||
surfacesForSubmit.push_back(surface);
|
||||
}
|
||||
for (auto &additionalAllocationForResidency : additionalAllocationsForResidency) {
|
||||
surfacesForSubmit.push_back(additionalAllocationForResidency);
|
||||
}
|
||||
|
||||
// make sure we flush DC if needed
|
||||
if (epiloguePipeControlLocation && MemorySynchronizationCommands<GfxFamily>::getDcFlushEnable(true, hwInfo)) {
|
||||
|
||||
@@ -74,7 +74,6 @@ DECLARE_DEBUG_VARIABLE(bool, PrintMemoryRegionSizes, false, "print memory bank t
|
||||
DECLARE_DEBUG_VARIABLE(bool, UpdateCrossThreadDataSize, false, "Turn on cross thread data size calculation for PATCH TOKEN binary")
|
||||
DECLARE_DEBUG_VARIABLE(bool, UseNewQueryTopoIoctl, true, "Use DRM_I915_QUERY_COMPUTE_SLICES")
|
||||
DECLARE_DEBUG_VARIABLE(bool, DisableGpuHangDetection, false, "Disable GPU hang detection")
|
||||
DECLARE_DEBUG_VARIABLE(bool, EnableEotWa, false, "Enable WA to program EOT instruction at the end of kernel heap")
|
||||
DECLARE_DEBUG_VARIABLE(std::string, ForceDeviceId, std::string("unk"), "DeviceId selected for testing")
|
||||
DECLARE_DEBUG_VARIABLE(std::string, FilterDeviceId, std::string("unk"), "Device id filter, adapter matching device id will be opened. Ignored when unk.")
|
||||
DECLARE_DEBUG_VARIABLE(std::string, FilterBdfPath, std::string("unk"), "Linux-only, BDF path filter, only matching paths will be opened. Ignored when unk.")
|
||||
|
||||
@@ -59,9 +59,6 @@ Device::~Device() {
|
||||
|
||||
syncBufferHandler.reset();
|
||||
commandStreamReceivers.clear();
|
||||
if (kernelEotWaAllocation) {
|
||||
executionEnvironment->memoryManager->freeGraphicsMemory(kernelEotWaAllocation);
|
||||
}
|
||||
executionEnvironment->memoryManager->waitForDeletions();
|
||||
|
||||
executionEnvironment->decRefInternal();
|
||||
@@ -218,22 +215,10 @@ bool Device::createDeviceImpl() {
|
||||
if (getDebugger() && hwHelper.disableL3CacheForDebug(hwInfo)) {
|
||||
getGmmHelper()->forceAllResourcesUncached();
|
||||
}
|
||||
if (DebugManager.flags.EnableEotWa.get()) {
|
||||
AllocationProperties allocationProperties{rootDeviceIndex, MemoryConstants::pageSize64k, AllocationType::KERNEL_ISA, deviceBitfield};
|
||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||
auto heapBase = memoryManager->getInternalHeapBaseAddress(rootDeviceIndex, memoryManager->isLocalMemoryUsedForIsa(rootDeviceIndex));
|
||||
allocationProperties.gpuAddress = heapBase + 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k;
|
||||
kernelEotWaAllocation = executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(allocationProperties);
|
||||
}
|
||||
|
||||
if (!createEngines()) {
|
||||
return false;
|
||||
}
|
||||
if (kernelEotWaAllocation) {
|
||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||
uint8_t eotMemoryPattern[]{0x31, 0x09, 0x0C, 0x80, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x7F, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00};
|
||||
memoryManager->copyMemoryToAllocation(kernelEotWaAllocation, MemoryConstants::pageSize64k - sizeof(eotMemoryPattern) - MemoryConstants::pageSize, eotMemoryPattern, sizeof(eotMemoryPattern));
|
||||
}
|
||||
|
||||
getDefaultEngine().osContext->setDefaultContext(true);
|
||||
|
||||
@@ -388,11 +373,6 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
|
||||
addEngineToEngineGroup(engine);
|
||||
}
|
||||
|
||||
if (kernelEotWaAllocation) {
|
||||
if (!EngineHelpers::isBcs(engineType)) {
|
||||
commandStreamReceiver->addAdditionalAllocationForResidency(kernelEotWaAllocation);
|
||||
}
|
||||
}
|
||||
commandStreamReceivers.push_back(std::move(commandStreamReceiver));
|
||||
|
||||
return true;
|
||||
|
||||
@@ -202,7 +202,6 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
|
||||
uintptr_t specializedDevice = reinterpret_cast<uintptr_t>(nullptr);
|
||||
|
||||
GraphicsAllocation *kernelEotWaAllocation = nullptr;
|
||||
GraphicsAllocation *rtMemoryBackedBuffer = nullptr;
|
||||
std::vector<GraphicsAllocation *> rtDispatchGlobals;
|
||||
struct {
|
||||
|
||||
@@ -67,9 +67,6 @@ void RootDevice::initializeRootCommandStreamReceiver() {
|
||||
rootCommandStreamReceiver->initializeTagAllocation();
|
||||
rootCommandStreamReceiver->createGlobalFenceAllocation();
|
||||
rootCommandStreamReceiver->createWorkPartitionAllocation(*this);
|
||||
if (kernelEotWaAllocation) {
|
||||
rootCommandStreamReceiver->addAdditionalAllocationForResidency(kernelEotWaAllocation);
|
||||
}
|
||||
commandStreamReceivers.push_back(std::move(rootCommandStreamReceiver));
|
||||
|
||||
EngineControl engine{commandStreamReceivers.back().get(), osContext};
|
||||
|
||||
@@ -237,11 +237,7 @@ bool GfxPartition::init(uint64_t gpuAddressSpace, size_t cpuAddressRangeSizeToRe
|
||||
heapInitExternalWithFrontWindow(HeapAssigner::mapExternalWindowIndex(heap), heapAllocate(heap, externalFrontWindowSize),
|
||||
externalFrontWindowSize);
|
||||
} else if (HeapAssigner::isInternalHeap(heap)) {
|
||||
auto heapSize = gfxHeap32Size;
|
||||
if (DebugManager.flags.EnableEotWa.get()) {
|
||||
heapSize = 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k;
|
||||
}
|
||||
heapInitWithFrontWindow(heap, gfxBase, heapSize, GfxPartition::internalFrontWindowPoolSize);
|
||||
heapInitWithFrontWindow(heap, gfxBase, gfxHeap32Size, GfxPartition::internalFrontWindowPoolSize);
|
||||
heapInitFrontWindow(HeapAssigner::mapInternalWindowIndex(heap), gfxBase, GfxPartition::internalFrontWindowPoolSize);
|
||||
} else {
|
||||
heapInit(heap, gfxBase, gfxHeap32Size);
|
||||
|
||||
@@ -434,9 +434,8 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo
|
||||
}
|
||||
|
||||
allocationData.hostPtr = hostPtr;
|
||||
if ((properties.allocationType == AllocationType::KERNEL_ISA ||
|
||||
properties.allocationType == AllocationType::KERNEL_ISA_INTERNAL) &&
|
||||
properties.gpuAddress == 0) {
|
||||
if (properties.allocationType == AllocationType::KERNEL_ISA ||
|
||||
properties.allocationType == AllocationType::KERNEL_ISA_INTERNAL) {
|
||||
allocationData.size = properties.size + hwHelper.getPaddingForISAAllocation();
|
||||
} else {
|
||||
allocationData.size = properties.size;
|
||||
|
||||
@@ -617,13 +617,8 @@ DrmAllocation *DrmMemoryManager::allocate32BitGraphicsMemoryImpl(const Allocatio
|
||||
size_t alignedAllocationSize = alignUp(allocationData.size, MemoryConstants::pageSize);
|
||||
auto allocationSize = alignedAllocationSize;
|
||||
auto gfxPartition = getGfxPartition(allocationData.rootDeviceIndex);
|
||||
uint64_t gpuVA;
|
||||
auto gpuVA = gfxPartition->heapAllocate(allocatorToUse, allocationSize);
|
||||
|
||||
if (GraphicsAllocation::isIsaAllocationType(allocationData.type) && allocationData.gpuAddress != 0) {
|
||||
gpuVA = allocationData.gpuAddress;
|
||||
} else {
|
||||
gpuVA = gfxPartition->heapAllocate(allocatorToUse, allocationSize);
|
||||
}
|
||||
if (!gpuVA) {
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1408,15 +1403,9 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A
|
||||
|
||||
auto sizeAllocated = sizeAligned;
|
||||
auto gfxPartition = getGfxPartition(allocationData.rootDeviceIndex);
|
||||
uint64_t gpuAddress;
|
||||
|
||||
if (GraphicsAllocation::isIsaAllocationType(allocationData.type) && allocationData.gpuAddress != 0) {
|
||||
gpuAddress = allocationData.gpuAddress;
|
||||
} else {
|
||||
gpuAddress = getGpuAddress(this->alignmentSelector, this->heapAssigner, *hwInfo,
|
||||
auto gpuAddress = getGpuAddress(this->alignmentSelector, this->heapAssigner, *hwInfo,
|
||||
allocationData.type, gfxPartition, sizeAllocated,
|
||||
allocationData.hostPtr, allocationData.flags.resource48Bit, allocationData.flags.use32BitFrontWindow, *gmmHelper);
|
||||
}
|
||||
auto canonizedGpuAddress = gmmHelper->canonize(gpuAddress);
|
||||
auto allocation = std::make_unique<DrmAllocation>(allocationData.rootDeviceIndex, numHandles, allocationData.type, nullptr, nullptr, canonizedGpuAddress, sizeAligned, MemoryPool::LocalMemory);
|
||||
DrmAllocation *drmAllocation = static_cast<DrmAllocation *>(allocation.get());
|
||||
|
||||
@@ -403,12 +403,7 @@ GraphicsAllocation *WddmMemoryManager::allocate32BitGraphicsMemoryImpl(const All
|
||||
CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, *hwInfo), false, {}, true);
|
||||
wddmAllocation->setDefaultGmm(gmm);
|
||||
|
||||
void *requiredGpuAddress = nullptr;
|
||||
if (GraphicsAllocation::isIsaAllocationType(allocationData.type) && allocationData.gpuAddress != 0) {
|
||||
requiredGpuAddress = reinterpret_cast<void *>(allocationData.gpuAddress);
|
||||
}
|
||||
|
||||
if (!createWddmAllocation(wddmAllocation.get(), requiredGpuAddress)) {
|
||||
if (!createWddmAllocation(wddmAllocation.get(), nullptr)) {
|
||||
delete gmm;
|
||||
freeSystemMemory(pSysMem);
|
||||
return nullptr;
|
||||
@@ -1100,10 +1095,6 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryInDevicePool(const
|
||||
}
|
||||
}
|
||||
|
||||
if (GraphicsAllocation::isIsaAllocationType(allocationData.type) && allocationData.gpuAddress != 0) {
|
||||
requiredGpuVa = reinterpret_cast<void *>(allocationData.gpuAddress);
|
||||
}
|
||||
|
||||
if (!createWddmAllocation(wddmAllocation.get(), requiredGpuVa)) {
|
||||
for (auto handleId = 0u; handleId < allocationData.storageInfo.getNumBanks(); handleId++) {
|
||||
delete wddmAllocation->getGmm(handleId);
|
||||
|
||||
@@ -65,7 +65,6 @@ class UltCommandStreamReceiver : public CommandStreamReceiverHw<GfxFamily>, publ
|
||||
using BaseClass::wasSubmittedToSingleSubdevice;
|
||||
using BaseClass::CommandStreamReceiver::activePartitions;
|
||||
using BaseClass::CommandStreamReceiver::activePartitionsConfig;
|
||||
using BaseClass::CommandStreamReceiver::additionalAllocationsForResidency;
|
||||
using BaseClass::CommandStreamReceiver::baseWaitFunction;
|
||||
using BaseClass::CommandStreamReceiver::bindingTableBaseAddressRequired;
|
||||
using BaseClass::CommandStreamReceiver::canUse4GbHeaps;
|
||||
|
||||
@@ -388,13 +388,11 @@ NTSTATUS __stdcall D3DKMTQueryResourceInfoFromNtHandle(IN OUT D3DKMT_QUERYRESOUR
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t lockedData[0x20000]{};
|
||||
|
||||
NTSTATUS __stdcall D3DKMTLock2(IN OUT D3DKMT_LOCK2 *lock2) {
|
||||
if (lock2->hAllocation == 0 || lock2->hDevice == 0) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
lock2->pData = reinterpret_cast<void *>((reinterpret_cast<uintptr_t>(lockedData) + 0x10000) & (-0xFFFF));
|
||||
lock2->pData = (void *)65536;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ class MockDevice : public RootDevice {
|
||||
using Device::getGlobalMemorySize;
|
||||
using Device::initializeCaps;
|
||||
using Device::isDebuggerActive;
|
||||
using Device::kernelEotWaAllocation;
|
||||
using Device::regularEngineGroups;
|
||||
using Device::rootCsrCreated;
|
||||
using Device::rtMemoryBackedBuffer;
|
||||
|
||||
@@ -271,7 +271,6 @@ CFEMaximumNumberOfThreads = -1
|
||||
CFEOverDispatchControl = -1
|
||||
CFELargeGRFThreadAdjustDisable = -1
|
||||
SynchronizeWalkerInWparidMode = -1
|
||||
EnableEotWa = 0
|
||||
EnableWalkerPartition = -1
|
||||
OverrideNumComputeUnitsForScratch = -1
|
||||
ForceThreadGroupDispatchSize = -1
|
||||
|
||||
@@ -98,18 +98,6 @@ HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenTimestampTypeIs32b) {
|
||||
EXPECT_EQ(expectedOffset, tag->getGlobalStartOffset());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, whenAddingAdditionalAllocationForResidencyThenItIsRegisteredInCsr) {
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
EXPECT_TRUE(csr.additionalAllocationsForResidency.empty());
|
||||
|
||||
MockGraphicsAllocation allocation{};
|
||||
csr.addAdditionalAllocationForResidency(&allocation);
|
||||
|
||||
EXPECT_EQ(1u, csr.additionalAllocationsForResidency.size());
|
||||
EXPECT_EQ(&allocation, csr.additionalAllocationsForResidency[0]);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenFlagsAreSetCorrectly) {
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
csr.initProgrammingFlags();
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
@@ -14,10 +13,8 @@
|
||||
#include "shared/test/common/mocks/mock_builtins.h"
|
||||
#include "shared/test/common/mocks/mock_compiler_interface.h"
|
||||
#include "shared/test/common/mocks/mock_compilers.h"
|
||||
#include "shared/test/common/mocks/mock_csr.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
@@ -49,84 +46,6 @@ TEST(Device, givenNoDebuggerWhenGettingDebuggerThenNullptrIsReturned) {
|
||||
EXPECT_EQ(nullptr, device->getSourceLevelDebugger());
|
||||
}
|
||||
|
||||
using DeviceKernelWaTest = ::testing::Test;
|
||||
|
||||
HWTEST_F(DeviceKernelWaTest, givenEnabledEotWaWhenCreatingDeviceThenKernelWaIsCreatedAndAddedToGpgpuCommandStreamReceiver) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableEotWa.set(true);
|
||||
|
||||
{
|
||||
UltDeviceFactory factory{1, 0};
|
||||
|
||||
auto device = factory.rootDevices[0];
|
||||
|
||||
EXPECT_NE(nullptr, device->kernelEotWaAllocation);
|
||||
|
||||
for (auto &engine : device->allEngines) {
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(engine.commandStreamReceiver);
|
||||
if (EngineHelpers::isBcs(engine.getEngineType())) {
|
||||
EXPECT_TRUE(csr->additionalAllocationsForResidency.empty());
|
||||
} else {
|
||||
EXPECT_EQ(1u, csr->additionalAllocationsForResidency.size());
|
||||
EXPECT_EQ(device->kernelEotWaAllocation, csr->additionalAllocationsForResidency[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
UltDeviceFactory factory{1, 2};
|
||||
|
||||
auto device = factory.rootDevices[0];
|
||||
|
||||
EXPECT_NE(nullptr, device->kernelEotWaAllocation);
|
||||
|
||||
for (auto &engine : device->allEngines) {
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(engine.commandStreamReceiver);
|
||||
if (EngineHelpers::isBcs(engine.getEngineType())) {
|
||||
EXPECT_TRUE(csr->additionalAllocationsForResidency.empty());
|
||||
} else {
|
||||
EXPECT_EQ(1u, csr->additionalAllocationsForResidency.size());
|
||||
EXPECT_EQ(device->kernelEotWaAllocation, csr->additionalAllocationsForResidency[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceKernelWaTest, givenEnabledEotWaWhenCreatingDeviceThenKernelWaIsCreatedWithProperContentAndGpuAddress) {
|
||||
if (is32bit) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableEotWa.set(true);
|
||||
DebugManager.flags.EnableLocalMemory.set(false);
|
||||
|
||||
VariableBackup<decltype(DeviceFactory::createRootDeviceFunc)> createRootDeviceFuncBackup{&DeviceFactory::createRootDeviceFunc};
|
||||
createRootDeviceFuncBackup = [](ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) -> std::unique_ptr<Device> {
|
||||
return std::unique_ptr<Device>(MockDevice::create<MockDevice>(&executionEnvironment, rootDeviceIndex));
|
||||
};
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||
ultHwConfig.forceOsAgnosticMemoryManager = false;
|
||||
|
||||
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), true, 1);
|
||||
auto devices = DeviceFactory::createDevices(*executionEnvironment);
|
||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||
|
||||
auto device = static_cast<MockDevice *>(devices[0].get());
|
||||
|
||||
EXPECT_NE(nullptr, device->kernelEotWaAllocation);
|
||||
|
||||
auto heapBase = memoryManager->getGfxPartition(device->getRootDeviceIndex())->getHeapBase(HeapIndex::HEAP_INTERNAL);
|
||||
auto expectedGpuAddress = device->getGmmHelper()->canonize(heapBase + MemoryConstants::gigaByte * 4 - MemoryConstants::pageSize64k);
|
||||
|
||||
EXPECT_EQ(device->kernelEotWaAllocation->getGpuAddress(), expectedGpuAddress);
|
||||
EXPECT_EQ(device->kernelEotWaAllocation->getUnderlyingBufferSize(), MemoryConstants::pageSize64k);
|
||||
|
||||
auto cpuPtr = device->kernelEotWaAllocation->getUnderlyingBuffer();
|
||||
uint8_t eotMemoryPattern[]{0x09, 0x0C, 0x80, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x7F, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
EXPECT_EQ(0, memcmp(ptrOffset(cpuPtr, MemoryConstants::pageSize64k - MemoryConstants::pageSize - sizeof(eotMemoryPattern)), eotMemoryPattern, sizeof(eotMemoryPattern)));
|
||||
}
|
||||
|
||||
using DeviceTest = Test<DeviceFixture>;
|
||||
|
||||
TEST_F(DeviceTest, whenInitializeRayTracingIsCalledAndRtBackedBufferIsNullptrThenMemoryBackedBufferIsCreated) {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/os_interface/os_memory.h"
|
||||
#include "shared/source/utilities/cpu_info.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_gfx_partition.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
@@ -166,24 +165,6 @@ TEST(GfxPartitionTest, GivenFullRange48BitSvmWhenTestingGfxPartitionThenAllExpec
|
||||
testGfxPartition(gfxPartition, gfxBase, gfxTop, gfxBase);
|
||||
}
|
||||
|
||||
TEST(GfxPartitionTest, GivenEnabledEotWaWhenInitializingHeapsThenInternalHeapsHave4GBMinusOnePageRange) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableEotWa.set(true);
|
||||
for (auto &addressRange : {48, 57}) {
|
||||
MockGfxPartition gfxPartition;
|
||||
gfxPartition.init(maxNBitValue(addressRange), reservedCpuAddressRangeSize, 0, 1);
|
||||
|
||||
auto expectedSize = 4 * MemoryConstants::gigaByte - MemoryConstants::pageSize64k;
|
||||
EXPECT_EQ(gfxPartition.getHeapSize(HeapIndex::HEAP_INTERNAL), expectedSize);
|
||||
EXPECT_EQ(gfxPartition.getHeapSize(HeapIndex::HEAP_INTERNAL_DEVICE_MEMORY), expectedSize);
|
||||
|
||||
auto fullSize = 4 * MemoryConstants::gigaByte;
|
||||
|
||||
EXPECT_EQ(gfxPartition.getHeapSize(HeapIndex::HEAP_EXTERNAL), fullSize);
|
||||
EXPECT_EQ(gfxPartition.getHeapSize(HeapIndex::HEAP_EXTERNAL_DEVICE_MEMORY), fullSize);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(GfxPartitionTest, GivenFullRange47BitSvmWhenTestingGfxPartitionThenAllExpectationsAreMet) {
|
||||
MockGfxPartition gfxPartition;
|
||||
gfxPartition.init(maxNBitValue(47), reservedCpuAddressRangeSize, 0, 1);
|
||||
|
||||
@@ -1512,20 +1512,6 @@ TEST_F(DrmMemoryManagerWithLocalMemoryTest, givenDrmMemoryManagerWithLocalMemory
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerWithLocalMemoryAndExplicitExpectationsTest, whenAllocatingKernelIsaWithSpecificGpuAddressThenThisAddressIsUsed) {
|
||||
uint64_t expectedGpuAddress = 0xDEADBEEFu;
|
||||
size_t size = 4096u;
|
||||
AllocationProperties properties(rootDeviceIndex, true, size, AllocationType::KERNEL_ISA, false, device->getDeviceBitfield());
|
||||
properties.gpuAddress = expectedGpuAddress;
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
EXPECT_EQ(expectedGpuAddress, graphicsAllocation->getGpuAddress());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool());
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerAndOsHandleWhenCreateIsCalledAndRootDeviceIndexIsSpecifiedThenGraphicsAllocationIsReturnedWithCorrectRootDeviceIndex) {
|
||||
mock->ioctl_expected.primeFdToHandle = 1;
|
||||
mock->ioctl_expected.gemWait = 1;
|
||||
|
||||
@@ -23,7 +23,6 @@ set(NEO_CORE_OS_INTERFACE_TESTS_WINDOWS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_address_space_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_command_stream_l0_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_mapper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_memory_manager_with_localmem_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_preemption_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_shared_allocations_test.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/wddm_special_heap_test.cpp
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(WddmMemoryManagerWithLocalMemoryTest, whenAllocatingKernelIsaWithSpecificGpuAddressThenThisAddressIsUsed) {
|
||||
if (is32bit) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||
ultHwConfig.forceOsAgnosticMemoryManager = false;
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
|
||||
auto executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), true, 1);
|
||||
auto devices = DeviceFactory::createDevices(*executionEnvironment);
|
||||
auto memoryManager = executionEnvironment->memoryManager.get();
|
||||
auto &device = devices.front();
|
||||
|
||||
uint64_t expectedGpuAddress = memoryManager->getInternalHeapBaseAddress(device->getRootDeviceIndex(), true) + MemoryConstants::gigaByte;
|
||||
size_t size = 4096u;
|
||||
|
||||
AllocationProperties properties(device->getRootDeviceIndex(), true, size, AllocationType::KERNEL_ISA, false, device->getDeviceBitfield());
|
||||
properties.gpuAddress = expectedGpuAddress;
|
||||
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
ASSERT_NE(nullptr, graphicsAllocation);
|
||||
|
||||
EXPECT_EQ(device->getGmmHelper()->canonize(expectedGpuAddress), graphicsAllocation->getGpuAddress());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, graphicsAllocation->getMemoryPool());
|
||||
memoryManager->freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
Reference in New Issue
Block a user