mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
refactor(sysman): Changes in the scheduler module w.r.t Xe driver
While setting the Scheduler Timeout and Exclusive Modes with the xe driver, the unsupported feature error is returned. Related-To: NEO-10112 Signed-off-by: Bari, Pratik <pratik.bari@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1d74279757
commit
77beaac80c
@@ -121,36 +121,11 @@ ze_result_t LinuxSchedulerImp::getCurrentMode(zes_sched_mode_t *pMode) {
|
||||
if (timeout > 0) {
|
||||
*pMode = ZES_SCHED_MODE_TIMEOUT;
|
||||
} else {
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->getSysmanKmdInterface();
|
||||
if (pSysmanKmdInterface->useDefaultMaximumWatchdogTimeoutForExclusiveMode()) {
|
||||
|
||||
uint64_t defaultHeartbeatInterval = 0;
|
||||
result = readSchedulerValueFromSysfs(SysfsName::sysfsNameSchedulerWatchDogTimeoutMaximum,
|
||||
pLinuxSysmanImp, subdeviceId, true,
|
||||
listOfEngines, engineType, defaultHeartbeatInterval);
|
||||
if (result != ZE_RESULT_SUCCESS) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get default heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// If default maximum value is used, then heartbeat is expected to be
|
||||
// set to the default maximum
|
||||
if (heartbeat == defaultHeartbeatInterval) {
|
||||
*pMode = ZES_SCHED_MODE_EXCLUSIVE;
|
||||
} else {
|
||||
*pMode = ZES_SCHED_MODE_FORCE_UINT32;
|
||||
result = ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
if (heartbeat == 0) {
|
||||
*pMode = ZES_SCHED_MODE_EXCLUSIVE;
|
||||
} else {
|
||||
if (heartbeat == 0) {
|
||||
// If we are here, it means heartbeat = 0, timeout = 0, timeslice = 0.
|
||||
*pMode = ZES_SCHED_MODE_EXCLUSIVE;
|
||||
} else {
|
||||
// If we are here it means heartbeat > 0, timeout = 0, timeslice = 0.
|
||||
// And we dont know what that mode is.
|
||||
*pMode = ZES_SCHED_MODE_FORCE_UINT32;
|
||||
result = ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
*pMode = ZES_SCHED_MODE_FORCE_UINT32;
|
||||
result = ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,23 +144,20 @@ ze_result_t LinuxSchedulerImp::setExclusiveModeImp() {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to set timeslice duration and returning error:0x%x \n", __FUNCTION__, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->getSysmanKmdInterface();
|
||||
if (pSysmanKmdInterface->useDefaultMaximumWatchdogTimeoutForExclusiveMode()) {
|
||||
|
||||
result = readSchedulerValueFromSysfs(SysfsName::sysfsNameSchedulerWatchDogTimeoutMaximum,
|
||||
pLinuxSysmanImp, subdeviceId, true,
|
||||
listOfEngines, engineType, heartbeat);
|
||||
if (result != ZE_RESULT_SUCCESS) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error@ %s(): Failed to get default heartbeat interval and returning error:0x%x \n", __FUNCTION__, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
result = setHeartbeatInterval(heartbeat);
|
||||
if (result != ZE_RESULT_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ze_result_t LinuxSchedulerImp::setExclusiveMode(ze_bool_t *pNeedReload) {
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->getSysmanKmdInterface();
|
||||
if (pSysmanKmdInterface->isSettingExclusiveModeSupported() == false) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
*pNeedReload = false;
|
||||
|
||||
zes_sched_mode_t currMode;
|
||||
@@ -237,6 +209,12 @@ ze_result_t LinuxSchedulerImp::getTimesliceModeProperties(ze_bool_t getDefaults,
|
||||
}
|
||||
|
||||
ze_result_t LinuxSchedulerImp::setTimeoutMode(zes_sched_timeout_properties_t *pProperties, ze_bool_t *pNeedReload) {
|
||||
|
||||
auto pSysmanKmdInterface = pLinuxSysmanImp->getSysmanKmdInterface();
|
||||
if (pSysmanKmdInterface->isSettingTimeoutModeSupported() == false) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
*pNeedReload = false;
|
||||
zes_sched_mode_t currMode;
|
||||
ze_result_t result = getCurrentMode(&currMode);
|
||||
|
||||
@@ -121,7 +121,6 @@ class SysmanKmdInterface {
|
||||
ProcFsAccessInterface *getProcFsAccess();
|
||||
SysFsAccessInterface *getSysFsAccess();
|
||||
virtual std::string getEngineBasePath(uint32_t subDeviceId) const = 0;
|
||||
virtual bool useDefaultMaximumWatchdogTimeoutForExclusiveMode() = 0;
|
||||
virtual ze_result_t getNumEngineTypeAndInstances(std::map<zes_engine_type_flag_t, std::vector<std::string>> &mapOfEngines,
|
||||
LinuxSysmanImp *pLinuxSysmanImp,
|
||||
SysFsAccessInterface *pSysfsAccess,
|
||||
@@ -142,6 +141,8 @@ class SysmanKmdInterface {
|
||||
virtual bool isTdpFrequencyAvailable() const = 0;
|
||||
virtual bool isPhysicalMemorySizeSupported() const = 0;
|
||||
virtual void getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) = 0;
|
||||
virtual bool isSettingTimeoutModeSupported() const = 0;
|
||||
virtual bool isSettingExclusiveModeSupported() const = 0;
|
||||
|
||||
protected:
|
||||
std::unique_ptr<FsAccessInterface> pFsAccess;
|
||||
@@ -176,7 +177,6 @@ class SysmanKmdInterfaceI915Upstream : public SysmanKmdInterface, SysmanKmdInter
|
||||
bool clientInfoAvailableInFdInfo() const override { return false; }
|
||||
bool isGroupEngineInterfaceAvailable() const override { return false; }
|
||||
std::string getEngineBasePath(uint32_t subDeviceId) const override;
|
||||
bool useDefaultMaximumWatchdogTimeoutForExclusiveMode() override { return false; };
|
||||
ze_result_t getNumEngineTypeAndInstances(std::map<zes_engine_type_flag_t, std::vector<std::string>> &mapOfEngines,
|
||||
LinuxSysmanImp *pLinuxSysmanImp,
|
||||
SysFsAccessInterface *pSysfsAccess,
|
||||
@@ -192,6 +192,8 @@ class SysmanKmdInterfaceI915Upstream : public SysmanKmdInterface, SysmanKmdInter
|
||||
bool isTdpFrequencyAvailable() const override { return true; }
|
||||
bool isPhysicalMemorySizeSupported() const override { return false; }
|
||||
void getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) override;
|
||||
bool isSettingTimeoutModeSupported() const override { return true; }
|
||||
bool isSettingExclusiveModeSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
@@ -223,7 +225,6 @@ class SysmanKmdInterfaceI915Prelim : public SysmanKmdInterface, SysmanKmdInterfa
|
||||
bool clientInfoAvailableInFdInfo() const override { return false; }
|
||||
bool isGroupEngineInterfaceAvailable() const override { return true; }
|
||||
std::string getEngineBasePath(uint32_t subDeviceId) const override;
|
||||
bool useDefaultMaximumWatchdogTimeoutForExclusiveMode() override { return false; };
|
||||
ze_result_t getNumEngineTypeAndInstances(std::map<zes_engine_type_flag_t, std::vector<std::string>> &mapOfEngines,
|
||||
LinuxSysmanImp *pLinuxSysmanImp,
|
||||
SysFsAccessInterface *pSysfsAccess,
|
||||
@@ -239,6 +240,8 @@ class SysmanKmdInterfaceI915Prelim : public SysmanKmdInterface, SysmanKmdInterfa
|
||||
bool isTdpFrequencyAvailable() const override { return true; }
|
||||
bool isPhysicalMemorySizeSupported() const override { return true; }
|
||||
void getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) override;
|
||||
bool isSettingTimeoutModeSupported() const override { return true; }
|
||||
bool isSettingExclusiveModeSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
@@ -270,7 +273,6 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
bool isStandbyModeControlAvailable() const override { return false; }
|
||||
bool clientInfoAvailableInFdInfo() const override { return true; }
|
||||
bool isGroupEngineInterfaceAvailable() const override { return true; }
|
||||
bool useDefaultMaximumWatchdogTimeoutForExclusiveMode() override { return true; };
|
||||
ze_result_t getNumEngineTypeAndInstances(std::map<zes_engine_type_flag_t, std::vector<std::string>> &mapOfEngines,
|
||||
LinuxSysmanImp *pLinuxSysmanImp,
|
||||
SysFsAccessInterface *pSysfsAccess,
|
||||
@@ -288,6 +290,8 @@ class SysmanKmdInterfaceXe : public SysmanKmdInterface {
|
||||
|
||||
// Wedged state is not supported in XE.
|
||||
void getWedgedStatus(LinuxSysmanImp *pLinuxSysmanImp, zes_device_state_t *pState) override{};
|
||||
bool isSettingTimeoutModeSupported() const override { return false; }
|
||||
bool isSettingExclusiveModeSupported() const override { return false; }
|
||||
|
||||
protected:
|
||||
std::map<SysfsName, valuePair> sysfsNameToFileMap;
|
||||
|
||||
Reference in New Issue
Block a user