Use correct engine group type when programming state base address

Command lists and their helper classes should use engine group type
assigned to the particular command list to check if it is RCS group
and not use default CSR class assigned to the device, since default
and current in command list might be different.

Related-To: NEO-5019

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-08-17 14:58:27 +00:00
committed by Compute-Runtime-Automation
parent dda5b19859
commit acac5ea0d5
19 changed files with 219 additions and 130 deletions

View File

@@ -12,6 +12,7 @@
#include "shared/source/command_stream/preemption.h"
#include "shared/source/debugger/debugger_l0.h"
#include "shared/source/device/device.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/blit_commands_helper.h"
#include "shared/source/helpers/heap_helper.h"
@@ -2339,8 +2340,20 @@ void CommandListCoreFamily<gfxCoreFamily>::programStateBaseAddress(NEO::CommandC
NEO::EncodeWA<GfxFamily>::addPipeControlBeforeStateBaseAddress(*commandContainer.getCommandStream(), hwInfo, isRcs);
auto gmmHelper = container.getDevice()->getRootDeviceEnvironment().getGmmHelper();
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
STATE_BASE_ADDRESS sba;
NEO::EncodeStateBaseAddress<GfxFamily>::encode(commandContainer, sba, this->partitionCount > 1);
NEO::EncodeStateBaseAddressArgs<GfxFamily> encodeStateBaseAddressArgs = {
&commandContainer,
sba,
statelessMocsIndex,
false,
this->partitionCount > 1,
isRcs};
NEO::EncodeStateBaseAddress<GfxFamily>::encode(encodeStateBaseAddressArgs);
if (NEO::Debugger::isDebugEnabled(this->internalUsage) && device->getL0Debugger()) {
NEO::Debugger::SbaAddresses sbaAddresses = {};
NEO::EncodeStateBaseAddress<GfxFamily>::setSbaAddressesForDebugger(sbaAddresses, sba);

View File

@@ -133,7 +133,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
launchParams.isCooperative, // isCooperative
false, // isHostScopeSignalEvent
false, // isKernelUsingSystemAllocation
cmdListType == CommandListType::TYPE_IMMEDIATE // isKernelDispatchedFromImmediateCmdList
cmdListType == CommandListType::TYPE_IMMEDIATE, // isKernelDispatchedFromImmediateCmdList
engineGroupType == NEO::EngineGroupType::RenderCompute // isRcs
};
NEO::EncodeDispatchKernel<GfxFamily>::encode(commandContainer, dispatchKernelArgs, getLogicalStateHelper());

View File

@@ -244,7 +244,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
launchParams.isCooperative, // isCooperative
isHostSignalScopeEvent, // isHostScopeSignalEvent
isKernelUsingSystemAllocation, // isKernelUsingSystemAllocation
cmdListType == CommandListType::TYPE_IMMEDIATE // isKernelDispatchedFromImmediateCmdList
cmdListType == CommandListType::TYPE_IMMEDIATE, // isKernelDispatchedFromImmediateCmdList
engineGroupType == NEO::EngineGroupType::RenderCompute // isRcs
};
NEO::EncodeDispatchKernel<GfxFamily>::encode(commandContainer, dispatchKernelArgs, getLogicalStateHelper());
this->containsStatelessUncachedResource = dispatchKernelArgs.requiresUncachedMocs;

View File

@@ -52,7 +52,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
auto indirectObjectHeapBaseAddress = neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), useLocalMemoryForIndirectHeap);
auto instructionHeapBaseAddress = neoDevice->getMemoryManager()->getInternalHeapBaseAddress(device->getRootDeviceIndex(), neoDevice->getMemoryManager()->isLocalMemoryUsedForIsa(neoDevice->getRootDeviceIndex()));
NEO::StateBaseAddressHelperArgs<GfxFamily> args = {
NEO::StateBaseAddressHelperArgs<GfxFamily> stateBaseAddressHelperArgs = {
gsba, // generalStateBase
indirectObjectHeapBaseAddress, // indirectObjectHeapBaseAddress
instructionHeapBaseAddress, // instructionHeapBaseAddress
@@ -72,7 +72,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
false // areMultipleSubDevicesInContext
};
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(args);
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(stateBaseAddressHelperArgs);
*sbaCmdBuf = sbaCmd;
csr->setGSBAStateDirty(false);
@@ -92,7 +92,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateStateBaseAddressCmdSize() {
using STATE_BASE_ADDRESS = typename GfxFamily::STATE_BASE_ADDRESS;
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
size_t size = sizeof(STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL) + NEO::EncodeWA<GfxFamily>::getAdditionalPipelineSelectSize(*device->getNEODevice());
size_t size = sizeof(STATE_BASE_ADDRESS) + sizeof(PIPE_CONTROL) + NEO::EncodeWA<GfxFamily>::getAdditionalPipelineSelectSize(*device->getNEODevice(), this->csr->isRcs());
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger() != nullptr) {
const size_t trackedAddressesCount = 6;

View File

@@ -43,7 +43,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
auto sbaCmdBuf = NEO::StateBaseAddressHelper<GfxFamily>::getSpaceForSbaCmd(commandStream);
STATE_BASE_ADDRESS sbaCmd;
NEO::StateBaseAddressHelperArgs<GfxFamily> args = {
NEO::StateBaseAddressHelperArgs<GfxFamily> stateBaseAddressHelperArgs = {
0, // generalStateBase
indirectObjectStateBaseAddress, // indirectObjectHeapBaseAddress
instructionStateBaseAddress, // instructionHeapBaseAddress
@@ -63,7 +63,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
false // areMultipleSubDevicesInContext
};
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(args);
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(stateBaseAddressHelperArgs);
*sbaCmdBuf = sbaCmd;
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);

View File

@@ -161,6 +161,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA
false,
false,
false,
false,
false};
NEO::EncodeDispatchKernel<FamilyType>::encode(commandContainer, dispatchKernelArgs, static_cast<CommandListCoreFamily<gfxCoreFamily> *>(commandList.get())->getLogicalStateHelper());

View File

@@ -488,6 +488,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenNotEnoughSpaceInCommandStreamWhenA
false,
false,
false,
false,
false};
NEO::EncodeDispatchKernel<FamilyType>::encode(commandContainer, dispatchKernelArgs, nullptr);