From ea4769f604bc52a5ef31fd94b9a3ea73ed0997b7 Mon Sep 17 00:00:00 2001 From: vedithal-amd Date: Wed, 30 Jul 2025 13:52:55 -0400 Subject: [PATCH] Fix rocprof avail usage (#840) --- src/rocprof_compute_soc/soc_base.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/rocprof_compute_soc/soc_base.py b/src/rocprof_compute_soc/soc_base.py index 6c2fcdecd0..2ed4d1c295 100644 --- a/src/rocprof_compute_soc/soc_base.py +++ b/src/rocprof_compute_soc/soc_base.py @@ -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"