fix: detect gpu hang or page fault at direct submission flush to gpu

Related-To: NEO-8395

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-11-02 16:30:57 +00:00
committed by Compute-Runtime-Automation
parent ec24eb0a4c
commit e0ce08bb77
15 changed files with 160 additions and 4 deletions

View File

@@ -492,6 +492,8 @@ NTSTATUS __stdcall mockD3DKMTUnlock2(IN CONST D3DKMT_UNLOCK2 *unlock2) {
}
uint64_t cpuFence = 0;
uint64_t ringFence = 0;
bool useRingCpuFence = false;
static bool createSynchronizationObject2FailCall = false;
@@ -509,7 +511,11 @@ NTSTATUS __stdcall mockD3DKMTCreateSynchronizationObject2(IN OUT D3DKMT_CREATESY
monitorFenceGpuAddress += monitorFenceGpuNextAddressOffset;
synchObject->Info.MonitoredFence.FenceValueCPUVirtualAddress = &cpuFence;
if (useRingCpuFence) {
synchObject->Info.MonitoredFence.FenceValueCPUVirtualAddress = &ringFence;
} else {
synchObject->Info.MonitoredFence.FenceValueCPUVirtualAddress = &cpuFence;
}
synchObject->Info.MonitoredFence.FenceValueGPUVirtualAddress = monitorFenceGpuAddress;
synchObject->hSyncObject = 4;
return STATUS_SUCCESS;
@@ -740,7 +746,15 @@ D3DKMT_DESTROYSYNCHRONIZATIONOBJECT *getDestroySynchronizationObjectData() {
}
VOID *getMonitorFenceCpuFenceAddress() {
return &cpuFence;
if (useRingCpuFence) {
return &ringFence;
} else {
return &cpuFence;
}
}
bool *getMonitorFenceCpuAddressSelector() {
return &useRingCpuFence;
}
bool *getCreateSynchronizationObject2FailCall() {

View File

@@ -97,6 +97,7 @@ D3DKMT_DESTROYHWQUEUE *getDestroyHwQueueData();
D3DKMT_SUBMITCOMMANDTOHWQUEUE *getSubmitCommandToHwQueueData();
D3DKMT_DESTROYSYNCHRONIZATIONOBJECT *getDestroySynchronizationObjectData();
VOID *getMonitorFenceCpuFenceAddress();
bool *getMonitorFenceCpuAddressSelector();
bool *getCreateSynchronizationObject2FailCall();
bool *getFailOnSetContextSchedulingPriorityCall();
D3DKMT_SETCONTEXTSCHEDULINGPRIORITY *getSetContextSchedulingPriorityDataCall();

View File

@@ -169,6 +169,9 @@ void *MockOsLibrary::getProcAddress(const std::string &procName) {
if (procName == "getMonitorFenceCpuFenceAddress") {
return reinterpret_cast<void *>(getMonitorFenceCpuFenceAddress);
}
if (procName == "getMonitorFenceCpuAddressSelector") {
return reinterpret_cast<void *>(getMonitorFenceCpuAddressSelector);
}
if (procName == "getCreateSynchronizationObject2FailCall") {
return reinterpret_cast<void *>(getCreateSynchronizationObject2FailCall);
}