fix: Check if provided CCS number is correct

Check if `ZEX_NUMBER_OF_CCS` env variable provided by the user is
correct. If it isn't then return false and print debug message.

Related-To: NEO-15230, GSD-11251
Signed-off-by: Kindracki, Jakub Tomasz <jakub.tomasz.kindracki@intel.com>
This commit is contained in:
Kindracki, Jakub Tomasz
2025-10-30 14:13:12 +00:00
committed by Compute-Runtime-Automation
parent b4983f234d
commit 94be8023dc
13 changed files with 175 additions and 27 deletions

View File

@@ -354,8 +354,10 @@ void ExecutionEnvironment::adjustCcsCountImpl(RootDeviceEnvironment *rootDeviceE
productHelper.adjustNumberOfCcs(*hwInfo);
}
void ExecutionEnvironment::adjustCcsCount() {
parseCcsCountLimitations();
bool ExecutionEnvironment::adjustCcsCount() {
if (!parseCcsCountLimitations()) {
return false;
}
for (auto rootDeviceIndex = 0u; rootDeviceIndex < rootDeviceEnvironments.size(); rootDeviceIndex++) {
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
@@ -364,32 +366,42 @@ void ExecutionEnvironment::adjustCcsCount() {
adjustCcsCountImpl(rootDeviceEnvironment.get());
}
}
return true;
}
void ExecutionEnvironment::adjustCcsCount(const uint32_t rootDeviceIndex) const {
bool ExecutionEnvironment::adjustCcsCount(const uint32_t rootDeviceIndex) const {
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
UNRECOVERABLE_IF(!rootDeviceEnvironment);
if (rootDeviceNumCcsMap.find(rootDeviceIndex) != rootDeviceNumCcsMap.end()) {
rootDeviceEnvironment->setNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex));
if (!rootDeviceEnvironment->setNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex))) {
return false;
}
} else {
adjustCcsCountImpl(rootDeviceEnvironment.get());
}
return true;
}
void ExecutionEnvironment::parseCcsCountLimitations() {
bool ExecutionEnvironment::parseCcsCountLimitations() {
const auto &numberOfCcsString = debugManager.flags.ZEX_NUMBER_OF_CCS.get();
if (numberOfCcsString.compare("default") == 0 ||
numberOfCcsString.empty()) {
return;
return true;
}
for (auto rootDeviceIndex = 0u; rootDeviceIndex < rootDeviceEnvironments.size(); rootDeviceIndex++) {
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
UNRECOVERABLE_IF(!rootDeviceEnvironment);
auto &productHelper = rootDeviceEnvironment->getHelper<ProductHelper>();
productHelper.parseCcsMode(numberOfCcsString, rootDeviceNumCcsMap, rootDeviceIndex, rootDeviceEnvironment.get());
if (!productHelper.parseCcsMode(numberOfCcsString, rootDeviceNumCcsMap, rootDeviceIndex, rootDeviceEnvironment.get())) {
return false;
}
}
return true;
}
void ExecutionEnvironment::configureNeoEnvironment() {