mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 01:48:50 +08:00
Retry in loop when exec or bind fails with ENXIO
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8682b588bd
commit
ec13b185a3
@@ -147,24 +147,26 @@ int BufferObject::exec(uint32_t used, size_t startOffset, unsigned int flags, bo
|
||||
int ret = ioctlHelper->execBuffer(&execbuf, completionGpuAddress, completionValue);
|
||||
|
||||
if (ret != 0) {
|
||||
int err = this->drm->getErrno();
|
||||
if (err == EOPNOTSUPP) {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(I915_GEM_EXECBUFFER2) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
return err;
|
||||
}
|
||||
do {
|
||||
int err = this->drm->getErrno();
|
||||
if (err == EOPNOTSUPP) {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "ioctl(I915_GEM_EXECBUFFER2) failed with %d. errno=%d(%s)\n", ret, err, strerror(err));
|
||||
return err;
|
||||
}
|
||||
|
||||
evictUnusedAllocations(false, true);
|
||||
ret = ioctlHelper->execBuffer(&execbuf, completionGpuAddress, completionValue);
|
||||
}
|
||||
evictUnusedAllocations(false, true);
|
||||
ret = ioctlHelper->execBuffer(&execbuf, completionGpuAddress, completionValue);
|
||||
|
||||
if (ret != 0) {
|
||||
const auto status = evictUnusedAllocations(true, true);
|
||||
if (status == MemoryOperationsStatus::GPU_HANG_DETECTED_DURING_OPERATION) {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", gpuHangDetected);
|
||||
return gpuHangDetected;
|
||||
}
|
||||
if (ret != 0) {
|
||||
const auto status = evictUnusedAllocations(true, true);
|
||||
if (status == MemoryOperationsStatus::GPU_HANG_DETECTED_DURING_OPERATION) {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "Error! GPU hang detected in BufferObject::exec(). Returning %d\n", gpuHangDetected);
|
||||
return gpuHangDetected;
|
||||
}
|
||||
|
||||
ret = ioctlHelper->execBuffer(&execbuf, completionGpuAddress, completionValue);
|
||||
ret = ioctlHelper->execBuffer(&execbuf, completionGpuAddress, completionValue);
|
||||
}
|
||||
} while (ret != 0 && this->drm->getErrno() == ENXIO);
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
|
||||
Reference in New Issue
Block a user