fix: don't submit to gpu when device state is invalid

Related-To: NEO-8049
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-06-27 14:53:54 +00:00
committed by Compute-Runtime-Automation
parent 2383896dbb
commit c6404e6626
3 changed files with 39 additions and 7 deletions

View File

@@ -1013,7 +1013,10 @@ bool Wddm::submit(uint64_t commandBuffer, size_t size, void *commandHeader, Wddm
printf("%u: Wddm Submission with context handle %u and HwQueue handle %u\n", SysCalls::getProcessId(), submitArguments.contextHandle, submitArguments.hwQueueHandle);
}
getDeviceState();
status = getDeviceState();
if (!status) {
return false;
}
status = wddmInterface->submit(commandBuffer, size, commandHeader, submitArguments);
if (status) {
submitArguments.monitorFence->lastSubmittedFence = submitArguments.monitorFence->currentFenceValue;
@@ -1023,7 +1026,7 @@ bool Wddm::submit(uint64_t commandBuffer, size_t size, void *commandHeader, Wddm
return status;
}
void Wddm::getDeviceState() {
bool Wddm::getDeviceState() {
if (checkDeviceState) {
D3DKMT_GETDEVICESTATE getDevState = {};
NTSTATUS status = STATUS_SUCCESS;
@@ -1036,8 +1039,11 @@ void Wddm::getDeviceState() {
PRINT_DEBUG_STRING(getDevState.ExecutionState == D3DKMT_DEVICEEXECUTION_ERROR_OUTOFMEMORY, stderr, "Device execution error, out of memory %d\n", getDevState.ExecutionState);
if (status == STATUS_SUCCESS) {
DEBUG_BREAK_IF(getDevState.ExecutionState != D3DKMT_DEVICEEXECUTION_ACTIVE);
return getDevState.ExecutionState == D3DKMT_DEVICEEXECUTION_ACTIVE;
}
return false;
}
return true;
}
unsigned int Wddm::getEnablePreemptionRegValue() {

View File

@@ -209,7 +209,7 @@ class Wddm : public DriverModel {
bool createPagingQueue();
bool destroyPagingQueue();
bool destroyDevice();
void getDeviceState();
bool getDeviceState();
MOCKABLE_VIRTUAL void createPagingFenceLogger();
bool setLowPriorityContextParam(D3DKMT_HANDLE contextHandle);
bool adjustEvictNeededParameter(bool evictNeeded) {