fix: blink ULLS light

Related-To: NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-02-21 12:11:10 +00:00
committed by Compute-Runtime-Automation
parent 681ef3693a
commit 5961850bbc
3 changed files with 76 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
bool isCompleted(uint32_t ringBufferIndex) override;
bool isCompletionFenceSupported();
bool isGpuHangDetected(std::chrono::high_resolution_clock::time_point &lastHangCheckTime);
MOCKABLE_VIRTUAL std::chrono::steady_clock::time_point getCpuTimePoint();
MOCKABLE_VIRTUAL void wait(TaskCountType taskCountToWait);
@@ -47,6 +48,9 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
TaskCountType completionFenceValue{};
std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS};
constexpr static size_t ullsLightTimeout = 2'000'000;
std::chrono::steady_clock::time_point lastUllsLightExecTimestamp{};
std::vector<BufferObject *> residency{};
std::vector<ExecObject> execObjectsStorage{};
};

View File

@@ -141,6 +141,8 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, siz
if (!allocationsForResidency) {
this->handleResidency();
} else {
this->lastUllsLightExecTimestamp = std::chrono::steady_clock::now();
}
auto currentBase = this->ringCommandStream.getGraphicsAllocation()->getGpuAddress();
@@ -212,7 +214,8 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::handleResidency() {
template <typename GfxFamily, typename Dispatcher>
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleRingRestartForUllsLightResidency(ResidencyContainer *allocationsForResidency) {
if (allocationsForResidency) {
auto restartNeeded = static_cast<DrmMemoryOperationsHandler *>(this->memoryOperationHandler)->obtainAndResetNewResourcesSinceLastRingSubmit();
auto restartNeeded = (static_cast<DrmMemoryOperationsHandler *>(this->memoryOperationHandler)->obtainAndResetNewResourcesSinceLastRingSubmit() ||
std::chrono::duration_cast<std::chrono::microseconds>(this->getCpuTimePoint() - this->lastUllsLightExecTimestamp) > std::chrono::microseconds{ullsLightTimeout});
if (restartNeeded) {
this->stopRingBuffer(false);
}
@@ -292,6 +295,11 @@ void DrmDirectSubmission<GfxFamily, Dispatcher>::wait(TaskCountType taskCountToW
}
}
template <typename GfxFamily, typename Dispatcher>
std::chrono::steady_clock::time_point DrmDirectSubmission<GfxFamily, Dispatcher>::getCpuTimePoint() {
return std::chrono::steady_clock::now();
}
template <typename GfxFamily, typename Dispatcher>
bool DrmDirectSubmission<GfxFamily, Dispatcher>::isGpuHangDetected(std::chrono::high_resolution_clock::time_point &lastHangCheckTime) {
if (!this->detectGpuHang) {