Fix rocprof avail usage (#840)
This commit is contained in:
@@ -517,6 +517,14 @@ class OmniSoC_Base:
|
||||
rocprof_counters.update(counters)
|
||||
|
||||
elif str(rocprof_cmd) == "rocprofiler-sdk":
|
||||
# Point to rocprofiler sdk counter definition
|
||||
old_rocprofiler_metrics_path = os.environ.get("ROCPROFILER_METRICS_PATH")
|
||||
os.environ["ROCPROFILER_METRICS_PATH"] = str(
|
||||
Path(self.get_args().rocprofiler_sdk_library_path)
|
||||
.resolve()
|
||||
.parent.parent.joinpath("share", "rocprofiler-sdk")
|
||||
)
|
||||
|
||||
sys.path.append(
|
||||
str(
|
||||
Path(self.get_args().rocprofiler_sdk_library_path).parent.parent
|
||||
@@ -527,7 +535,7 @@ class OmniSoC_Base:
|
||||
|
||||
avail.loadLibrary.libname = str(
|
||||
Path(self.get_args().rocprofiler_sdk_library_path).parent.parent
|
||||
/ "libexec"
|
||||
/ "lib"
|
||||
/ "rocprofiler-sdk"
|
||||
/ "librocprofv3-list-avail.so"
|
||||
)
|
||||
@@ -550,6 +558,12 @@ class OmniSoC_Base:
|
||||
counters, _ = self.parse_counters_text(counter_defs_contents)
|
||||
rocprof_counters.update(counters)
|
||||
|
||||
# Reset env. var.
|
||||
if old_rocprofiler_metrics_path is None:
|
||||
del os.environ["ROCPROFILER_METRICS_PATH"]
|
||||
else:
|
||||
os.environ["ROCPROFILER_METRICS_PATH"] = old_rocprofiler_metrics_path
|
||||
|
||||
else:
|
||||
console_error(
|
||||
"Incompatible profiler: %s. Supported profilers include: %s"
|
||||
|
||||
Reference in New Issue
Block a user