mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Revert "fix: Fail device init if kernel debugging is misconfigured"
This reverts commit b0c92ea425.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
406048f43c
commit
6ee39ed94c
@@ -138,9 +138,7 @@ bool Device::createDeviceImpl() {
|
||||
}
|
||||
|
||||
// initialize common resources once
|
||||
if (!initializeCommonResources()) {
|
||||
return false;
|
||||
}
|
||||
initializeCommonResources();
|
||||
}
|
||||
|
||||
// create engines
|
||||
@@ -174,14 +172,15 @@ bool Device::initDeviceWithEngines() {
|
||||
return createEngines();
|
||||
}
|
||||
|
||||
bool Device::initializeCommonResources() {
|
||||
void Device::initializeCommonResources() {
|
||||
if (getExecutionEnvironment()->isDebuggingEnabled()) {
|
||||
const auto rootDeviceIndex = getRootDeviceIndex();
|
||||
auto rootDeviceEnvironment = getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
|
||||
rootDeviceEnvironment->initDebuggerL0(this);
|
||||
if (rootDeviceEnvironment->debugger == nullptr) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Debug mode is not enabled in the system.\n");
|
||||
return false;
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"Debug mode is not enabled in the system.\n");
|
||||
getExecutionEnvironment()->setDebuggingMode(DebuggingMode::disabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +209,6 @@ bool Device::initializeCommonResources() {
|
||||
deviceUsmMemAllocPoolsManager.reset(new UsmMemAllocPoolsManager(getMemoryManager(), rootDeviceIndices, deviceBitfields, this, InternalMemoryType::deviceUnifiedMemory));
|
||||
}
|
||||
initUsmReuseMaxSize();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Device::initUsmReuseMaxSize() {
|
||||
|
||||
@@ -277,7 +277,7 @@ class Device : public ReferenceTrackedObject<Device>, NEO::NonCopyableAndNonMova
|
||||
|
||||
MOCKABLE_VIRTUAL bool createDeviceImpl();
|
||||
bool initDeviceWithEngines();
|
||||
bool initializeCommonResources();
|
||||
void initializeCommonResources();
|
||||
bool initDeviceFully();
|
||||
void initUsmReuseMaxSize();
|
||||
virtual bool createEngines();
|
||||
|
||||
@@ -19,12 +19,7 @@ std::unique_ptr<NEO::Debugger> DebuggerL0::create(NEO::Device *device) {
|
||||
return nullptr;
|
||||
}
|
||||
auto osInterface = device->getRootDeviceEnvironment().osInterface.get();
|
||||
if (!osInterface) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!osInterface->isDebugAttachAvailable()) {
|
||||
auto cardName = osInterface->getDriverModel()->as<Drm>()->getSysFsPciPathBaseName();
|
||||
IoFunctions::fprintf(stderr, "Kernel debug mode is not enabled for %s. Device is not available for use\n", cardName.c_str());
|
||||
if (!osInterface || !osInterface->isDebugAttachAvailable()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,15 +179,6 @@ int Drm::getEnabledPooledEu(int &enabled) {
|
||||
return getParamIoctl(DrmParam::paramHasPooledEu, &enabled);
|
||||
}
|
||||
|
||||
std::string Drm::getSysFsPciPathBaseName() {
|
||||
auto fullPath = getSysFsPciPath();
|
||||
size_t pos = fullPath.rfind("/");
|
||||
if (std::string::npos == pos) {
|
||||
return fullPath;
|
||||
}
|
||||
return fullPath.substr(pos + 1, std::string::npos);
|
||||
}
|
||||
|
||||
std::string Drm::getSysFsPciPath() {
|
||||
std::string path = std::string(Os::sysFsPciPathPrefix) + hwDeviceId->getPciPath() + "/drm";
|
||||
std::string expectedFilePrefix = path + "/card";
|
||||
|
||||
@@ -264,7 +264,6 @@ class Drm : public DriverModel {
|
||||
void cleanup() override;
|
||||
bool readSysFsAsString(const std::string &relativeFilePath, std::string &readString);
|
||||
MOCKABLE_VIRTUAL std::string getSysFsPciPath();
|
||||
MOCKABLE_VIRTUAL std::string getSysFsPciPathBaseName();
|
||||
std::unique_ptr<HwDeviceIdDrm> &getHwDeviceId() { return hwDeviceId; }
|
||||
|
||||
template <typename DataType>
|
||||
|
||||
Reference in New Issue
Block a user