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.

After this change if `zeInit` is called with invalid
`ZEX_NUMBER_OF_CCS`, then it fails with `ZE_RESULT_ERROR_UNINITIALIZED`.

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-11-05 13:01:04 +00:00
committed by Compute-Runtime-Automation
parent f31341fe01
commit 67963bed4b
13 changed files with 202 additions and 27 deletions

View File

@@ -246,12 +246,19 @@ BuiltIns *RootDeviceEnvironment::getBuiltIns() {
return this->builtins.get();
}
void RootDeviceEnvironment::setNumberOfCcs(uint32_t numberOfCcs) {
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = std::min(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, numberOfCcs);
bool RootDeviceEnvironment::setNumberOfCcs(uint32_t numberOfCcs) {
if (hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled < numberOfCcs || numberOfCcs == 0) {
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error: Invalid number of CCS - %u (max: %u)\n", numberOfCcs, hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
return false;
}
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = numberOfCcs;
limitedNumberOfCcs = true;
if (aubCenter) {
aubCenter->getAubManager()->setCCSMode(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
}
return true;
}
uint32_t RootDeviceEnvironment::getNumberOfCcs() const {