This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Installing ROCProfiler#

Since the ROCProfiler library, rocprof, and rocprofv2 are included as standard components of the ROCm distribution, the simplest method of installation is to perform a full installation of ROCm as described in Installation Guide. This approach is straightforward and dependable, making it suitable for most users.

Alternatively, installing ROCProfiler from the source files offers some advantages. This option is only recommended for experienced users when necessary due to the additional complexity.

Installing from source files#

The following section discusses how to install and build from the source files.

Prerequisites#

Installing ROCProfiler from the source requires:

  • AMD GPU driver for supported GPUs

  • Linux system supported by ROCm as described in System requirements

  • ROCm installed in the system

  • Packages necessary for ROCProfiler on supported Linux distributions as described in the following:

sudo apt install libudev-dev libnuma1 libnuma-dev Python3 python3-pip gcc g++ make cmake doxygen
  • RHEL 8.6 and 9.2:

yum install -y systemd-devel numactl numactl-devel Python3 python3-pip gcc gcc-g++ make cmake libatomic doxygen
  • CentOS 7:

yum install -y systemd-devel numactl numactl-devel Python3 python3-pip gcc gcc-g++ make cmake libatomic doxygen
  • SLES 15.3:

zypper in libudev-devel libnuma1 libnuma-devel Python3 python3-pip gcc gcc-g++ make cmake libatomic doxygen
  • SLES Tumbleweed:

zypper install systemd-devel libnuma1 libnuma-devel Python3 python3-pip gcc gcc-g++ make cmake libatomic doxygen
  • Python libraries such as CppHeaderParser, argparse, and sqlite3. To install the libraries based on the default Python installation on the system, use:

pip3 install cppheaderparser argparse sqlite3

Building from source#

With the dependencies installed, you can now build rocprofiler from the source code using the steps given below:

  1. After cloning the repository, you can use CMake to compile and install rocprofiler. To use CMake, set the environment variable:

    export CMAKE_PREFIX_PATH=/opt/rocm/include/hsa:/opt/rocm
    
  1. Then, build rocprofiler with a premade bash script.

    ./build.sh
    
  2. You now have two options for utilizing the newly built rocprofiler and its associated libraries.

    1. The first option involves setting an environment variable to indicate the location of the executable and libraries. This enables the system to use the new rocprof and related libraries instead of the default version.

    export LD_LIBRARY_PATH=<BUILD_LOCATION>:$LD_LIBRARY_PATH
    export PATH=<BUILD_LOCATION>/bin:$PATH
    
    1. A second option is to specify the desired location for installation of the executable and libraries if you do not want the installation process to move the executable and libraries to the default location. To specify the installation location, set environment variable:

    export CMAKE_INSTALL_PREFIX=<LOCAL INSTALL FOLDER>
    
  3. Then, to install rocprof in the build directory, run:

    cd build
    make install
    

    Note

    The Makefile is generated by CMake.