Set cooperative flag for debuggable contexts during creation

Related-To: NEO-6668

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2022-02-10 21:15:09 +00:00
committed by Compute-Runtime-Automation
parent cd9cc53159
commit b71a12c252
5 changed files with 81 additions and 5 deletions

View File

@@ -45,19 +45,24 @@ void OsContextLinux::initializeContext() {
this->drmVmIds.resize(deviceBitfield.size(), 0);
}
const auto numberOfCCS = drm.getRootDeviceEnvironment().getHardwareInfo()->gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
const bool debuggableContext = drm.isContextDebugSupported() && drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled() && !isInternalEngine();
const bool debuggableContextCooperative = debuggableContext && numberOfCCS > 0;
for (auto deviceIndex = 0u; deviceIndex < deviceBitfield.size(); deviceIndex++) {
if (deviceBitfield.test(deviceIndex)) {
auto drmVmId = drm.getVirtualMemoryAddressSpace(deviceIndex);
auto drmContextId = drm.createDrmContext(drmVmId, drm.isVmBindAvailable(), isCooperativeEngine());
auto drmContextId = drm.createDrmContext(drmVmId, drm.isVmBindAvailable(), isCooperativeEngine() || debuggableContextCooperative);
if (drm.areNonPersistentContextsSupported()) {
drm.setNonPersistentContext(drmContextId);
}
if (drm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled()) {
drm.setUnrecoverableContext(drmContextId);
if (!isInternalEngine()) {
drm.setContextDebugFlag(drmContextId);
}
}
if (debuggableContext) {
drm.setContextDebugFlag(drmContextId);
}
if (drm.isPreemptionSupported() && isLowPriority()) {