P4 to Git Change 1327404 by gandryey@gera-w8 on 2016/10/17 14:20:58

SWDEV-102761 - [CQE OCL][OpenCL on PAL] Few WF Conformance tests are stuck in middle/hardhang while running using csv file
	- Disable non-user mode queue. There is a hang and deadlock in OS if a mix of user and non-user queues is used.
	- Wait for the fence longer if PAL returned a timeout error
	- Slightly change CB warmup code to avoid PAL overhead on the first submit

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#14 edit
This commit is contained in:
foreman
2016-10-17 14:59:22 -04:00
parent 27cbd2878b
commit 1a3e93121d
4 changed files with 66 additions and 46 deletions
+19 -28
View File
@@ -187,8 +187,11 @@ VirtualGPU::Queue::flush()
}
if (palMemRefs_.size() != 0) {
iDev_->AddGpuMemoryReferences(palMemRefs_.size(), &palMemRefs_[0], iQueue_,
Pal::GpuMemoryRefCantTrim);
if (Pal::Result::Success != iDev_->AddGpuMemoryReferences(
palMemRefs_.size(), &palMemRefs_[0], iQueue_, Pal::GpuMemoryRefCantTrim)) {
LogError("PAL failed to make resident resources!");
return false;
}
}
Pal::SubmitInfo submitInfo = {};
@@ -202,11 +205,7 @@ VirtualGPU::Queue::flush()
return false;
}
if (GPU_FLUSH_ON_EXECUTION) {
if (Pal::Result::Success !=
iDev_->WaitForFences(1, &iCmdFences_[cmdBufIdSlot_], true, WaitTimeoutInNsec)) {
LogError("PAL wait for a fence failed!");
return false;
}
waifForFence(cmdBufIdSlot_);
}
// Reset the counter of commands
@@ -216,7 +215,8 @@ VirtualGPU::Queue::flush()
cmdBufIdCurrent_++;
if (cmdBufIdCurrent_ == GpuEvent::InvalidID) {
///@todo handle wrapping
// Wait for the last one
waifForFence(cmdBufIdSlot_);
cmdBufIdCurrent_ = 1;
cmbBufIdRetired_ = 0;
}
@@ -225,13 +225,8 @@ VirtualGPU::Queue::flush()
cmdBufIdSlot_ = cmdBufIdCurrent_ % MaxCmdBuffers;
// Make sure the slot isn't busy
if (Pal::Result::NotReady == iCmdFences_[cmdBufIdSlot_]->GetStatus()) {
if (Pal::Result::Success !=
iDev_->WaitForFences(1, &iCmdFences_[cmdBufIdSlot_], true, WaitTimeoutInNsec)) {
LogError("PAL wait for a fence failed!");
return false;
}
}
waifForFence(cmdBufIdSlot_);
// Progress retired TS
if ((cmdBufIdCurrent_ > MaxCmdBuffers) &&
(cmbBufIdRetired_ < (cmdBufIdCurrent_ - MaxCmdBuffers))) {
@@ -282,18 +277,10 @@ VirtualGPU::Queue::waitForEvent(uint id)
return true;
}
uint slotId = id % MaxCmdBuffers;
// Wait for the specified fence
if (Pal::Result::Success != iCmdFences_[slotId]->GetStatus()) {
if (Pal::Result::Success !=
iDev_->WaitForFences(1, &iCmdFences_[slotId], true, WaitTimeoutInNsec)) {
LogError("PAL wait for a fence failed!");
return false;
}
}
uint slotId = id % MaxCmdBuffers;
bool result = waifForFence(slotId);
cmbBufIdRetired_ = id;
return true;
return result;
}
bool
@@ -729,13 +716,17 @@ VirtualGPU::create(bool profiling, uint deviceQueueSize)
}
if (dev().numComputeEngines()) {
uint idx = index() % dev().numComputeEngines();
//! @todo There is a hang with a mix of user and non user queues.
//! Currently there is no simple way to detect which queue is what.
//! Disable first for now.
const uint firstQueue = (dev().numComputeEngines() > 2) ? 1 : 0;
uint idx = index() % (dev().numComputeEngines() - firstQueue);
// hwRing_ should be set 0 if forced to have single scratch buffer
hwRing_ = (dev().settings().useSingleScratch_) ? 0 : idx;
queues_[MainEngine] = Queue::Create(
dev().iDev(), Pal::QueueTypeCompute, idx, cmdAllocator_);
dev().iDev(), Pal::QueueTypeCompute, idx + firstQueue, cmdAllocator_);
if (nullptr == queues_[MainEngine]) {
return false;
}