mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Add support for memory dumps in TBX mode with AUB dump
Related-To: NEO-4600 Change-Id: I4aa45c2745400d49e5bd92e0fc0aa76aa5df8678 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
38792dd170
commit
87d0a78095
@@ -39,7 +39,6 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::stream;
|
||||
|
||||
bool flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override;
|
||||
void makeNonResident(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
void processResidency(const ResidencyContainer &allocationsForResidency, uint32_t handleId) override;
|
||||
|
||||
@@ -67,7 +66,7 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
|
||||
uint32_t getDumpHandle();
|
||||
MOCKABLE_VIRTUAL void addContextToken(uint32_t dumpHandle);
|
||||
MOCKABLE_VIRTUAL void dumpAllocation(GraphicsAllocation &gfxAllocation);
|
||||
void dumpAllocation(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
static CommandStreamReceiver *create(const std::string &fileName, bool standalone, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
|
||||
|
||||
|
||||
@@ -758,15 +758,6 @@ void AUBCommandStreamReceiverHw<GfxFamily>::dumpAllocation(GraphicsAllocation &g
|
||||
AubAllocDump::dumpAllocation<GfxFamily>(dumpFormat, gfxAllocation, getAubStream(), getDumpHandle());
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void AUBCommandStreamReceiverHw<GfxFamily>::makeNonResident(GraphicsAllocation &gfxAllocation) {
|
||||
if (gfxAllocation.isResident(this->osContext->getContextId())) {
|
||||
dumpAllocation(gfxAllocation);
|
||||
this->getEvictionAllocations().push_back(&gfxAllocation);
|
||||
gfxAllocation.releaseResidencyInOsContext(this->osContext->getContextId());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
AubSubCaptureStatus AUBCommandStreamReceiverHw<GfxFamily>::checkAndActivateAubSubCapture(const MultiDispatchInfo &dispatchInfo) {
|
||||
auto status = subCaptureManager->checkAndActivateSubCapture(dispatchInfo);
|
||||
|
||||
@@ -61,6 +61,10 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
|
||||
virtual void setTbxWritable(bool writable, GraphicsAllocation &graphicsAllocation) = 0;
|
||||
virtual bool isTbxWritable(GraphicsAllocation &graphicsAllocation) const = 0;
|
||||
|
||||
virtual void dumpAllocation(GraphicsAllocation &gfxAllocation) = 0;
|
||||
|
||||
void makeNonResident(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
size_t getPreferredTagPoolSize() const override { return 1; }
|
||||
|
||||
aub_stream::AubManager *aubManager = nullptr;
|
||||
|
||||
@@ -90,6 +90,15 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::freeEngineInfo(AddressMa
|
||||
engineInfo.pRingBuffer = nullptr;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::makeNonResident(GraphicsAllocation &gfxAllocation) {
|
||||
if (gfxAllocation.isResident(osContext->getContextId())) {
|
||||
dumpAllocation(gfxAllocation);
|
||||
this->getEvictionAllocations().push_back(&gfxAllocation);
|
||||
gfxAllocation.releaseResidencyInOsContext(this->osContext->getContextId());
|
||||
}
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getDeviceIndex() const {
|
||||
return osContext->getDeviceBitfield().any() ? static_cast<uint32_t>(Math::log2(static_cast<uint32_t>(osContext->getDeviceBitfield().to_ulong()))) : 0u;
|
||||
|
||||
@@ -56,6 +56,8 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
MOCKABLE_VIRTUAL void submitBatchBuffer(uint64_t batchBufferGpuAddress, const void *batchBuffer, size_t batchBufferSize, uint32_t memoryBank, uint64_t entryBits, bool overrideRingHead);
|
||||
void pollForCompletion() override;
|
||||
|
||||
void dumpAllocation(GraphicsAllocation &gfxAllocation) override;
|
||||
|
||||
static CommandStreamReceiver *create(const std::string &baseName, bool withAubDump, ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
|
||||
|
||||
TbxCommandStreamReceiverHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
@@ -18,6 +19,8 @@
|
||||
|
||||
#include "opencl/source/aub/aub_center.h"
|
||||
#include "opencl/source/aub/aub_helper.h"
|
||||
#include "opencl/source/aub_mem_dump/aub_alloc_dump.h"
|
||||
#include "opencl/source/aub_mem_dump/aub_alloc_dump.inl"
|
||||
#include "opencl/source/aub_mem_dump/page_table_entry_bits.h"
|
||||
#include "opencl/source/command_stream/aub_command_stream_receiver.h"
|
||||
#include "opencl/source/command_stream/command_stream_receiver_with_aub_dump.h"
|
||||
@@ -528,4 +531,29 @@ AubSubCaptureStatus TbxCommandStreamReceiverHw<GfxFamily>::checkAndActivateAubSu
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void TbxCommandStreamReceiverHw<GfxFamily>::dumpAllocation(GraphicsAllocation &gfxAllocation) {
|
||||
if (!hardwareContextController) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EngineHelpers::isBcs(this->osContext->getEngineType())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DebugManager.flags.AUBDumpAllocsOnEnqueueReadOnly.get()) {
|
||||
if (!gfxAllocation.isAllocDumpable()) {
|
||||
return;
|
||||
}
|
||||
gfxAllocation.setAllocDumpable(false);
|
||||
}
|
||||
|
||||
auto dumpFormat = AubAllocDump::getDumpFormat(gfxAllocation);
|
||||
auto surfaceInfo = std::unique_ptr<aub_stream::SurfaceInfo>(AubAllocDump::getDumpSurfaceInfo<GfxFamily>(gfxAllocation, dumpFormat));
|
||||
if (surfaceInfo) {
|
||||
hardwareContextController->pollForCompletion();
|
||||
hardwareContextController->dumpSurface(*surfaceInfo.get());
|
||||
}
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user