mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Detect metrics library new name
Linux library name changing from libmd.so.1 to libigdmd.so.1 Related-To: LOCI-3159 Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c90f3b3c93
commit
9c1c24e35a
@@ -18,7 +18,11 @@
|
||||
|
||||
namespace L0 {
|
||||
|
||||
const char *MetricEnumeration::getMetricsDiscoveryFilename() { return "libmd.so.1"; }
|
||||
void MetricEnumeration::getMetricsDiscoveryFilename(std::vector<const char *> &names) const {
|
||||
names.clear();
|
||||
names.push_back("libigdmd.so.1");
|
||||
names.push_back("libmd.so.1");
|
||||
}
|
||||
|
||||
bool MetricEnumeration::getAdapterId(uint32_t &adapterMajor, uint32_t &adapterMinor) {
|
||||
|
||||
|
||||
@@ -91,18 +91,29 @@ ze_result_t MetricEnumeration::initialize() {
|
||||
|
||||
ze_result_t MetricEnumeration::loadMetricsDiscovery() {
|
||||
// Load library.
|
||||
hMetricsDiscovery.reset(OaMetricSourceImp::osLibraryLoadFunction(getMetricsDiscoveryFilename()));
|
||||
std::vector<const char *> libnames;
|
||||
getMetricsDiscoveryFilename(libnames);
|
||||
|
||||
// Load exported functions.
|
||||
if (hMetricsDiscovery) {
|
||||
openAdapterGroup = reinterpret_cast<MetricsDiscovery::OpenAdapterGroup_fn>(
|
||||
hMetricsDiscovery->getProcAddress("OpenAdapterGroup"));
|
||||
for (auto &name : libnames) {
|
||||
hMetricsDiscovery.reset(OaMetricSourceImp::osLibraryLoadFunction(name));
|
||||
|
||||
// Load exported functions.
|
||||
if (hMetricsDiscovery) {
|
||||
openAdapterGroup = reinterpret_cast<MetricsDiscovery::OpenAdapterGroup_fn>(
|
||||
hMetricsDiscovery->getProcAddress("OpenAdapterGroup"));
|
||||
}
|
||||
|
||||
if (openAdapterGroup == nullptr) {
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "cannot load %s exported functions\n", name);
|
||||
} else {
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "loaded %s exported functions\n", name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (openAdapterGroup == nullptr) {
|
||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr, "cannot load %s exported functions\n", MetricEnumeration::getMetricsDiscoveryFilename());
|
||||
cleanupMetricsDiscovery();
|
||||
return ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
return ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
// Return success if exported functions have been loaded.
|
||||
|
||||
@@ -28,7 +28,7 @@ struct MetricEnumeration {
|
||||
virtual bool isInitialized();
|
||||
|
||||
virtual ze_result_t loadMetricsDiscovery();
|
||||
static const char *getMetricsDiscoveryFilename();
|
||||
void getMetricsDiscoveryFilename(std::vector<const char *> &names) const;
|
||||
|
||||
protected:
|
||||
ze_result_t initialize();
|
||||
|
||||
@@ -75,7 +75,7 @@ bool OaMetricSourceImp::loadDependencies() {
|
||||
// Set metric context initialization state.
|
||||
setInitializationState(result
|
||||
? ZE_RESULT_SUCCESS
|
||||
: ZE_RESULT_ERROR_UNKNOWN);
|
||||
: ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,10 @@
|
||||
|
||||
namespace L0 {
|
||||
|
||||
const char *MetricEnumeration::getMetricsDiscoveryFilename() { return METRICS_DISCOVERY_NAME; }
|
||||
void MetricEnumeration::getMetricsDiscoveryFilename(std::vector<const char *> &names) const {
|
||||
names.clear();
|
||||
names.push_back(METRICS_DISCOVERY_NAME);
|
||||
}
|
||||
|
||||
bool MetricEnumeration::getAdapterId(uint32_t &major, uint32_t &minor) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user