Remove wait on user fence during cmdlist destroy/reset

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-7156
This commit is contained in:
Kamil Kopryk
2022-08-03 11:05:32 +00:00
committed by Compute-Runtime-Automation
parent c694ccd637
commit 8b5c567bea
4 changed files with 29 additions and 4 deletions

View File

@ -1082,6 +1082,32 @@ HWTEST2_F(CommandListCreate, GivenGpuHangOnExecutingCommandListsWhenCreatingImme
commandList->cmdQImmediate = oldCommandQueue;
}
TEST_F(CommandListCreate, givenImmediateCommandListWhenThereIsNoEnoughSpaceForImmediateCommandThenNextCommandBufferIsUsed) {
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(productFamily, device, &desc, false, NEO::EngineGroupType::RenderCompute, returnValue));
ASSERT_NE(nullptr, commandList);
commandList->isFlushTaskSubmissionEnabled = true;
EXPECT_EQ(device, commandList->device);
EXPECT_EQ(CommandList::CommandListType::TYPE_IMMEDIATE, commandList->cmdListType);
EXPECT_NE(nullptr, commandList->cmdQImmediate);
void *srcPtr = reinterpret_cast<void *>(0x1234);
void *dstPtr = reinterpret_cast<void *>(0x2345);
// reduce available cmd buffer size, so next command can't fit in 1st and we need to use 2nd cmd buffer
size_t useSize = commandList->commandContainer.getCommandStream()->getMaxAvailableSpace() - maxImmediateCommandSize + 1;
commandList->commandContainer.getCommandStream()->getSpace(useSize);
EXPECT_EQ(1U, commandList->commandContainer.getCmdBufferAllocations().size());
auto result = commandList->appendMemoryCopy(dstPtr, srcPtr, 8, nullptr, 0, nullptr);
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(2U, commandList->commandContainer.getCmdBufferAllocations().size());
}
HWTEST2_F(CommandListCreate, GivenGpuHangOnSynchronizingWhenCreatingImmediateCommandListAndWaitingOnEventsThenDeviceLostIsReturned, IsSKL) {
ze_command_queue_desc_t desc = {};
desc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS;

View File

@ -236,7 +236,6 @@ IndirectHeap *CommandContainer::getHeapWithRequiredSizeAndAlignment(HeapType hea
void CommandContainer::handleCmdBufferAllocations(size_t startIndex) {
for (size_t i = startIndex; i < cmdBufferAllocations.size(); i++) {
if (this->reusableAllocationList) {
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
} else {
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);

View File

@ -35,7 +35,7 @@ enum class ErrorCode {
class CommandContainer : public NonCopyableOrMovableClass {
public:
static constexpr size_t defaultListCmdBufferSize = MemoryConstants::kiloByte * 256;
static constexpr size_t defaultListCmdBufferSize = 1u * MemoryConstants ::megaByte;
static constexpr size_t cmdBufferReservedSize = MemoryConstants::cacheLineSize +
CSRequirements::csOverfetchSize;
static constexpr size_t totalCmdBufferSize = defaultListCmdBufferSize + cmdBufferReservedSize;

View File

@ -219,7 +219,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndReset
auto cmdBuffer1 = cmdBufferAllocs[1];
cmdContainer->reset();
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 1u);
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u);
EXPECT_EQ(cmdBufferAllocs.size(), 1u);
EXPECT_EQ(cmdBufferAllocs[0], cmdBuffer0);
EXPECT_FALSE(allocList.peekIsEmpty());
@ -231,7 +231,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndReset
EXPECT_TRUE(allocList.peekIsEmpty());
cmdContainer.reset();
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 3u);
EXPECT_EQ(memoryManager->handleFenceCompletionCalled, 0u);
EXPECT_FALSE(allocList.peekIsEmpty());
allocList.freeAllGraphicsAllocations(pDevice);
}