Files
rocm-systems/rocrtst
Mengbing Wang cf10c3bc35 Add allocation size limit of 1/2 vram size in rocrtstPerf.Memory_Async_Copy test.
Add the hard limit of allocation size to be 1/2 available vram
to avoid allocation failure when allocation size equals to vram size.

Add printing block size in each round to report progress for long running
test

Add the block size skip info in result form(if any tests skipped).

Affected test:
rocrtstPerf.Memory_Async_Copy

Data Size             Avg Time(us)         Avg BW(GB/s)          MinTime(us)          Peak BW(GB/s)
  128M             638759.570200              0.195692		637569.991000               0.196057
  256M            1270058.822400              0.196841		1268425.758000               0.197095
Notice: Data Size larger than 512M is skipped due to hard limit of 1/2 vram size

Signed-off-by: Mengbing Wang <mengbing.wang@amd.com>
Change-Id: I4c4cea74a608272cc29d222b9399af26b34d7473
2021-04-16 02:23:48 -04:00
..
2017-05-11 14:45:45 -04:00
2020-11-10 13:42:35 -05:00
2020-09-28 20:27:53 -05:00

Building rocrtst

Library dependencies

rocrtst needs hwloc and libnuma to build and run. On Debian systems, for example, you would need to get them like so:

sudo apt-get install libhwloc-dev libnuma-dev

CMake option values

When building rocrtst, several cmake command line options are available--some mandatory, some optional. These are described here:

  • TARGET_DEVICES=
    • Optional
    • semi-colon separated list of gpus to build kernels for; e.g. "gfx908;gfx900;...".
    • Default: the list of devices that is used is specified in the CMakeLists.txt file, and includes the all the currently supported targets.
  • ROCRTST_BLD_TYPE=<debug|release>
    • Optional
    • Build a debug or release build
    • Default: Build the debug version
  • CMAKE_PREFIX_PATH=<"ROCR root path; LLVM root path">
    • Required
    • Where to find ROCr and LLVM. The ROCr root path is typically something like /opt/rocm. The LLVM directory is typically something like /opt/rocm/llvm
  • CMAKE_INSTALL_PREFIX=""
    • Optional
    • Where to install rocrtst
  • CPACK_PACKAGING_INSTALL_PREFIX=""
    • Optional
    • Where to install rocrtst within DEB/RPM packages
  • CPACK_GENERATOR=
    • Optional
    • List of CPack build generators to use; e.g. "DEB;RPM"
  • ROCM_PATCH_VERSION=
    • Optional
    • ROCm patch version used in package name
  • ROCM_DIR=
    • Required
    • ROCm root directory
  • LLVM_DIR=""
    • Required
    • Location of clang executable
  • OPENCL_DIR=
    • Required
    • Location where OpenCL root resides
  • EMULATOR_BUILD=<true|false>
    • Optional
    • If EMULATOR_BUILD is defined, rocrtst will avoid tests that typically run too long on an HW emulator, or use a scaled-down version of the test.

Steps to build

mkdir build
cd build
# See description of these options above.
# The values for these options are examples. They should be tailored
# for your system.
cmake -DTARGET_DEVICES=$GPU_LIST \
  -DROCRTST_BLD_TYPE=$ROCRTST_BUILD_TYPE \
  -DCMAKE_PREFIX_PATH="$PACKAGE_ROOT;$PACKAGE_ROOT/llvm" \
  -DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
  -DCPACK_PACKAGING_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
  -DCPACK_GENERATOR="DEB;RPM" \
  -DROCM_PATCH_VERSION=$ROCM_LIBPATCH_VERSION \
  -DROCM_DIR=$PACKAGE_ROOT \
  -DLLVM_DIR="$PACKAGE_ROOT/llvm/bin" \
  -DOPENCL_DIR=$PACKAGE_ROOT \
  -DEMULATOR_BUILD=$EMULATOR_BUILD \
      ..
# Build rocrtst executable
make
# Build rocrtst kernels
make rocrtst_kernels

Running rocrtst

rocrtst needs to be able to find the ROCr library. This can be through ldconfig method or by setting LD_LIBRARY_PATH to have the ROCr library directory. When rocrtst is built, there is one rocrtst executable, and several symlinks pointing to that executable, one from each asic sub-directory. For example, for gfx900, we would see the following:

cd <rocrtst bin root>/gfx900
ls -l rocrtst
lrwxrwxrwx 1 user user 12 Sep 28 17:23 rocrtst64 -> ../rocrtst64

To run rocrtst, we should call the ASIC specific symlink. This allows the asic-specific kernels to be found.

rocrtst is a Google Test ("gtest") based program and accepts gtest options. Additionally, there are some rocrtst specfic options. All of these options can be seen by using the "-h" option:

$ <rocrtst bin>/gfx900 $ ./rocrtst64 -h
<GTest option descrption>
Optional RocRTst Arguments:
--iterations, -i <number of iterations to execute>; override default, which varies for each test
--rocrtst_help, -r print this help message
--verbosity, -v <verbosity level>
  Verbosity levels:
   0    -- minimal; just summary information
   1    -- intermediate; show intermediate values such as intermediate perf. data
   2    -- progress; show progress displays
   >= 3 -- more debug output
--monitor_verbosity, -m <monitor verbosity level>
  Monitor Verbosity levels:
   0    -- don't read or print out any GPU monitor information;
   1    -- print out all available monitor information before the first test and after each test
   >= 2 -- print out even more monitor information (test specific)