Skip to content

Commit

Permalink
Create L0 list and module with correct NEO device on explicit mode
Browse files Browse the repository at this point in the history
When implicit scaling is not used, a root device in L0 defaults to
sub-device 0. In that case, all allocations need to be made against
that sub-device.

For list and module creation, we were passing the root NEO device
instead, and we were allocating their internal allocations using
the least-occupied bank, which meant we were allocating alternately
between the two sub-devices.

This patch makes sure the NEO device used on explicit mode for
the root device is sub-device 0.

Signed-off-by: Jaime Arteaga <[email protected]>
  • Loading branch information
Jaime Arteaga authored and Compute-Runtime-Automation committed Sep 30, 2021
1 parent eb1802c commit 11980db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion level_zero/core/source/cmdlist/cmdlist_hw.inl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
}

commandContainer.setReservedSshSize(getReserveSshSize());
auto returnValue = commandContainer.initialize(static_cast<DeviceImp *>(device)->neoDevice);
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
auto returnValue = commandContainer.initialize(deviceImp->getActiveDevice());
ze_result_t returnType = parseErrorCode(returnValue);
if (returnType == ZE_RESULT_SUCCESS) {
if (!isCopyOnly()) {
Expand Down
5 changes: 3 additions & 2 deletions level_zero/core/source/kernel/kernel_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device *device
this->kernelInfo = kernelInfo;
this->kernelDescriptor = &kernelInfo->kernelDescriptor;

auto neoDevice = device->getNEODevice();
auto memoryManager = device->getNEODevice()->getMemoryManager();
DeviceImp *deviceImp = static_cast<DeviceImp *>(device);
auto neoDevice = deviceImp->getActiveDevice();
auto memoryManager = neoDevice->getMemoryManager();

auto kernelIsaSize = kernelInfo->heapInfo.KernelHeapSize;
const auto allocType = internalKernel ? NEO::GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL : NEO::GraphicsAllocation::AllocationType::KERNEL_ISA;
Expand Down

0 comments on commit 11980db

Please sign in to comment.