feature: new heuristic to enable relaxed ordering

Related-To: GSD-10308

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-12-06 16:02:20 +00:00
committed by Compute-Runtime-Automation
parent 75139d2322
commit 526f9c5e81
11 changed files with 214 additions and 6 deletions

View File

@@ -377,6 +377,8 @@ class CommandStreamReceiver {
return false;
}
virtual uint32_t getDirectSubmissionRelaxedOrderingQueueDepth() const { return 0; }
virtual bool isKmdWaitOnTaskCountAllowed() const {
return false;
}

View File

@@ -156,6 +156,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
}
bool directSubmissionRelaxedOrderingEnabled() const override;
uint32_t getDirectSubmissionRelaxedOrderingQueueDepth() const override;
void stopDirectSubmission(bool blocking) override;

View File

@@ -966,6 +966,18 @@ bool CommandStreamReceiverHw<GfxFamily>::bcsRelaxedOrderingAllowed(const BlitPro
(blitPropertiesContainer.size() == 1) && !hasStallingCmds;
}
template <typename GfxFamily>
uint32_t CommandStreamReceiverHw<GfxFamily>::getDirectSubmissionRelaxedOrderingQueueDepth() const {
if (directSubmission.get()) {
return directSubmission->getRelaxedOrderingQueueSize();
}
if (blitterDirectSubmission.get()) {
return blitterDirectSubmission->getRelaxedOrderingQueueSize();
}
return 0;
}
template <typename GfxFamily>
TaskCountType CommandStreamReceiverHw<GfxFamily>::flushBcsTask(const BlitPropertiesContainer &blitPropertiesContainer, bool blocking, bool profilingEnabled, Device &device) {
auto lock = obtainUniqueOwnership();

View File

@@ -452,6 +452,8 @@ DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrdering, -1, "-1: defaul
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingForBcs, -1, "-1: default, 0 - disable, 1 - enable. If set, enable RelaxedOrdering feature for BCS engine")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingQueueSizeLimit, -1, "-1: default, >0: Max gpu queue size. If limit is reached, scheduler wont consume new work")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingMinNumberOfClients, -1, "-1: default, >0: Enables RelaxedOrdering mode only if specified number of clients is assigned to given CSR.")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingCounterHeuristic, -1, "-1: default, 0: disabled, 1: enabled. If set use counter based heuristic to allow for relaxed ordering dispatch")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionRelaxedOrderingCounterHeuristicTreshold, -1, "-1: default, >0: limit number of append calls to disable relaxed ordering dispatch")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionMonitorFenceInputPolicy, -1, "-1: default, 0: stalling command flag, 1: explicit monitor fence flag. Selects policy to dispatch monitor fence upon input flag, either for every stalling command or explicit motor fence dispatch")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionPrintSemaphoreUsage, -1, "-1: default, 0: disabled, 1: enabled. If set, print DirectSubmission semaphore programming and unlocking")
DECLARE_DEBUG_VARIABLE(int32_t, DirectSubmissionSwitchSemaphoreMode, -1, "-1: default, 1: enable switch on unsuccessful, 0: disable switch on unsuccessful")

View File

@@ -103,6 +103,7 @@ class DirectSubmissionHw {
}
virtual void unblockPagingFenceSemaphore(uint64_t pagingFenceValue){};
uint32_t getRelaxedOrderingQueueSize() const { return currentRelaxedOrderingQueueSize; }
protected:
static constexpr size_t prefetchSize = 8 * MemoryConstants::cacheLineSize;