mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add debug key to override CSR allocation size
Related-To: NEO-5718 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0d85f6ccc7
commit
8da0838ba4
@ -315,6 +315,23 @@ TEST(CommandStreamReceiverSimpleTest, givenCsrWhenSubmitiingBatchBufferThenTaskC
|
||||
executionEnvironment.memoryManager->freeGraphicsMemoryImpl(commandBuffer);
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverSimpleTest, givenOverrideCsrAllocationSizeWhenCreatingCommandStreamCsrGraphicsAllocationThenAllocationHasCorrectSize) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
int32_t overrideSize = 10 * MemoryConstants::pageSize;
|
||||
DebugManager.flags.OverrideCsrAllocationSize.set(overrideSize);
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment.initializeMemoryManager();
|
||||
DeviceBitfield deviceBitfield(1);
|
||||
MockCommandStreamReceiver commandStreamReceiver(executionEnvironment, 0u, deviceBitfield);
|
||||
|
||||
bool ret = commandStreamReceiver.createPreemptionAllocation();
|
||||
ASSERT_TRUE(ret);
|
||||
EXPECT_EQ(static_cast<size_t>(overrideSize), commandStreamReceiver.preemptionAllocation->getUnderlyingBufferSize());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, givenCommandStreamReceiverWhenCallingGetMemoryCompressionStateThenReturnNotApplicable) {
|
||||
CommandStreamReceiverHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
|
||||
|
@ -30,6 +30,7 @@ AUBDumpForceAllToLocalMemory = 0
|
||||
EnableSWTags = 0
|
||||
DumpSWTagsBXML = 0
|
||||
ForceDeviceId = unk
|
||||
OverrideCsrAllocationSize = -1
|
||||
ForceL1Caching = -1
|
||||
UseKmdMigration = 0
|
||||
SchedulerSimulationReturnInstance = 0
|
||||
|
@ -561,7 +561,11 @@ bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
||||
|
||||
bool CommandStreamReceiver::createPreemptionAllocation() {
|
||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
AllocationProperties properties{rootDeviceIndex, hwInfo->capabilityTable.requiredPreemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, osContext->getDeviceBitfield()};
|
||||
size_t preemptionSurfaceSize = hwInfo->capabilityTable.requiredPreemptionSurfaceSize;
|
||||
if (DebugManager.flags.OverrideCsrAllocationSize.get() > 0) {
|
||||
preemptionSurfaceSize = DebugManager.flags.OverrideCsrAllocationSize.get();
|
||||
}
|
||||
AllocationProperties properties{rootDeviceIndex, preemptionSurfaceSize, GraphicsAllocation::AllocationType::PREEMPTION, deviceBitfield};
|
||||
properties.flags.uncacheable = hwInfo->workaroundTable.waCSRUncachable;
|
||||
properties.alignment = 256 * MemoryConstants::kiloByte;
|
||||
this->preemptionAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
|
@ -95,6 +95,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, GpuScratchRegWriteRegisterData, 0, "register dat
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSlmAllocationSize, -1, "-1: default, >=0: program value for shared local memory size")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, DebuggerLogBitmask, 0, "0: logs disabled, 1 - INFO, 2 - ERROR, 1<<10 - Dump elf, see DebugVariables::DEBUGGER_LOG_BITMASK")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, DebuggerOptDisable, -1, "-1: default from debugger query, 0: do not add opt-disable, 1: add opt-disable")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideCsrAllocationSize, -1, "-1: default, >0: use value for size of CSR allocation")
|
||||
|
||||
/*LOGGING FLAGS*/
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")
|
||||
|
@ -33,6 +33,7 @@ class MockCommandStreamReceiver : public CommandStreamReceiver {
|
||||
using CommandStreamReceiver::latestFlushedTaskCount;
|
||||
using CommandStreamReceiver::latestSentTaskCount;
|
||||
using CommandStreamReceiver::newResources;
|
||||
using CommandStreamReceiver::preemptionAllocation;
|
||||
using CommandStreamReceiver::requiredThreadArbitrationPolicy;
|
||||
using CommandStreamReceiver::tagAddress;
|
||||
using CommandStreamReceiver::tagsMultiAllocation;
|
||||
|
Reference in New Issue
Block a user