mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 07:44:16 +08:00
Resubmit fix for task count hang
Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c303c218be
commit
620bb970f4
@@ -98,6 +98,8 @@ NEO::SubmissionStatus CommandQueueImp::submitBatchBuffer(size_t offset, NEO::Res
|
||||
csr->setActivePartitions(partitionCount);
|
||||
auto ret = csr->submitBatchBuffer(batchBuffer, csr->getResidencyAllocations());
|
||||
if (ret != NEO::SubmissionStatus::SUCCESS) {
|
||||
commandStream->getGraphicsAllocation()->updateTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId());
|
||||
commandStream->getGraphicsAllocation()->updateResidencyTaskCount(csr->peekTaskCount(), csr->getOsContext().getContextId());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/pipe_control_args.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/memory_manager/residency_container.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
@@ -476,27 +477,37 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
|
||||
csr->setLatestFlushedTaskCount(this->taskCount);
|
||||
}
|
||||
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations());
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations(), false);
|
||||
|
||||
ze_result_t retVal = ZE_RESULT_SUCCESS;
|
||||
if (getSynchronousMode() == ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS) {
|
||||
const auto synchronizeResult = this->synchronize(std::numeric_limits<uint64_t>::max());
|
||||
if (synchronizeResult == ZE_RESULT_ERROR_DEVICE_LOST) {
|
||||
return ZE_RESULT_ERROR_DEVICE_LOST;
|
||||
retVal = ZE_RESULT_ERROR_DEVICE_LOST;
|
||||
}
|
||||
} else {
|
||||
csr->pollForCompletion();
|
||||
}
|
||||
|
||||
this->heapContainer.clear();
|
||||
|
||||
csr->pollForCompletion();
|
||||
|
||||
if (ret != NEO::SubmissionStatus::SUCCESS) {
|
||||
if (ret == NEO::SubmissionStatus::OUT_OF_MEMORY) {
|
||||
return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
if ((ret != NEO::SubmissionStatus::SUCCESS) || (retVal == ZE_RESULT_ERROR_DEVICE_LOST)) {
|
||||
for (auto &gfx : csr->getResidencyAllocations()) {
|
||||
if (csr->peekLatestFlushedTaskCount() == 0) {
|
||||
gfx->releaseUsageInOsContext(csr->getOsContext().getContextId());
|
||||
} else {
|
||||
gfx->updateTaskCount(csr->peekLatestFlushedTaskCount(), csr->getOsContext().getContextId());
|
||||
}
|
||||
}
|
||||
if (retVal != ZE_RESULT_ERROR_DEVICE_LOST) {
|
||||
retVal = ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
if (ret == NEO::SubmissionStatus::OUT_OF_MEMORY) {
|
||||
retVal = ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
}
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
csr->getResidencyAllocations().clear();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
|
||||
Reference in New Issue
Block a user