mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
fix: set debugSurface in subdevices
Related-To: NEO-10681 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
571d703135
commit
c4306a13b2
@@ -272,15 +272,9 @@ void Device::initializeCommonResources() {
|
||||
debugSurfaceSize = NEO::SipKernel::getSipKernel(*this, nullptr).getStateSaveAreaSize(this);
|
||||
}
|
||||
|
||||
const bool allocateDebugSurface = getL0Debugger();
|
||||
if (allocateDebugSurface) {
|
||||
debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties(
|
||||
{getRootDeviceIndex(), true,
|
||||
debugSurfaceSize,
|
||||
NEO::AllocationType::debugContextSaveArea,
|
||||
false,
|
||||
false,
|
||||
getDeviceBitfield()});
|
||||
const bool isDebugSurfaceRequired = getL0Debugger();
|
||||
if (isDebugSurfaceRequired) {
|
||||
allocateDebugSurface(debugSurfaceSize);
|
||||
}
|
||||
|
||||
if (ApiSpecificConfig::isDeviceUsmPoolingEnabled() &&
|
||||
@@ -467,7 +461,23 @@ void Device::createSecondaryContexts(const EngineControl &primaryEngine, Seconda
|
||||
}
|
||||
|
||||
primaryEngine.osContext->setContextGroup(true);
|
||||
};
|
||||
}
|
||||
|
||||
void Device::allocateDebugSurface(size_t debugSurfaceSize) {
|
||||
this->debugSurface = getMemoryManager()->allocateGraphicsMemoryWithProperties(
|
||||
{getRootDeviceIndex(), true,
|
||||
debugSurfaceSize,
|
||||
NEO::AllocationType::debugContextSaveArea,
|
||||
false,
|
||||
false,
|
||||
getDeviceBitfield()});
|
||||
|
||||
for (auto &subdevice : this->subdevices) {
|
||||
if (subdevice) {
|
||||
subdevice->debugSurface = this->debugSurface;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Device::addEngineToEngineGroup(EngineControl &engine) {
|
||||
auto &hardwareInfo = this->getHardwareInfo();
|
||||
|
||||
@@ -255,6 +255,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
void setAsEngineInstanced();
|
||||
void finalizeRayTracing();
|
||||
void createSecondaryContexts(const EngineControl &primaryEngine, SecondaryContexts &secondaryEnginesForType, uint32_t contextCount, uint32_t regularPriorityCount, uint32_t highPriorityContextCount);
|
||||
void allocateDebugSurface(size_t debugSurfaceSize);
|
||||
|
||||
DeviceInfo deviceInfo = {};
|
||||
|
||||
|
||||
@@ -29,6 +29,13 @@ RootDevice::RootDevice(ExecutionEnvironment *executionEnvironment, uint32_t root
|
||||
|
||||
RootDevice::~RootDevice() {
|
||||
if (getDebugSurface()) {
|
||||
|
||||
for (auto *subDevice : this->getSubDevices()) {
|
||||
if (subDevice) {
|
||||
subDevice->setDebugSurface(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
getMemoryManager()->freeGraphicsMemory(debugSurface);
|
||||
debugSurface = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user