From d36b8ec66d46fe1185016c6e35ee3f02df1372d7 Mon Sep 17 00:00:00 2001 From: anujshuk-amd Date: Thu, 20 Nov 2025 04:48:53 +0530 Subject: [PATCH] [rocprof-sys] Add documentation for building with multiple Python versions (#1870) * Adding support to build ROCm with Multiple Python Environments * Update install.rst * Update projects/rocprofiler-systems/docs/install/install.rst Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update projects/rocprofiler-systems/docs/install/install.rst Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Updated documentation to align with instuctions in `profiling-python-scripts.rst` --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: David Galiffi --- .../docs/install/install.rst | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/projects/rocprofiler-systems/docs/install/install.rst b/projects/rocprofiler-systems/docs/install/install.rst index c6f19fad32..2051cb7d70 100644 --- a/projects/rocprofiler-systems/docs/install/install.rst +++ b/projects/rocprofiler-systems/docs/install/install.rst @@ -111,6 +111,7 @@ while Dyninst requires TBB), and the CMake option to build the package alongside "Dyninst", "13.0", "ROCm Systems Profiler", "``ROCPROFSYS_BUILD_DYNINST`` (default: OFF)" "Libunwind", "", "ROCm Systems Profiler", "``ROCPROFSYS_BUILD_LIBUNWIND`` (default: ON)" + "Nlohmann/JSON", "", "ROCm Systems Profiler", "``ROCPROFSYS_BUILD_NLOHMANN_JSON`` (default: ON)" "SQLite", "", "ROCm Systems Profiler", "``ROCPROFSYS_BUILD_SQLITE`` (default: OFF)" "TBB", "2018.6", "Dyninst", "``ROCPROFSYS_BUILD_TBB`` (default: OFF)" "ElfUtils", "0.178", "Dyninst", "``ROCPROFSYS_BUILD_ELFUTILS`` (default: OFF)" @@ -126,6 +127,10 @@ Optional third-party packages * AMD SMI Lib for GPU monitoring * ROCprofiler SDK for GPU hardware counters and ROCm tracing +* Python + + * ``ROCPROFSYS_USE_PYTHON`` enables Python support. + * `PAPI `_ * MPI @@ -283,6 +288,23 @@ ROCm Systems Profiler on an application built against OpenMPI causes a segmentat This happens because the value of the ``MPI_COMM_WORLD`` is truncated during the function wrapping before being passed along to the underlying MPI function. +Python support within ROCm Systems Profiler +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +ROCm Systems Profiler supports profiling Python code via the ``ROCPROFSYS_USE_PYTHON`` CMake option. +Python support is enabled via the ``ROCPROFSYS_USE_PYTHON`` and the +``ROCPROFSYS_PYTHON_VERSIONS=".`` CMake options. +Alternatively, to build multiple Python versions, use +``ROCPROFSYS_PYTHON_VERSIONS=".;[.]"``, +and ``ROCPROFSYS_PYTHON_ROOT_DIRS="/path/to/version;[/path/to/version]"`` instead of just ``ROCPROFSYS_PYTHON_VERSIONS``. +When building multiple Python versions, the length of the ``ROCPROFSYS_PYTHON_VERSIONS`` +and ``ROCPROFSYS_PYTHON_ROOT_DIRS`` lists must +be the same size. + +.. code-block:: shell + cmake --preset release -D ROCPROFSYS_PYTHON_ROOT_DIRS="/usr/bin;/usr/bin" -D ROCPROFSYS_PYTHON_VERSIONS="3.10;3.12" + + ROCm Systems Profiler without ROCm ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^