mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
feature: bindless global heap with debugger
- program debugSurface's SurfaceState at the beginning of Bindless Surface State Heap - SPECIAL_SSH - ensure SPECIAL_SSH is resident Related-To: NEO-7063 Signed-off-by: Hoppe, Mateusz <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ba4c06811f
commit
5c565efe28
@@ -158,10 +158,13 @@ NEO::CompletionStamp CommandListCoreFamilyImmediate<gfxCoreFamily>::flushImmedia
|
||||
if (this->device->getL0Debugger()) {
|
||||
this->csr->makeResident(*this->device->getL0Debugger()->getSbaTrackingBuffer(this->csr->getOsContext().getContextId()));
|
||||
this->csr->makeResident(*this->device->getDebugSurface());
|
||||
if (this->device->getNEODevice()->getBindlessHeapsHelper()) {
|
||||
this->csr->makeResident(*this->device->getNEODevice()->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::SPECIAL_SSH)->getGraphicsAllocation());
|
||||
}
|
||||
}
|
||||
|
||||
NEO::Device *neoDevice = this->device->getNEODevice();
|
||||
if (neoDevice->getDebugger()) {
|
||||
if (neoDevice->getDebugger() && !neoDevice->getBindlessHeapsHelper()) {
|
||||
auto csrHw = static_cast<NEO::CommandStreamReceiverHw<GfxFamily> *>(this->csr);
|
||||
auto &sshState = csrHw->getSshState();
|
||||
bool sshDirty = sshState.updateAndCheck(ssh);
|
||||
@@ -270,10 +273,13 @@ NEO::CompletionStamp CommandListCoreFamilyImmediate<gfxCoreFamily>::flushRegular
|
||||
UNRECOVERABLE_IF(!NEO::Debugger::isDebugEnabled(this->internalUsage));
|
||||
this->csr->makeResident(*this->device->getL0Debugger()->getSbaTrackingBuffer(this->csr->getOsContext().getContextId()));
|
||||
this->csr->makeResident(*this->device->getDebugSurface());
|
||||
if (this->device->getNEODevice()->getBindlessHeapsHelper()) {
|
||||
this->csr->makeResident(*this->device->getNEODevice()->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::SPECIAL_SSH)->getGraphicsAllocation());
|
||||
}
|
||||
}
|
||||
|
||||
NEO::Device *neoDevice = this->device->getNEODevice();
|
||||
if (neoDevice->getDebugger() && this->immediateCmdListHeapSharing) {
|
||||
if (neoDevice->getDebugger() && this->immediateCmdListHeapSharing && !neoDevice->getBindlessHeapsHelper()) {
|
||||
auto csrHw = static_cast<NEO::CommandStreamReceiverHw<GfxFamily> *>(this->csr);
|
||||
auto sshStateCopy = csrHw->getSshState();
|
||||
bool sshDirty = sshStateCopy.updateAndCheck(ssh);
|
||||
|
||||
@@ -220,7 +220,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
this->containsStatelessUncachedResource = dispatchKernelArgs.requiresUncachedMocs;
|
||||
}
|
||||
|
||||
if (neoDevice->getDebugger() && !this->immediateCmdListHeapSharing) {
|
||||
if (neoDevice->getDebugger() && !this->immediateCmdListHeapSharing && !neoDevice->getBindlessHeapsHelper()) {
|
||||
auto *ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE);
|
||||
auto surfaceStateSpace = neoDevice->getDebugger()->getDebugSurfaceReservedSurfaceState(*ssh);
|
||||
auto surfaceState = GfxFamily::cmdInitRenderSurfaceState;
|
||||
|
||||
@@ -338,7 +338,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
}
|
||||
}
|
||||
|
||||
if (neoDevice->getDebugger() && !this->immediateCmdListHeapSharing) {
|
||||
if (neoDevice->getDebugger() && !this->immediateCmdListHeapSharing && !neoDevice->getBindlessHeapsHelper()) {
|
||||
auto *ssh = commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE);
|
||||
auto surfaceStateSpace = neoDevice->getDebugger()->getDebugSurfaceReservedSurfaceState(*ssh);
|
||||
auto surfaceState = GfxFamily::cmdInitRenderSurfaceState;
|
||||
|
||||
@@ -913,6 +913,9 @@ void CommandQueueHw<gfxCoreFamily>::makeDebugSurfaceResidentIfNEODebuggerActive(
|
||||
}
|
||||
UNRECOVERABLE_IF(this->device->getDebugSurface() == nullptr);
|
||||
this->csr->makeResident(*this->device->getDebugSurface());
|
||||
if (this->device->getNEODevice()->getBindlessHeapsHelper()) {
|
||||
this->csr->makeResident(*this->device->getNEODevice()->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::SPECIAL_SSH)->getGraphicsAllocation());
|
||||
}
|
||||
}
|
||||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/bindless_heaps_helper.h"
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
@@ -25,6 +26,7 @@
|
||||
#include "shared/source/helpers/ray_tracing_helper.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/helpers/topology_map.h"
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/kernel/grf_config.h"
|
||||
#include "shared/source/memory_manager/allocation_properties.h"
|
||||
#include "shared/source/memory_manager/allocations_list.h"
|
||||
@@ -56,6 +58,8 @@
|
||||
#include "level_zero/tools/source/metrics/metric.h"
|
||||
#include "level_zero/tools/source/sysman/sysman.h"
|
||||
|
||||
#include "encode_surface_state_args.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace NEO {
|
||||
@@ -1243,6 +1247,22 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool
|
||||
NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(rootDeviceEnvironment, *debugSurface),
|
||||
*neoDevice, debugSurface, 0, stateSaveAreaHeader.data(),
|
||||
stateSaveAreaHeader.size());
|
||||
if (neoDevice->getBindlessHeapsHelper()) {
|
||||
auto &gfxCoreHelper = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[debugSurface->getRootDeviceIndex()]->getHelper<NEO::GfxCoreHelper>();
|
||||
auto ssh = neoDevice->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::SPECIAL_SSH)->getCpuBase();
|
||||
NEO::EncodeSurfaceStateArgs args;
|
||||
args.outMemory = ssh;
|
||||
args.graphicsAddress = device->getDebugSurface()->getGpuAddress();
|
||||
args.size = device->getDebugSurface()->getUnderlyingBufferSize();
|
||||
args.mocs = device->getMOCS(false, false);
|
||||
args.numAvailableDevices = neoDevice->getNumGenericSubDevices();
|
||||
args.allocation = device->getDebugSurface();
|
||||
args.gmmHelper = neoDevice->getGmmHelper();
|
||||
args.useGlobalAtomics = false;
|
||||
args.areMultipleSubDevicesInContext = neoDevice->getNumGenericSubDevices() > 1;
|
||||
args.isDebuggerActive = true;
|
||||
gfxCoreHelper.encodeBufferSurfaceState(args);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &neoSubDevice : neoDevice->getSubDevices()) {
|
||||
|
||||
@@ -230,6 +230,8 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
|
||||
|
||||
auto osInterface = device->getNEODevice()->getRootDeviceEnvironment().osInterface.get();
|
||||
if (osInterface && !osInterface->isDebugAttachAvailable() && enableProgramDebugging != NEO::DebuggingMode::Disabled) {
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"Debug mode is not enabled in the system.\n");
|
||||
return ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user