Installing ROCm Bandwidth Test#

This topic provides information required to build and install ROCm Bandwidth Test (RBT). You can obtain RBT either by installing ROCm repository or build from source.

System requirements#

Installing ROCm repository#

The RBT tool is available through the ROCm repositories:

## For Ubuntu/Debian systems:
sudo apt-get install rocm-bandwidth-test

## Or for RHEL/CentOS/Fedora systems:
sudo yum install rocm-bandwidth-test

Building RBT from source#

Here are the steps to build RBT from source:

  1. Create a build directory in the project folder: rocm_bandwidth_test.

    mkdir ./build
    
  2. Set working directory to the new build directory.

    cd ./build
    
  3. Invoke Cmake to interpret build rules and generate native build files:

    ## Assume that ROCR Runtime has its libraries & headers are located in the path :
    ## libraries : _ABSOLUTE_PATH_TO_ROCR_LIBS_/lib
    ## headers   : _ABSOLUTE_PATH_TO_ROCR_LIBS_/include/hsa
    ## Note : Observe that both include & lib folder are under common path (_ABSOLUTE_PATH_TO_ROCR_LIBS_)
    
    ## Builds Debug or Release version
    $ pwd
    ../rocm_bandwidth_test/build
    
    ## Standalone build
    $ cmake -DCMAKE_BUILD_TYPE="Debug | Release" .. \
            -DAMD_APP_STANDALONE_BUILD_PACKAGE=ON \
            -DAMD_APP_ENGINEERING_BUILD_PACKAGE=OFF && cmake --build .
    
        ..
    
    ## ROCm build
    ## Assumes ROCm is installed on the build system
    $ cmake -DCMAKE_BUILD_TYPE="Debug | Release" .. \
            -DAMD_APP_STANDALONE_BUILD_PACKAGE=OFF \
            -DAMD_APP_ROCM_BUILD_PACKAGE=ON && cmake --build .
    

You can build RBT from source available at GitHub. Access to the source is currently limited to approved users. To request permission, file a ticket here.

Installing RBT#

Invoke the install command to copy build artifacts to predefined folders of the RBT suite. Upon completion, the artifacts are copied to the bin and lib directories of the build directory.

## For Makefiles
make install

## For CMake; Default install location is /opt/rocm/
cmake --install . --prefix /path/to/install/location

Note

You can find all executables in the <build_directory>.

Running RBT#

To run the RBT tool and find related plugins, set the following environment variables:

  • PATH: Includes the location for the executable

  • LD_LIBRARY_PATH: Includes the location for the libraries required by the plugins

The RBT plugins are installed at …/lib/rocm_bandwidth_test/plugins/.

For example, under ROCm, if the ROCM_PATH variable is set to /opt/rocm, the environment variables are set as:

  • PATH: $ROCM_PATH/bin:…

  • LD_LIBRARY_PATH: $ROCM_PATH/lib:…

The RBT plugins are installed at: $ROCM_PATH/lib/rocm_bandwidth_test/plugins/.

You can set the environment variables manually for a single session or add them to the user’s shell configuration file such as ~/.bashrc or ~/.zshrc for the values to persist across the sessions:

export PATH=/opt/rocm/bin:$PATH
export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH