SWDEV-491375 - Limit the SW batch size

Applications may submit commands withoout waits
for GPU. That causes a growth of SW unreleased commands.
Make sure runtime flushes SW queue, if it grows over some
threshold, controlled by DEBUG_CLR_MAX_BATCH_SIZE.

Change-Id: Ia4d85c24210ef91c394f638ab6b53b14323a0396
Этот коммит содержится в:
German Andryeyev
2024-10-15 15:03:47 -04:00
родитель df9ae754a4
Коммит 8657a77029
4 изменённых файлов: 19 добавлений и 8 удалений
+3 -3
Просмотреть файл
@@ -66,7 +66,7 @@ bool HostQueue::terminate() {
Command* lastCommand = getLastQueuedCommand(true);
if (lastCommand != nullptr) {
// Check if CPU batch wasn't flushed for completion with the last command
if (GetSubmittionBatch() != nullptr) {
if (GetSubmissionBatch() != nullptr) {
auto command = new Marker(*this, false);
if (command != nullptr) {
ClPrint(LOG_DEBUG, LOG_CMD, "Marker queued to ensure finish");
@@ -137,13 +137,13 @@ void HostQueue::finish(bool cpu_wait) {
if (IS_HIP) {
command = getLastQueuedCommand(true);
if (command == nullptr) {
assert(GetSubmittionBatch() == nullptr &&
assert(GetSubmissionBatch() == nullptr &&
"Can't claim the queue is finished with the active batch!");
return;
}
}
// Force marker if the batch wasn't sent for CPU update or fence is dirty
if (nullptr == command || (GetSubmittionBatch() != nullptr) || vdev()->isFenceDirty()) {
if (nullptr == command || (GetSubmissionBatch() != nullptr) || vdev()->isFenceDirty()) {
if (nullptr != command) {
command->release();
}