diff --git a/projects/rdc/.azuredevops/rocm-ci.yml b/projects/rdc/.azuredevops/rocm-ci.yml new file mode 100644 index 0000000000..53c63c687c --- /dev/null +++ b/projects/rdc/.azuredevops/rocm-ci.yml @@ -0,0 +1,40 @@ +resources: + repositories: + - repository: pipelines_repo + type: github + endpoint: ROCm + name: ROCm/ROCm + +variables: +- group: common +- template: /.azuredevops/variables-global.yml@pipelines_repo + +trigger: + batch: true + branches: + include: + - amd-staging + paths: + exclude: + - .github + - docs + - '.*.y*ml' + - '*.md' + - LICENSE + +pr: + autoCancel: true + branches: + include: + - amd-staging + paths: + exclude: + - .github + - docs + - '.*.y*ml' + - '*.md' + - LICENSE + drafts: false + +jobs: + - template: ${{ variables.CI_COMPONENT_PATH }}/rdc.yml@pipelines_repo diff --git a/projects/rdc/.clang-format b/projects/rdc/.clang-format new file mode 100644 index 0000000000..f506d11e61 --- /dev/null +++ b/projects/rdc/.clang-format @@ -0,0 +1,9 @@ +--- +Language: Cpp +BasedOnStyle: Google +ColumnLimit: 100 + +# Force pointers to the type for C++. +# For some reason Google style doesn't specify this.. +DerivePointerAlignment: false +PointerAlignment: Left diff --git a/projects/rdc/.editorconfig b/projects/rdc/.editorconfig new file mode 100644 index 0000000000..73278b1892 --- /dev/null +++ b/projects/rdc/.editorconfig @@ -0,0 +1,22 @@ +# EditorConfig standardizes spacing in all editors: https://EditorConfig.org +# Please get a plugin for your editor to match the formatting + +# top-most EditorConfig file +root = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{c,cc,cpp,h,hh,hpp}] +charset = utf-8 +indent_style = space +indent_size = 2 + +[*.py] +indent_style = space +indent_size = 4 + +[*.proto] +charset = utf-8 +indent_style = space +indent_size = 2 + diff --git a/projects/rdc/.gersemirc b/projects/rdc/.gersemirc new file mode 100644 index 0000000000..40f6a47987 --- /dev/null +++ b/projects/rdc/.gersemirc @@ -0,0 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.20.1/gersemi/configuration.schema.json + +warn_about_unknown_commands: false +indent: 4 +line_length: 100 diff --git a/projects/rdc/.git-blame-ignore-revs b/projects/rdc/.git-blame-ignore-revs new file mode 100644 index 0000000000..c1d5764e3d --- /dev/null +++ b/projects/rdc/.git-blame-ignore-revs @@ -0,0 +1,4 @@ +# ignore formatting commit +434e40305d6771040caec164b6b1369cc0ef51ad +# ignore cmake formatting commit (gersemi rocks) +40545dcb49ebcfa0a6fe040a8862cf8b338ad6b5 diff --git a/projects/rdc/.github/CODEOWNERS b/projects/rdc/.github/CODEOWNERS new file mode 100644 index 0000000000..c66f1e1a71 --- /dev/null +++ b/projects/rdc/.github/CODEOWNERS @@ -0,0 +1,5 @@ +* @dmitrii-galantsev @bill-shuzhou-liu + +docs/* @ROCm/rocm-documentation +*.md @ROCm/rocm-documentation +*.rst @ROCm/rocm-documentation diff --git a/projects/rdc/.github/CONTRIBUTING.md b/projects/rdc/.github/CONTRIBUTING.md new file mode 100644 index 0000000000..c88056a39d --- /dev/null +++ b/projects/rdc/.github/CONTRIBUTING.md @@ -0,0 +1,114 @@ +# Contributing to RDC # + +We welcome contributions to RDC. Please follow these details to help ensure your contributions will be successfully accepted. + +## Issue Discussion ## + +Please use the GitHub Issues tab to notify us of issues. + +* Use your best judgement for issue creation. If your issue is already listed, upvote the issue and + comment or post to provide additional details, such as how you reproduced this issue. +* If you're not sure if your issue is the same, err on the side of caution and file your issue. + You can add a comment to include the issue number (and link) for the similar issue. If we evaluate + your issue as being the same as the existing issue, we'll close the duplicate. +* If your issue doesn't exist, use the issue template to file a new issue. + * When filing an issue, be sure to provide as much information as possible, + including your amdgpu driver version, GPUs used, and commands ran. This + helps reduce the time required to reproduce your issue. + * Check your issue regularly, as we may require additional information to successfully reproduce the + issue. +* You may also open an issue to ask questions to the maintainers about whether a proposed change + meets the acceptance criteria, or to discuss an idea pertaining to the library. + +## Acceptance Criteria ## + +The goal of RDC project is to provide a remote control tool with optional +modules. + +Contributors wanting to submit additional plugins must follow the guidelines +below. + +* New modules/ + * Modules must be loaded at runtime with a `dlopen` call. + * Modules must have an option to disable them in CMake. + +## Code Structure ## + +Modules: + + └── rdc_libs + └── rdc_modules + +Module interfaces: (see RdcRasLib.h for example) + + └── include + └── rdc_lib + └── impl + +Client executable (rdci) source: + + └── rdci + +Server executable (rdcd) source: + + └── server + +Protos for protobuf and gRPC: + + └── protos + └── rdc.proto + +## Coding Style ## + +Please refer to `.clang-format`. It is suggested you use `pre-commit` tool. +It mostly follows Google C++ formatting with 100 character line limit. + +## Pull Request Guidelines ## + +When you create a pull request, you should target the default branch. Our +current default branch is the **develop** branch, which serves as our +integration branch. + +### Deliverables ### + +For each new file in repository, +Please include the licensing header + + /* + Copyright (c) 20xx - present Advanced Micro Devices, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + +### Process ### + +* Reviewers are listed in the CODEOWNERS file +* Code format guidelines + +RDC uses the clang-format tool for formatting code in source files. +The formatting style is captured in .clang-format which is located at +the root of RDC. These are different options to follow: + + 1. Using pre-commit and docker - `pre-commit run` + 1. Using only clang-format - `clang-format -i \` + +## References ## + +1. [pre-commit](https://github.com/pre-commit/pre-commit) +1. [clang-format](https://clang.llvm.org/docs/ClangFormat.html) diff --git a/projects/rdc/.github/dependabot.yml b/projects/rdc/.github/dependabot.yml new file mode 100644 index 0000000000..8cfb43a90c --- /dev/null +++ b/projects/rdc/.github/dependabot.yml @@ -0,0 +1,18 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/docs/sphinx" # Location of package manifests + open-pull-requests-limit: 10 + schedule: + interval: "monthly" + labels: + - "documentation" + - "dependencies" + - "ci:docs-only" + reviewers: + - "samjwu" diff --git a/projects/rdc/.github/palamida.yml b/projects/rdc/.github/palamida.yml new file mode 100644 index 0000000000..47bd57a5ab --- /dev/null +++ b/projects/rdc/.github/palamida.yml @@ -0,0 +1,5 @@ +disabled: false +scmId: gh-emu-rocm +branchesToScan: + - amd-staging + - amd-mainline \ No newline at end of file diff --git a/projects/rdc/.github/workflows/cmake_format.yml b/projects/rdc/.github/workflows/cmake_format.yml new file mode 100644 index 0000000000..54debebcb0 --- /dev/null +++ b/projects/rdc/.github/workflows/cmake_format.yml @@ -0,0 +1,97 @@ +# caution: most of this file was written using Claude 3.7 Sonnet +name: CMake Format Check + +on: + push: + branches: [ amd-staging ] + paths: + - '**/*.cmake' + - '**/CMakeLists.txt' + pull_request: + branches: [ amd-staging ] + paths: + - '**/*.cmake' + - '**/CMakeLists.txt' + workflow_dispatch: # Allows manual triggering + +defaults: + run: + shell: bash + +jobs: + check-gersemi: + name: Check CMake files formatting + runs-on: lstt + container: catthehacker/ubuntu:act-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for better diff context + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + + - name: Install gersemi + run: | + python -m pip install --upgrade pip + pip install gersemi==0.20.1 + + - name: Check CMake formatting + id: check-format + run: | + echo "::group::Finding CMake files" + FILES=$(find . -type f \( -name "CMakeLists.txt" -o -name "*.cmake" \) \ + -not -name "*.in" \ + -not -path "*/\.*" \ + -not -path "*/build/*") + echo "Found $(echo "$FILES" | wc -l) CMake files to check" + echo "::endgroup::" + + # Create an array to store failed files + declare -a failed_files + + # Check if files are formatted correctly + for file in $FILES; do + echo "Checking $file..." + if ! gersemi --check "$file"; then + failed_files+=("$file") + echo "::error file=$file::File needs formatting" + fi + done + + # Generate report and exit with error if any files failed + if [ ${#failed_files[@]} -ne 0 ]; then + echo "Failed files: ${failed_files[*]}" + echo "FAILED_FILES=${failed_files[*]}" >> $GITHUB_ENV + exit 1 + else + echo "All CMake files are formatted correctly!" + fi + + - name: Generate diff for failed files + if: failure() && env.FAILED_FILES != '' + run: | + echo "## CMake Format Check Failed" >> $GITHUB_STEP_SUMMARY + echo "The following files need formatting:" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + + for file in ${FAILED_FILES}; do + echo "### $file" >> $GITHUB_STEP_SUMMARY + done + + cat << 'EOF' >> $GITHUB_STEP_SUMMARY + ### How to fix + Run this command locally to fix formatting issues: + ```bash + # Install gersemi + pip install gersemi==0.20.1 + + # Format files + gersemi -i + ``` + EOF diff --git a/projects/rdc/.github/workflows/kws-caller.yml b/projects/rdc/.github/workflows/kws-caller.yml new file mode 100644 index 0000000000..c0f4f26807 --- /dev/null +++ b/projects/rdc/.github/workflows/kws-caller.yml @@ -0,0 +1,15 @@ +name: Rocm Validation Suite KWS +on: + push: + branches: [amd-staging, amd-mainline] + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: +jobs: + kws: + if: ${{ github.event_name == 'pull_request' }} + uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/kws.yml@mainline + secrets: inherit + with: + pr_number: ${{github.event.pull_request.number}} + base_branch: ${{github.base_ref}} diff --git a/projects/rdc/.github/workflows/label_cherrypicks.yml b/projects/rdc/.github/workflows/label_cherrypicks.yml new file mode 100644 index 0000000000..f685c979b3 --- /dev/null +++ b/projects/rdc/.github/workflows/label_cherrypicks.yml @@ -0,0 +1,47 @@ +# caution: this whole file was written using Claude 3.7 Sonnet +name: Auto Label Cherry-Pick + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + add-label: + runs-on: ubuntu-latest + container: + image: node:16-alpine + permissions: + pull-requests: write + steps: + - name: Add label to cherry-pick PRs + uses: actions/github-script@v6 + with: + script: | + const pr = context.payload.pull_request; + const headBranch = pr.head.ref; + const baseBranch = pr.base.ref; + + // Check if head branch contains cherry-pick pattern or base branch starts with release/ + const isCherryPick = /cherry.*pick/i.test(headBranch); + const isReleaseTarget = baseBranch.startsWith('release/'); + + if (isCherryPick || isReleaseTarget) { + // Label to apply + const labelToAdd = 'cherry-pick'; + + // Try to add the label + try { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + labels: [labelToAdd] + }); + console.log(`Added label "${labelToAdd}" to PR #${pr.number}`); + } catch (error) { + console.error(`Error adding label: ${error.message}`); + } + } else { + console.log('PR does not match criteria for automatic labeling'); + } + diff --git a/projects/rdc/.github/workflows/main.yml b/projects/rdc/.github/workflows/main.yml new file mode 100644 index 0000000000..f457d16d68 --- /dev/null +++ b/projects/rdc/.github/workflows/main.yml @@ -0,0 +1,193 @@ +name: Build RDC + +on: + pull_request: + branches: [ 'dgalants/ci', 'amd-staging', 'amd-mainline' ] + workflow_dispatch: + +env: + DEBIAN_FRONTEND: noninteractive + DEBCONF_NONINTERACTIVE_SEEN: true + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: RelWithDebInfo + ROCM_DIR: /opt/rocm + # Use vars for internal URLs + JOB_NAME: ${{ vars.JOB_NAME }} + AMDGPU_REPO_DEB: ${{ vars.AMDGPU_REPO_DEB }} + AMDGPU_REPO_URL: ${{ vars.AMDGPU_REPO_URL }} + ROCM_CI_URL: ${{ vars.ROCM_CI_URL }} + # Set env vars to values of config vars + env_var: ${{ vars.ENV_CONTEXT_VAR }} + +jobs: + build: + runs-on: lstt + container: rocm/rocm-build-ubuntu-22.04:6.3 + outputs: + BUILD_NUM: ${{ steps.build_number.outputs.BUILD_NUM }} + TODAY: ${{ steps.build_number.outputs.TODAY }} + + steps: + - uses: actions/checkout@v3 + + - name: Set up apt repos + run: | + test "$AMDGPU_REPO_URL" = "" && echo "Error! AMDGPU_REPO_URL is EMPTY!" && exit 1 + cat /etc/os-release + apt update -y + # provides add-apt-repository and support for caching actions + apt install -y software-properties-common jq curl + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + add-apt-repository -y ppa:apt-fast/stable + apt update -y + apt install -y apt-fast + # provides amdgpu-repo + wget "$AMDGPU_REPO_URL/$AMDGPU_REPO_DEB" + apt-fast install -y "./$AMDGPU_REPO_DEB" + + - name: Get latest build number + id: build_number + run: | + curl -Ls "${ROCM_CI_URL}/${JOB_NAME}/lastStableBuild/api/json?depth=1" -o /tmp/build_info.json + cat /tmp/build_info.json | jq '.actions[] | .buildsByBranchName."refs/remotes/origin/amd-mainline".buildNumber | select(. != null)' > /tmp/build_num.txt + BUILD_NUM="$(cat /tmp/build_num.txt)" + echo "BUILD_NUM=$BUILD_NUM" >> "$GITHUB_ENV" + echo "BUILD_NUM=$BUILD_NUM" >> "$GITHUB_OUTPUT" + amdgpu-repo --rocm-build="$JOB_NAME"/"$BUILD_NUM" + apt-fast update -y + # useful for date-based caches + TODAY="$(date +%Y_%m_%d)" + echo "TODAY=$TODAY" >> "$GITHUB_ENV" + echo "TODAY=$TODAY" >> "$GITHUB_OUTPUT" + + + - name: Get apt packages + run: | + apt install -y \ + rocm-core \ + amd-smi-lib \ + rocblas \ + rocblas-dev \ + rocm-developer-tools \ + rocm-device-libs \ + rocm-smi-lib \ + rocm-validation-suite \ + rocprofiler-dev \ + rocprofiler-plugins \ + rocprofiler-register \ + rocprofiler-sdk \ + hip-dev \ + hip-runtime-amd \ + hipcc \ + build-essential \ + ccache \ + cmake \ + curl \ + git \ + gzip \ + jq \ + libcap-dev \ + tar \ + unzip \ + wget \ + zip \ + zstd + + - name: Cache .ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + # only create one cache per day to save time during upload + key: ${{ runner.os }}-ccache-${{ github.ref_name }}-${{ env.TODAY }} + restore-keys: | + ${{ runner.os }}-ccache-${{ github.ref_name }}- + ${{ runner.os }}-ccache- + + - name: Build RDC + run: | + pwd + cmake \ + -B build \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DGRPC_DESIRED_VERSION=1.61.0 \ + -DGRPC_ROOT=/usr/grpc \ + -DBUILD_RUNTIME=ON \ + -DGPU_TARGETS=gfx942 \ + -DBUILD_PROFILER=ON \ + -DBUILD_RVS=OFF \ + -DBUILD_TESTS=ON \ + -DCPACK_GENERATOR="DEB" \ + -DCMAKE_INSTALL_PREFIX=${ROCM_DIR} + make -C build -j $(nproc) + make -C build -j $(nproc) package + + - name: Install RDC + run: | + echo "pre: " + ls -lah /opt + make -C build -j $(nproc) install + echo "post: " + ls -lah /opt + + # important to use v3 because v4 doesn't work with act: + # https://github.com/nektos/act/issues/329 + - name: Package RDC + uses: actions/upload-artifact@v4 + with: + name: rdc + path: build/rdc*.deb + if-no-files-found: error + retention-days: 5 + + test: + needs: build + runs-on: lstt + container: rocm/rocm-build-ubuntu-22.04:6.3 + + steps: + - name: Set up apt repos + run: | + cat /etc/os-release + apt update -y + # provides add-apt-repository and support for caching actions + apt install -y software-properties-common jq curl + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt install -y nodejs + + - name: Package RDC + uses: actions/download-artifact@v4 + with: + name: rdc + path: /opt/ + + - name: Test RDC installation + shell: bash + run: | + COUNT=$(find /opt/ -iname 'rdc*.deb' | wc -l) + test "$COUNT" -eq '2' + dpkg --force-all -i /opt/rdc*.deb + # confirm binaries are installed + find $ROCM_DIR/bin -maxdepth 1 -iname rdcd + find $ROCM_DIR/bin -maxdepth 1 -iname rdci + find $ROCM_DIR/share/rdc -iname rdctst + # confirm that libraries are installed + MISSING_LIBS=() + for lib in librdc.so librdc_bootstrap.so librdc_client.so; do + test -e "$ROCM_DIR/lib/$lib" || MISSING_LIBS+=("$lib") + done + for lib in librdc_rocr.so librdc_rocp.so; do + test -e "$ROCM_DIR/lib/rdc/$lib" || MISSING_LIBS+=("$lib") + done + + if test "${#MISSING_LIBS[@]}" != "0"; then + echo "Missing libs found!" + for lib in "${MISSING_LIBS[@]}"; do + echo "- $lib" + done + exit 1 + else + echo "No missing libs found!" + fi diff --git a/projects/rdc/.github/workflows/rocm_ci_caller.yml b/projects/rdc/.github/workflows/rocm_ci_caller.yml new file mode 100644 index 0000000000..df72225183 --- /dev/null +++ b/projects/rdc/.github/workflows/rocm_ci_caller.yml @@ -0,0 +1,21 @@ +name: ROCm CI Caller +on: + pull_request: + branches: [amd-mainline] + types: [opened, reopened, synchronize] + push: + branches: [amd-mainline] + workflow_dispatch: + +jobs: + call-workflow: + uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/rocm_ci.yml@mainline + secrets: inherit + with: + input_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + input_pr_num: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 0 }} + input_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.html_url || '' }} + input_pr_title: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || '' }} + repository_name: ${{ github.repository }} + base_ref: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref }} + trigger_event_type: ${{ github.event_name }} diff --git a/projects/rdc/.gitignore b/projects/rdc/.gitignore new file mode 100644 index 0000000000..cde49210e5 --- /dev/null +++ b/projects/rdc/.gitignore @@ -0,0 +1,33 @@ +# build artifacts +.cache/ +build/ +DEBIAN/postinst +DEBIAN/prerm +RPM/ +include/rdc/rdc64Config.h + +# documentation artifacts +_build/ +_images/ +_static/ +_templates/ +_toc.yml +docBin/ +docs/_doxygen/ + +# VisualStudioCode +.vscode + +# do NOT ignore these files +!.clang-format +!.editorconfig +!.cmake-format +!.pre-commit-config.yaml + +# misc +__pycache__/ +authentication/CA/ + +# act +act.variables +act.secrets diff --git a/projects/rdc/.pre-commit-config.yaml b/projects/rdc/.pre-commit-config.yaml new file mode 100644 index 0000000000..e5f84e9d0f --- /dev/null +++ b/projects/rdc/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# - How to use: +# python3 -m pip install pre-commit +# pre-commit install --install hooks +# Upon a new commit - the hooks should automagically run +# +# - How to skip: +# git commit --no-verify +# or +# SKIP=clang-format git commit +# SKIP=gersemi git commit + +fail_fast: false +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v20.1.7 + hooks: + - id: clang-format + types_or: [c++, c] + + - repo: https://github.com/BlankSpruce/gersemi + rev: 0.20.1 + hooks: + - id: gersemi diff --git a/projects/rdc/.readthedocs.yaml b/projects/rdc/.readthedocs.yaml new file mode 100644 index 0000000000..b3299fa4e8 --- /dev/null +++ b/projects/rdc/.readthedocs.yaml @@ -0,0 +1,18 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +sphinx: + configuration: docs/conf.py + +formats: [htmlzip, pdf, epub] + +python: + install: + - requirements: docs/sphinx/requirements.txt + +build: + os: ubuntu-22.04 + tools: + python: "3.10" diff --git a/projects/rdc/CHANGELOG.md b/projects/rdc/CHANGELOG.md new file mode 100644 index 0000000000..29774b623d --- /dev/null +++ b/projects/rdc/CHANGELOG.md @@ -0,0 +1,48 @@ +# Change Log for RDC + +Full documentation for RDC is available at [ROCm DataCenter Tool User Guide](https://rocm.docs.amd.com/projects/rdc/en/latest/). + +## RDC for ROCm 6.4.0 + +### Added + +- RDC policy feature +- Power and thermal throttling metrics +- RVS [IET](https://github.com/ROCm/ROCmValidationSuite/tree/a6177fc5e3f2679f98bbbc80dc536d535a43fb69/iet.so), [PEBB](https://github.com/ROCm/ROCmValidationSuite/tree/a6177fc5e3f2679f98bbbc80dc536d535a43fb69/pebb.so), and [memory bandwidth tests](https://github.com/ROCm/ROCmValidationSuite/tree/a6177fc5e3f2679f98bbbc80dc536d535a43fb69/babel.so) +- Link status +- RDC_FI_PROF_SM_ACTIVE metric + +### Changed + +- Migrated from [rocprofiler v1](https://github.com/ROCm/rocprofiler) to [rocprofiler-sdk](https://github.com/ROCm/rocprofiler-sdk) +- Improved README.md for better usability +- Moved `rdc_options` into `share/rdc/conf/` +- Fixed ABSL in clang18+ + +## RDC for ROCm 6.3.0 + +### Added + +- [RVS](https://github.com/ROCm/ROCmValidationSuite) integration +- Real time logging for diagnostic command +- `--version` command +- `XGMI_TOTAL_READ_KB` and `XGMI_TOTAL_WRITE_KB` monitoring metrics + +## RDC for ROCm 6.2.0 + +- Added [rocprofiler](https://github.com/ROCm/rocprofiler) dmon metrics +- Added new ECC metrics +- Added [ROCmValidationSuite](https://github.com/ROCm/ROCmValidationSuite) diagnostic command +- Fully migrated to [AMDSMI](https://github.com/ROCm/amdsmi) + - Removed RASLIB dependency and blobs + - Removed [rocm_smi_lib](https://github.com/ROCm/rocm_smi_lib) dependency + +## RDC for ROCm 6.1.0 + +- Added `--address` flag to rdcd +- Upgraded from C++11 to C++17 +- Upgraded gRPC + +## RDC for ROCm 5.5.0 + +- Added new profiling metrics for RDC dmon module. diff --git a/projects/rdc/CMakeLists.txt b/projects/rdc/CMakeLists.txt new file mode 100755 index 0000000000..e6b4c0b46a --- /dev/null +++ b/projects/rdc/CMakeLists.txt @@ -0,0 +1,568 @@ +# Copyright (c) 2019 - present Advanced Micro Devices, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# +# Minimum version of cmake required +# +cmake_minimum_required(VERSION 3.15) + +set(RDC "rdc" CACHE INTERNAL "") +set(RDC_PACKAGE ${RDC} CACHE STRING "") + +# ROCM_DIR should be passed in via command line +set(ROCM_DIR "/opt/rocm" CACHE PATH "ROCm directory.") +if(DEFINED ROCM_PATH) + message( + WARNING + "ROCM_PATH is not used by the build process! Did you mean to set ROCM_DIR instead?" + ) +endif() + +# Default libdir to "lib", this skips GNUInstallDirs from trying to take a guess if it's unset: +set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory") + +# Usually ROCM tools are installed into /opt/rocm +set(CMAKE_INSTALL_PREFIX ${ROCM_DIR} CACHE PATH "Default installation directory.") + +set(CMAKE_BUILD_TYPE + "RelWithDebInfo" + CACHE STRING + "Choose the type of build to perform: Debug, Release, RelWithDebInfo, MinSizeRel" +) +# Set the possible values of build type +set_property( + CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel" +) + +# Set compile flags +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -m64 -msse -msse2") +set(CMAKE_CXX_FLAGS_DEBUG + "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb -DDEBUG" + CACHE STRING + "Flags for Debug builds" +) +set(CMAKE_CXX_FLAGS_RELEASE + "${CMAKE_CXX_FLAGS_RELEASE} -O2 -s -DNDEBUG" + CACHE STRING + "Flags for Release builds" +) +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g -DNDEBUG" + CACHE STRING + "Flags for RelWithDebInfo builds" +) +set(CMAKE_CXX_FLAGS_MINSIZEREL + "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG" + CACHE STRING + "Flags for MinSizeRel builds" +) + +set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" + CACHE INTERNAL + "Default module path." +) +# Include common cmake modules +include(utils) +# Setup the package version based on git tags +set(PKG_VERSION_GIT_TAG_PREFIX "rdc_pkg_ver") +# Provide git to utilities +find_program(GIT NAMES git) +get_version_from_tag("1.1.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT) +# VERSION_* variables should be set by get_version_from_tag +message("Package version: ${VERSION_STRING}") + +# When cmake -DBUILD_STANDALONE=off, it will not build rdcd and rdci +# which requires the gRPC +option(BUILD_STANDALONE "Build targets for rdci and rdcd" ON) + +# When cmake -DBUILD_RUNTIME=off, it will not build the librdc_rocr.so +# which requires the Rocm run time. +option(BUILD_RUNTIME "Build targets for librdc_rocr.so" ON) + +# When cmake -DBUILD_PROFILER=off, it will not build the librdc_rocp.so +# which requires the Rocm profiler. +option(BUILD_PROFILER "Build targets for librdc_rocp.so" OFF) + +# When cmake -DBUILD_RVS=off, it will not build the librdc_rvs.so +# which requires the RocmValidationSuite +option(BUILD_RVS "Build targets for librdc_rvs.so" ON) + +# When cmake -DBUILD_TESTS=off, it will not build RDC tests. +option(BUILD_TESTS "Build test suite" OFF) + +# When cmake -DBUILD_EXAMPLES=off, it will not build RDC examples +option(BUILD_EXAMPLES "Build examples" OFF) + +# Enable shared libraries for gtest +option(BUILD_SHARED_LIBS "Build shared library (.so) or not." ON) + +# Enable address sanitizer +set(ADDRESS_SANITIZER_DEFAULT OFF) +if(DEFINED ENV{ADDRESS_SANITIZER}) + set(ADDRESS_SANITIZER_DEFAULT $ENV{ADDRESS_SANITIZER}) +endif() +option(ADDRESS_SANITIZER "Enable address sanitizer" ${ADDRESS_SANITIZER_DEFAULT}) + +option(CMAKE_VERBOSE_MAKEFILE "Enable verbose output" OFF) + +option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile commands for linters and autocompleters" ON) + +execute_process( + COMMAND ${GIT} rev-parse --short HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) +message( + "The HASH value of the current HEAD submission in this RDC code repository is : " + ${GIT_HASH} +) + +# Don't print 'Up-to-date' when installing +set(CMAKE_INSTALL_MESSAGE LAZY) + +# this must go after some CMAKE_* variables +project(${RDC} VERSION "${VERSION_STRING}" HOMEPAGE_URL "https://github.com/RadeonOpenCompute/rdc") + +# Include CMAKE_INSTALL_* variables +# this must go after project() +include(GNUInstallDirs) + +set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") + +set(GRPC_ROOT_DEFAULT "/usr") +set(GRPC_ROOT ${GRPC_ROOT_DEFAULT} CACHE PATH "GRPC installation directory.") +set(GRPC_DESIRED_VERSION 1.67.1 CACHE STRING "GRPC desired package version.") + +# add package search paths +list(APPEND CMAKE_PREFIX_PATH ${GRPC_ROOT} /usr/local) +set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/lib64 /usr/lib/x86_64-linux-gnu) + +# configure packaging +# cpack version is populated with CMAKE_PROJECT_VERSION implicitly +set(CPACK_PACKAGE_NAME ${RDC_PACKAGE} CACHE INTERNAL "") +set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc." CACHE STRING "") +set(CPACK_PACKAGE_CONTACT "RDC Support " CACHE STRING "") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Radeon Data Center Tools" CACHE STRING "") +set(CPACK_PACKAGE_DESCRIPTION + "This package contains the AMD ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}." + CACHE STRING + "" +) +set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Default packaging prefix.") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" CACHE INTERNAL "") +set(CPACK_RPM_PACKAGE_LICENSE "MIT" CACHE INTERNAL "") +set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators.") +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_RPM_COMPONENT_INSTALL ON) +mark_as_advanced( + CPACK_PACKAGE_VENDOR + CPACK_PACKAGE_CONTACT + CPACK_PACKAGE_DESCRIPTION_SUMMARY + CPACK_PACKAGE_DESCRIPTION + CPACK_GENERATOR +) + +# check if libcap exists +# needed for sys/capabilities.h +find_library(LIB_CAP NAMES cap REQUIRED) + +if(BUILD_STANDALONE AND GRPC_ROOT STREQUAL GRPC_ROOT_DEFAULT) + message( + WARNING + "GRPC_ROOT is left default. Cannot install gRPC from default root! + Please specify -DGRPC_ROOT= + Continuing without gRPC install" + ) +endif() + +find_package(amd_smi 26.0.0 NAMES amd_smi HINTS ${ROCM_DIR}/lib/cmake CONFIG REQUIRED) + +if(NOT EXISTS "${AMD_SMI_INCLUDE_DIR}" OR NOT EXISTS "${AMD_SMI_LIB_DIR}") + message( + FATAL_ERROR + "amd_smi not found in ${AMD_SMI_INCLUDE_DIR}. Please + make sure amd_smi is installed and present in ${AMD_SMI_INCLUDE_DIR}." + ) +endif() + +set(${RDC}_VERSION_MAJOR "${VERSION_MAJOR}") +set(${RDC}_VERSION_MINOR "${VERSION_MINOR}") +set(${RDC}_VERSION_PATCH "0") +set(${RDC}_VERSION_BUILD "0") +set(CPACK_PACKAGE_VERSION ${VERSION_STRING}) + +set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard to use") +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4.0) + message("Compiler version is " ${CMAKE_CXX_COMPILER_VERSION}) + message(FATAL_ERROR "Require at least gcc-5.4.0") +endif() + +message("Build Configuration:") + +if(BUILD_STANDALONE) + message("-----------GRPC ROOT: " ${GRPC_ROOT}) +endif() +message("-----------ROCM_DIR : " ${ROCM_DIR}) + +# this is needed for INSTALL_RPATH "\$ORIGIN" property to work correctly +# please note that because of --enable-new-dtags - this actually sets RUNPATH and not RPATH. +# this means LD_LIBRARY_PATH can override the library locations +set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE CACHE BOOL "Set all RPATH to be ORIGIN-based") +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "Use link path for RPATH") + +## Add address sanitizer +if(${ADDRESS_SANITIZER}) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") + message(STATUS "ADDRESS_SANITIZE: CMAKE_CXX_FLAGS=: ${CMAKE_CXX_FLAGS}") + message(STATUS "ADDRESS_SANITIZE: CMAKE_EXE_LINKER_FLAGS=: ${CMAKE_EXE_LINKER_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -shared-libasan") + message(STATUS "ADDRESS_SANITIZE: CMAKE_CXX_FLAGS=: ${CMAKE_CXX_FLAGS}") + message(STATUS "ADDRESS_SANITIZE: CMAKE_EXE_LINKER_FLAGS=: ${CMAKE_EXE_LINKER_FLAGS}") + endif() +endif() + +# Create a configure file to get version info from within library +configure_file( + "${PROJECT_SOURCE_DIR}/src/${RDC}64Config.in" + "${PROJECT_SOURCE_DIR}/include/rdc/${RDC}64Config.h" +) + +if(BUILD_STANDALONE) + # Compile .proto files + file(GLOB PROTOB_DEF_SRC_FILES "protos/*.proto") + set(PROTOB_SRC_DIR "${PROJECT_SOURCE_DIR}/protos") + set(PROTOB_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}") + find_program(PROTOB_CMD NAMES protoc REQUIRED) + find_program(GRPC_PLUGIN NAMES grpc_cpp_plugin REQUIRED) + set(GRPC_LIB_DIR "${GRPC_ROOT}/lib") + + set(ENV{LD_LIBRARY_PATH} ${GRPC_LIB_DIR}:${GRPC_LIB_DIR}64:$ENV{LD_LIBRARY_PATH}) + message("LD_LIBRARY_PATH = $ENV{LD_LIBRARY_PATH}") + foreach(file ${PROTOB_DEF_SRC_FILES}) + execute_process( + COMMAND ${PROTOB_CMD} --proto_path=${PROTOB_SRC_DIR} --cpp_out=${PROTOB_OUT_DIR} ${file} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + RESULT_VARIABLE PROTOB_RESULT + OUTPUT_VARIABLE PROTOB_OUT_VAR + COMMAND_ERROR_IS_FATAL ANY + ) + message("protoc command returned: ${PROTOB_RESULT}") + + message("GRPC_PLUGIN=${GRPC_PLUGIN})") + message("protoc cmd:") + message(" $ ${PROTOB_CMD} --proto_path=${PROTOB_SRC_DIR}") + message(" --grpc_out=${PROTOB_OUT_DIR}") + message("....--plugin=protoc-gen-grpc=\"${GRPC_PLUGIN}\" ${file}") + + execute_process( + COMMAND + ${PROTOB_CMD} --proto_path=${PROTOB_SRC_DIR} --grpc_out=${PROTOB_OUT_DIR} + --plugin=protoc-gen-grpc=${GRPC_PLUGIN} ${file} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + RESULT_VARIABLE PROTOB_RESULT + OUTPUT_VARIABLE PROTOB_OUT_VAR + ) + message("protoc command returned: ${PROTOB_RESULT}") + endforeach() +endif() + +# define all the install component labels to install +set(SERVER_COMPONENT "server") +set(CLIENT_COMPONENT "client") +set(TESTS_COMPONENT "tests") + +# Standalone only folders +if(BUILD_STANDALONE) + # these packages are later used in server and client targets + find_package(protobuf HINTS ${GRPC_ROOT} CONFIG REQUIRED) + find_package(gRPC ${GRPC_DESIRED_VERSION} HINTS ${GRPC_ROOT} CONFIG REQUIRED) + + # Don't print grpc install because it floods the terminal + set(OLD_CMAKE_INSTALL_MESSAGE ${CMAKE_INSTALL_MESSAGE}) + set(CMAKE_INSTALL_MESSAGE NEVER) + # Only allow installation when GRPC_ROOT is not default + # The alternative is installing all libraries and binaries from + # GRPC_ROOT_DEFAULT (/usr), which is incorrect behavior. + # This is needed because it's very difficult to track all gRPC dependencies + if(NOT GRPC_ROOT STREQUAL GRPC_ROOT_DEFAULT) + install( + DIRECTORY ${GRPC_ROOT}/lib + USE_SOURCE_PERMISSIONS + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${RDC}/grpc + COMPONENT ${SERVER_COMPONENT} + ) + # In SLES, The libprotobuf is created under lib64 folder, install it as well + if(EXISTS ${GRPC_ROOT}/lib64) + install( + DIRECTORY ${GRPC_ROOT}/lib64/ + USE_SOURCE_PERMISSIONS + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${RDC}/grpc/lib + COMPONENT ${SERVER_COMPONENT} + ) + endif() + # Also include dev setup for people do not want to build grpc + file(GLOB install_bin_files "${GRPC_ROOT}/bin/*") + foreach(ITEM ${install_bin_files}) + list(APPEND bin_files "${ITEM}") + endforeach() + install( + FILES ${bin_files} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${RDC}/grpc/bin + COMPONENT ${SERVER_COMPONENT} + ) + + install( + DIRECTORY ${GRPC_ROOT}/include + USE_SOURCE_PERMISSIONS + DESTINATION ${CMAKE_INSTALL_LIBDIR}/${RDC}/grpc + COMPONENT ${SERVER_COMPONENT} + ) + endif() + # Restore printing verbosity + set(CMAKE_INSTALL_MESSAGE ${OLD_CMAKE_INSTALL_MESSAGE}) + unset(OLD_CMAKE_INSTALL_MESSAGE) + + add_subdirectory("server") + add_subdirectory("rdci") + + if(BUILD_TESTS) + add_subdirectory("tests/rdc_tests") + endif() +endif() + +# Folders for both standalone and embedded +add_subdirectory("rdc_libs") + +if(BUILD_EXAMPLES) + add_subdirectory("example") +endif() + +# Export the package for use from the build-tree +# (this registers the build-tree with a global CMake-registry) +export(PACKAGE rdc) + +set(CONF_LIBS "librdc_bootstrap.so") +set(CONF_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + +# Create the rdc-config.cmake and rdc-config-version files +configure_file( + cmake_modules/rdc-config-version.cmake.in + "${PROJECT_BINARY_DIR}/rdc-config-version.cmake" + @ONLY +) + +include(CMakePackageConfigHelpers) +set(CONFIG_PACKAGE_INSTALL_DIR ${CONF_LIB_DIR}/cmake/${RDC}) +configure_package_config_file( + cmake_modules/rdc-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/rdc-config.cmake + INSTALL_DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR} +) + +# Install the rdc-config.cmake and rdc-config-version.cmake +install( + FILES "${PROJECT_BINARY_DIR}/rdc-config.cmake" "${PROJECT_BINARY_DIR}/rdc-config-version.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${RDC}" + COMPONENT dev +) + +# Install the export set for use with the install-tree +install(EXPORT rdcTargets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${RDC}" COMPONENT dev) + +# License file +install( + FILES ${CPACK_RESOURCE_FILE_LICENSE} + DESTINATION ${CMAKE_INSTALL_DOCDIR} + RENAME LICENSE.txt + COMPONENT dev +) + +# Python binding +install( + DIRECTORY ${PROJECT_SOURCE_DIR}/python_binding + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${RDC} + COMPONENT ${CLIENT_COMPONENT} +) +install( + DIRECTORY ${PROJECT_SOURCE_DIR}/authentication + DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/${RDC} + COMPONENT ${CLIENT_COMPONENT} +) +install( + DIRECTORY ${PROJECT_SOURCE_DIR}/example + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${RDC} + COMPONENT dev +) + +#Identify between SLES and Centos for setting symlink for rdc.service +#SLES need serice file in /usr/lib/systemd/system/rdc.service +#CENTOS/RHEL Require file in /lib/systemd/system/rdc.service +file(STRINGS /etc/os-release LINUX_DISTRO LIMIT_COUNT 1 REGEX "NAME=") +message("Using Linux Distro: ${LINUX_DISTRO}") +if(LINUX_DISTRO MATCHES "SLES") + set(DISTRO_ROOT "/usr/lib/systemd/system") +else() + set(DISTRO_ROOT "/lib/systemd/system") +endif() + +# 755 permissions +set(INST_SCR_PERM + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE +) +configure_file( + "${PROJECT_SOURCE_DIR}/src/DEBIAN_postinst.in" + "${PROJECT_SOURCE_DIR}/DEBIAN/postinst" + FILE_PERMISSIONS ${INST_SCR_PERM} + @ONLY +) +configure_file( + "${PROJECT_SOURCE_DIR}/src/DEBIAN_prerm.in" + "${PROJECT_SOURCE_DIR}/DEBIAN/prerm" + FILE_PERMISSIONS ${INST_SCR_PERM} + @ONLY +) +configure_file( + "${PROJECT_SOURCE_DIR}/src/RPM_rpm_post.in" + "${PROJECT_SOURCE_DIR}/RPM/rpm_post" + FILE_PERMISSIONS ${INST_SCR_PERM} + @ONLY +) +configure_file( + "${PROJECT_SOURCE_DIR}/src/RPM_preun.in" + "${PROJECT_SOURCE_DIR}/RPM/rpm_preun" + FILE_PERMISSIONS ${INST_SCR_PERM} + @ONLY +) +configure_file( + "${PROJECT_SOURCE_DIR}/src/RPM_postun.in" + "${PROJECT_SOURCE_DIR}/RPM/rpm_postun" + FILE_PERMISSIONS ${INST_SCR_PERM} + @ONLY +) +if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) + set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}") + message("Using CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}") +else() + set(ROCM_LIBPATCH_VERSION) +endif() + +# Debian package specific variables +if(DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) + set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) +else() + set(CPACK_DEBIAN_PACKAGE_RELEASE "local") +endif() +message("Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}") +set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") + +# Only add extras to RUNTIME package (not tests) +# It makes no sense to modify RDCD service when installing tests +# https://cmake.org/cmake/help/latest/cpack_gen/deb.html#variable:CPACK_DEBIAN_%3CCOMPONENT%3E_PACKAGE_CONTROL_EXTRA +set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONTROL_EXTRA + "${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/postinst" + "${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN/prerm" +) + +option(ROCM_DEP_ROCMCORE "Add debian dependency on rocm-core" OFF) +mark_as_advanced(ROCM_DEP_ROCMCORE) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "amd-smi-lib, libc6") +if(ROCM_DEP_ROCMCORE) + string(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS ", rocm-core") +endif() +# rdc-tests need rdc +set(CPACK_DEBIAN_TESTS_PACKAGE_DEPENDS "${CPACK_PACKAGE_NAME}") + +# RPM package specific variables +if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE}) + set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE}) +else() + set(CPACK_RPM_PACKAGE_RELEASE "local") +endif() +message("Using CPACK_RPM_PACKAGE_RELEASE ${CPACK_RPM_PACKAGE_RELEASE}") +set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") + +## 'dist' breaks manual builds on debian systems due to empty Provides +execute_process( + COMMAND rpm --eval %{?dist} + RESULT_VARIABLE PROC_RESULT + OUTPUT_VARIABLE EVAL_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "") + string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}") +endif() + +set(CPACK_RPM_PACKAGE_AUTOREQ 0) +set(CPACK_RPM_PACKAGE_AUTOPROV 0) +set(CPACK_RPM_PACKAGE_REQUIRES "amd-smi-lib") +# rdc-tests need rdc +set(CPACK_RPM_TESTS_PACKAGE_REQUIRES "${CPACK_PACKAGE_NAME}") +list( + APPEND + CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION + "/lib" + "/usr/sbin" + "/lib/systemd" + "/lib/systemd/system" + "/usr" + "/opt" +) + +# Only add extras to RUNTIME package (not tests) +# It makes no sense to modify RDCD service when installing tests +# https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_RPM_PRE_INSTALL_SCRIPT_FILE +set(CPACK_RPM_RUNTIME_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_post") +set(CPACK_RPM_RUNTIME_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_preun") +set(CPACK_RPM_RUNTIME_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/RPM/rpm_postun") + +# Treat runtime group as package base. +# Without it - the base package would be named 'rdc-runtime' +# resulting in rdc-runtime*.deb and rdc-runtime*.rpm +set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") +set(CPACK_RPM_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") + +include(CPack) + +# rdc package, no postfix +cpack_add_component_group("runtime") +cpack_add_component(${CLIENT_COMPONENT} GROUP runtime) +cpack_add_component(${SERVER_COMPONENT} GROUP runtime) +cpack_add_component(dev GROUP runtime) + +# rdc-tests package, -tests postfix +cpack_add_component_group("tests") +cpack_add_component(${TESTS_COMPONENT} GROUP tests) diff --git a/projects/rdc/CPPLINT.cfg b/projects/rdc/CPPLINT.cfg new file mode 100644 index 0000000000..b63692c6df --- /dev/null +++ b/projects/rdc/CPPLINT.cfg @@ -0,0 +1,3 @@ +set noparent +linelength=100 +filter=-build/include_subdir,-legal/copyright,-runtime/printf,-build/c++11,-runtime/int,-build/header_guard diff --git a/projects/rdc/DEBIAN/control b/projects/rdc/DEBIAN/control new file mode 100644 index 0000000000..577dc6f1e3 --- /dev/null +++ b/projects/rdc/DEBIAN/control @@ -0,0 +1,8 @@ +Package: rdc +Architecture: amd64 +Maintainer: Advanced Micro Devices (AMD) +Depends: +Priority: optional +Version: MODULE_VERSION +Description: AMD Radeon Data Center + This package contains the Radeon Data Center tools. diff --git a/projects/rdc/Docker/Dockerfile b/projects/rdc/Docker/Dockerfile new file mode 100644 index 0000000000..89d2026f43 --- /dev/null +++ b/projects/rdc/Docker/Dockerfile @@ -0,0 +1,107 @@ +# Use amdsmi base image +FROM amdsmi-image + +# Sync ROCm repositories +RUN apt-get update && apt-get install -y wget gnupg2 && \ + wget -qO - http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \ + echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ jammy main' | tee /etc/apt/sources.list.d/rocm.list + +# Install ROCm runtime and dependencies +RUN apt-get update && \ + apt-get install -y \ + rocm-smi-lib \ + cmake \ + make \ + g++ \ + doxygen \ + texlive-latex-base \ + automake \ + unzip \ + build-essential \ + autoconf \ + libtool \ + pkg-config \ + libgflags-dev \ + libgtest-dev \ + clang \ + libc++-dev \ + curl \ + libcap-dev \ + python3-argcomplete \ + python3-pip \ + bash && \ + rm -rf /var/lib/apt/lists/* + +# Update setuptools +RUN python3 -m pip install --upgrade setuptools==59.6.0 + +# Check for modprobe +RUN command -v modprobe || echo "modprobe not found" + +# Set environment variables +ENV GRPC_ROOT=/opt/grpc +ENV RDC_LIB_DIR=/opt/rocm/lib/rdc +ENV CMAKE_ROOT=/usr/bin/cmake + +# Install gRPC +RUN git clone -b v1.61.0 https://github.com/grpc/grpc --depth=1 --shallow-submodules --recurse-submodules && \ + cd grpc && \ + cmake -B build \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX="$GRPC_ROOT" \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=Release && \ + make -C build -j $(nproc) && \ + make -C build install && \ + echo "$GRPC_ROOT" | tee /etc/ld.so.conf.d/grpc.conf + +# Build and install RDC +RUN git clone https://github.com/ROCm/rdc && \ + cd rdc && \ + cmake -B build -DGRPC_ROOT="$GRPC_ROOT" \ + -DSMIDIR="$SMI_DIR" \ + -DBUILD_TESTS=OFF \ + -DBUILD_PROFILER=OFF \ + -DBUILD_RUNTIME=OFF \ + -DBUILD_RVS=OFF && \ + make -C build -j $(nproc) && \ + make -C build install + +# Update system library path +RUN export RDC_LIB_DIR=/opt/rocm/lib/rdc && \ + export GRPC_LIB_DIR="/opt/grpc/lib" && \ + echo "${RDC_LIB_DIR}" | tee /etc/ld.so.conf.d/x86_64-librdc_client.conf && \ + echo "${GRPC_LIB_DIR}" | tee -a /etc/ld.so.conf.d/x86_64-librdc_client.conf && \ + ldconfig + +# Expose the port for Prometheus +EXPOSE 50051 + +# Expose the prometheus plugin port +EXPOSE 5000 + +# Set working directory to /opt/rocm/libexec/rdc/python_binding +WORKDIR /opt/rocm/libexec/rdc/python_binding + +# Install Prometheus +RUN wget https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz && \ + tar xvfz prometheus-2.41.0.linux-amd64.tar.gz && \ + mv prometheus-2.41.0.linux-amd64/prometheus /usr/local/bin/ && \ + rm -rf prometheus-2.41.0.linux-amd64* + +# Install Grafana +RUN wget https://dl.grafana.com/oss/release/grafana-9.3.2.linux-amd64.tar.gz && \ + tar -zxvf grafana-9.3.2.linux-amd64.tar.gz && \ + mv grafana-9.3.2 /usr/local/grafana && \ + rm grafana-9.3.2.linux-amd64.tar.gz + +# Install Prometheus client for Python +RUN python3 -m pip install prometheus_client + +# Ensure sudo can run without a password for the rdcd command +RUN echo "ALL ALL=(ALL) NOPASSWD: /opt/rocm/bin/rdcd" >> /etc/sudoers + +# Set the entry point to run the rdcd command +ENTRYPOINT ["sudo", "/opt/rocm/bin/rdcd", "-u"] diff --git a/projects/rdc/Docker/README.md b/projects/rdc/Docker/README.md new file mode 100644 index 0000000000..315d478f98 --- /dev/null +++ b/projects/rdc/Docker/README.md @@ -0,0 +1,77 @@ +# Setup Instructions for AMDSMI and RDC Images + +Follow these steps to set up both the AMDSMI and RDC images. + +## Prerequisites + +Ensure you have the necessary permissions and tools installed to clone repositories and build Docker images. + +## Step 1: Clone Repositories + +Download the latest AMDSMI and RDC repositories using the following commands: + +### AMDSMI + +```bash +git clone https://github.com/ROCm/amdsmi.git +``` + +### RDC + +```bash +git clone https://github.com/ROCm/rdc.git +``` + +## Step 2: Build AMDSMI Base Image + +1. Navigate to the `amdsmi` directory on your system. +2. Build the Docker image using the following command: + + ```bash + docker build -t amdsmi-image . + ``` + +## Step 3: Build RDC Image + +1. Navigate to the `rdc` directory on your system. +2. Navigate into the `/Docker` directory. +3. Build the Docker image using the following command: + + ```bash + docker build -t rdc-image . + ``` + +## Step 4: Run RDC Image + +To run the RDC image, use the following command: + +```bash +docker run rdc-image +``` + +If the above command does not work, try the following: + +1. Run the image with a bash entry point: + + ```bash + docker run -it --entrypoint /bin/bash rdc-image + ``` + +2. Once inside the container, run the following command: + + ```bash + sudo /opt/rocm/bin/rdcd -u + ``` + +## Step 5: Run AMDSMI Image (optional) + +To be able to run AMDSMI commands inside of the image run the following: + +```bash +sudo docker run --rm -ti \ + --privileged \ + --volume $(realpath ./):/src:rw \ + amdsmi-image +``` +> [!IMPORTANT] +> Make sure that you are in the `amdsmi` directory before running. \ No newline at end of file diff --git a/projects/rdc/LICENSE b/projects/rdc/LICENSE new file mode 100644 index 0000000000..a1dc19b122 --- /dev/null +++ b/projects/rdc/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved. + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/projects/rdc/README.md b/projects/rdc/README.md new file mode 100644 index 0000000000..befa104413 --- /dev/null +++ b/projects/rdc/README.md @@ -0,0 +1,632 @@ +# ROCm™ Data Center Tool (RDC) 🚀 + +The ROCm™ Data Center Tool (RDC) simplifies administration and addresses key infrastructure challenges in AMD GPUs within cluster and datacenter environments. RDC offers a suite of features to enhance your GPU management and monitoring. + +## 🌟 Main Features + +- **GPU Telemetry** 📊 +- **GPU Statistics for Jobs** 📈 +- **Integration with Third-Party Tools** 🔗 +- **Open Source** 🛠️ + +> [!NOTE] +> The published documentation is available at [ROCm Data Center Tool](https://rocm.docs.amd.com/projects/rdc/en/latest/index.html) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the `rdc/docs` folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html). + +## 🛠️ Installation Guide + +### 📋 Prerequisites + +Before setting up RDC, ensure your system meets the following requirements: + +- **Supported Platforms**: RDC runs on AMD ROCm-supported platforms. Refer to the [List of Supported Operating Systems](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html#supported-operating-systems) for details. +- **Dependencies**: + - **CMake** ≥ 3.15 + - **g++** (5.4.0) + - **Doxygen** (1.8.11) + - **LaTeX** (pdfTeX 3.14159265-2.6-1.40.16) + - **gRPC and protoc** + - **libcap-dev** + - **AMD ROCm Platform** ([GitHub](https://github.com/ROCm/ROCm)) + - **AMDSMI Library** ([GitHub](https://github.com/ROCm/amdsmi)) + - **ROCK Kernel Driver** ([GitHub](https://github.com/ROCm/ROCK-Kernel-Driver)) + +### 🔐 Certificate Generation + +For certificate generation, refer to the [**RDC Developer Handbook (Generate Files for Authentication)**](https://rocm.docs.amd.com/projects/rdc/en/latest/install/handbook.html#generate-files-for-authentication) or consult the concise guide located at `authentication/readme.txt`. + +--- + +## 🚀 Running RDC + +RDC supports two primary modes of operation: **Standalone** and **Embedded**. Choose the mode that best fits your deployment needs. + +### 🗂️ Standalone Mode + +Standalone mode allows RDC to run independently with all its components installed. + +1. **Start RDCD with Authentication (Monitor-Only Capabilities):** + + ```bash + /opt/rocm/bin/rdcd + ``` + +2. **Start RDCD with Authentication (Full Capabilities):** + + ```bash + sudo /opt/rocm/bin/rdcd + ``` + +3. **Start RDCD without Authentication (Monitor-Only):** + + ```bash + /opt/rocm/bin/rdcd -u + ``` + +4. **Start RDCD without Authentication (Full Capabilities):** + + ```bash + sudo /opt/rocm/bin/rdcd -u + ``` + +### 🔗 Embedded Mode + +Embedded mode integrates RDC directly into your existing management tools using its library format. + +- **Run RDC in Embedded Mode:** + + ```bash + python your_management_tool.py --rdc_embedded + ``` + +**Note:** Ensure that the `rdcd` daemon is not running separately when using embedded mode. + +### 🛠️ Starting RDCD Using systemd + +1. **Copy the Service File:** + + ```bash + sudo cp /opt/rocm/libexec/rdc/rdc.service /etc/systemd/system/ + ``` + +2. **Configure Capabilities:** + + - **Full Capabilities:** Ensure the following lines are **uncommented** in `/etc/systemd/system/rdc.service`: + + ```ini + CapabilityBoundingSet=CAP_DAC_OVERRIDE + AmbientCapabilities=CAP_DAC_OVERRIDE + ``` + + - **Monitor-Only Capabilities:** **Comment out** the above lines to restrict RDCD to monitoring. + +3. **Start the Service:** + + ```bash + sudo systemctl start rdc + sudo systemctl status rdc + ``` + +4. **Modify RDCD Options:** + + Edit `/opt/rocm/share/rdc/conf/rdc_options.conf` to append any additional RDCD parameters. + + ```bash + sudo nano /opt/rocm/share/rdc/conf/rdc_options.conf + ``` + + **Example Configuration:** + + ```bash + RDC_OPTS="-p 50051 -u -d" + ``` + + - **Flags:** + - `-p 50051` : Use port 50051 + - `-u` : Unauthenticated mode + - `-d` : Enable debug messages + +--- + +## 🏗️ Building RDC from Source + +If you prefer to build RDC from source, follow the steps below. + +### 🔧 Building gRPC and protoc + +**Important:** RDC requires gRPC and protoc to be built from source as pre-built packages are not available. + +1. **Install Required Tools:** + + ```bash + sudo apt-get update + sudo apt-get install automake make cmake g++ unzip build-essential autoconf libtool pkg-config libgflags-dev libgtest-dev clang libc++-dev curl libcap-dev + ``` + +2. **Clone and Build gRPC:** + + ```bash + git clone -b v1.67.1 https://github.com/grpc/grpc --depth=1 --shallow-submodules --recurse-submodules + cd grpc + export GRPC_ROOT=/opt/grpc + cmake -B build \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' \ + -DCMAKE_INSTALL_PREFIX="$GRPC_ROOT" \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=Release + make -C build -j $(nproc) + sudo make -C build install + echo "$GRPC_ROOT" | sudo tee /etc/ld.so.conf.d/grpc.conf + sudo ldconfig + cd .. + ``` + +### 🔧 Building RDC + +1. **Clone the RDC Repository:** + + ```bash + git clone https://github.com/ROCm/rdc + cd rdc + ``` + +2. **Configure the Build:** + + ```bash + cmake -B build -DGRPC_ROOT="$GRPC_ROOT" + ``` + + - **Optional Features:** + - **Enable ROCm Profiler:** + + ```bash + cmake -B build -DBUILD_PROFILER=ON + ``` + + - **Enable RVS:** + + ```bash + cmake -B build -DBUILD_RVS=ON + ``` + + - **Build RDC Library Only (without rdci and rdcd):** + + ```bash + cmake -B build -DBUILD_STANDALONE=OFF + ``` + + - **Build RDC Library Without ROCm Run-time:** + + ```bash + cmake -B build -DBUILD_RUNTIME=OFF + ``` + +3. **Build and Install:** + + ```bash + make -C build -j $(nproc) + sudo make -C build install + ``` + +4. **Update System Library Path:** + + ```bash + export RDC_LIB_DIR=/opt/rocm/lib/rdc + export GRPC_LIB_DIR="/opt/grpc/lib" + echo "${RDC_LIB_DIR}" | sudo tee /etc/ld.so.conf.d/x86_64-librdc_client.conf + echo "${GRPC_LIB_DIR}" | sudo tee -a /etc/ld.so.conf.d/x86_64-librdc_client.conf + sudo ldconfig + ``` + +--- + +## 📊 Features Overview + +### 🔍 Discovery + +Locate and display information about GPUs present in a compute node. + +**Example:** + +```bash +rdci discovery -l +``` + +**Output:** + +``` +2 GPUs found + ++-----------+----------------------------------------------+ +| GPU Index | Device Information | ++-----------+----------------------------------------------+ +| 0 | Name: AMD Radeon Instinct MI50 Accelerator | +| 1 | Name: AMD Radeon Instinct MI50 Accelerator | ++-----------+----------------------------------------------+ +``` + +## 👥 Groups + +#### 🖥️ GPU Groups + +Create, delete, and list logical groups of GPUs. + +**Create a Group:** + +```bash +rdci group -c GPU_GROUP +``` + +**Add GPUs to Group:** + +```bash +rdci group -g 1 -a 0,1 +``` + +**List Groups:** + +```bash +rdci group -l +``` + +**Delete a Group:** + +```bash +rdci group -d 1 +``` + +#### 🗂️ Field Groups + +Manage field groups to monitor specific GPU metrics. + +**Create a Field Group:** + +```bash +rdci fieldgroup -c -f 150,155 +``` + +**List Field Groups:** + +```bash +rdci fieldgroup -l +``` + +**Delete a Field Group:** + +```bash +rdci fieldgroup -d 1 +``` +> [!IMPORTANT] +>### 🛑 Monitor Errors +> +>Define fields to monitor RAS ECC counters. +> +>- **Correctable ECC Errors:** +> +> ```bash +> 312 RDC_FI_ECC_CORRECT_TOTAL +> ``` +> +>- **Uncorrectable ECC Errors:** +> +> ```bash +> 313 RDC_FI_ECC_UNCORRECT_TOTAL +> ``` + +### 📈 Device Monitoring + +Monitor GPU fields such as temperature, power usage, and utilization. + +**Command:** + +```bash +rdci dmon -f -g -c 5 -d 1000 +``` + +**Sample Output:** + +``` +1 group found + ++-----------+-------------+---------------+ +| GPU Index | TEMP (m°C) | POWER (µW) | ++-----------+-------------+---------------+ +| 0 | 25000 | 520500 | ++-----------+-------------+---------------+ +``` + +### 📊 Job Stats + +Display GPU statistics for any given workload. + +**Start Recording Stats:** + +```bash +rdci stats -s 2 -g 1 +``` + +**Stop Recording Stats:** + +```bash +rdci stats -x 2 +``` + +**Display Job Stats:** + +```bash +rdci stats -j 2 +``` + +**Sample Output:** + +``` +Summary: +Executive Status: + +Start time: 1586795401 +End time: 1586795445 +Total execution time: 44 + +Energy Consumed (Joules): 21682 +Power Usage (Watts): Max: 49 Min: 13 Avg: 34 +GPU Clock (MHz): Max: 1000 Min: 300 Avg: 903 +GPU Utilization (%): Max: 69 Min: 0 Avg: 2 +Max GPU Memory Used (bytes): 524320768 +Memory Utilization (%): Max: 12 Min: 11 Avg: 12 +``` + +### 🩺 Diagnostic + +Run diagnostics on a GPU group to ensure system health. + +**Command:** + +```bash +rdci diag -g +``` + +**Sample Output:** + +``` +No compute process: Pass +Node topology check: Pass +GPU parameters check: Pass +Compute Queue ready: Pass +System memory check: Pass +=============== Diagnostic Details ================== +No compute process: No processes running on any devices. +Node topology check: No link detected. +GPU parameters check: GPU 0 Critical Edge temperature in range. +Compute Queue ready: Run binary search task on GPU 0 Pass. +System memory check: Max Single Allocation Memory Test for GPU 0 Pass. CPUAccessToGPUMemoryTest for GPU 0 Pass. GPUAccessToCPUMemoryTest for GPU 0 Pass. +``` + +--- + +## 🔌 Integration with Third-Party Tools + +RDC integrates seamlessly with tools like **Prometheus**, **Grafana**, and **Reliability, Availability, and Serviceability (RAS)** to enhance monitoring and visualization. + +### 🐍 Python Bindings + +RDC provides a generic Python class `RdcReader` to simplify telemetry gathering. + +**Sample Program:** + +```python +from RdcReader import RdcReader +from RdcUtil import RdcUtil +from rdc_bootstrap import * +import time + +default_field_ids = [ + rdc_field_t.RDC_FI_POWER_USAGE, + rdc_field_t.RDC_FI_GPU_UTIL +] + +class SimpleRdcReader(RdcReader): + def __init__(self): + super().__init__(ip_port=None, field_ids=default_field_ids, update_freq=1000000) + + def handle_field(self, gpu_index, value): + field_name = self.rdc_util.field_id_string(value.field_id).lower() + print(f"{value.ts} {gpu_index}:{field_name} {value.value.l_int}") + +if __name__ == '__main__': + reader = SimpleRdcReader() + while True: + time.sleep(1) + reader.process() +``` + +**Running the Example:** + +```bash +# Ensure RDC shared libraries are in the library path and RdcReader.py is in PYTHONPATH +python SimpleReader.py +``` + +### 📈 Prometheus Plugin + +The Prometheus plugin allows you to monitor events and send alerts. + +**Installation:** + +1. **Install Prometheus Client:** + + ```bash + pip install prometheus_client + ``` + +2. **Run the Prometheus Plugin:** + + ```bash + python rdc_prometheus.py + ``` + +3. **Verify Plugin:** + + ```bash + curl localhost:5000 + ``` + +**Integration Steps:** + +1. **Download and Install Prometheus:** + - [Prometheus GitHub](https://github.com/prometheus/prometheus) + +2. **Configure Prometheus Targets:** + - Modify `prometheus_targets.json` to point to your compute nodes. + + ```json + [ + { + "targets": [ + "rdc_test1.amd.com:5000", + "rdc_test2.amd.com:5000" + ] + } + ] + ``` + +3. **Start Prometheus with Configuration File:** + + ```bash + prometheus --config.file=/path/to/rdc_prometheus_example.yml + ``` + +4. **Access Prometheus UI:** + - Open [http://localhost:9090](http://localhost:9090) in your browser. + +### 📊 Grafana Integration + +Grafana provides advanced visualization capabilities for RDC metrics. + +**Installation:** + +1. **Download Grafana:** + - [Grafana Download](https://grafana.com/grafana/download) + +2. **Install Grafana:** + - Follow the [Installation Instructions](https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/). + +3. **Start Grafana Server:** + + ```bash + sudo systemctl start grafana-server + sudo systemctl status grafana-server + ``` + +4. **Access Grafana:** + - Open [http://localhost:3000](http://localhost:3000/) in your browser and log in with the default credentials (`admin`/`admin`). + +**Configuration Steps:** + +1. **Add Prometheus Data Source:** + - Navigate to **Configuration → Data Sources → Add data source → Prometheus**. + - Set the URL to [http://localhost:9090](http://localhost:9090) and save. + +2. **Import RDC Dashboard:** + - Click the **+** icon and select **Import**. + - Upload `rdc_grafana_dashboard_example.json` from the `python_binding` folder. + - Select the desired compute node for visualization. + +### 🛡️ Reliability, Availability, and Serviceability (RAS) Plugin + +The RAS plugin enables monitoring and counting of ECC (Error-Correcting Code) errors. + +**Installation:** + +1. **Ensure GPU Supports RAS:** + - The GPU must support RAS features. + +2. **RDC Installation Includes RAS Library:** + - `librdc_ras.so` is located in `/opt/rocm-4.2.0/rdc/lib`. + +**Usage:** + +- **Monitor ECC Errors:** + + ```bash + rdci dmon -i 0 -e 600,601 + ``` + + **Sample Output:** + + ``` + GPU ECC_CORRECT ECC_UNCORRECT + 0 0 0 + ``` + +--- +> [!IMPORTANT] +>## 🐞 Troubleshooting +> +> ### Known Issues +>#### 🛑 dmon Fields Return N/A +> +>1. **Missing Libraries:** +> - Verify `/opt/rocm/lib/rdc/librdc_*.so` exists. +> - Ensure all related libraries (rocprofiler, rocruntime, etc.) are present. +> +>2. **Unsupported GPU:** +> - Most metrics work on MI300 and newer. +> - Limited metrics on MI200. +> - Consumer GPUs (e.g., RX6800) have fewer supported metrics. +> +>#### 🐍 dmon RocProfiler Fields Return Zeros +> +>**Error Message:** +> +>``` +>terminate called after throwing an instance of 'std::runtime_error' +> what(): hsa error code: 4104 HSA_STATUS_ERROR_OUT_OF_RESOURCES: The runtime failed to allocate the necessary resources. This error may also occur when the core runtime library needs to spawn threads or create internal OS-specific events. +>Aborted (core dumped) +>``` +> +>**Solution:** +> +>1. **Missing Groups:** +> - Ensure `video` and `render` groups exist. +> +> ```bash +> sudo usermod -aG video,render $USER +> ``` +> +> - Log out and log back in to apply group changes. +> +>### 🐛 Troubleshooting RDCD +> +>- **View RDCD Logs:** +> +> ```bash +> sudo journalctl -u rdc +> ``` +> +>- **Run RDCD with Debug Logs:** +> +> ```bash +> RDC_LOG=DEBUG /opt/rocm/bin/rdcd +> ``` +> +> - **Logging Levels Supported:** ERROR, INFO, DEBUG +> +>- **Enable Additional Logging Messages:** +> +> ```bash +> export RSMI_LOGGING=3 +> ``` + +--- + +## 📄 License + +RDC is open-source and available under the [MIT License](https://opensource.org/licenses/MIT). + +--- + +## 📧 Support + +For support and further inquiries, please refer to the [**ROCm Documentation**](https://rocm.docs.amd.com/projects/rdc/en/latest/) or contact the maintainers through the repository's issue tracker. diff --git a/projects/rdc/authentication/01gen_root_cert.sh b/projects/rdc/authentication/01gen_root_cert.sh new file mode 100755 index 0000000000..fc7810d7c2 --- /dev/null +++ b/projects/rdc/authentication/01gen_root_cert.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# This script should be called only once to generate a root +# certificate + +mkdir -p CA +pushd CA +mkdir private newcerts +chmod 700 private newcerts + +# Our next step is to create a database for the certificates we will sign: +echo '01' >serial +touch index.txt + +# openssl_part1.cnf + +# Create the Root Certificate +# This call of openssl encrypts the keys +# openssl req -new -x509 extensions v3_ca -keyout private/rdc_cakey.pem \ +# -out rdc_cacert.pem -days 3650 -config ../openssl.cnf + +# This call of openssl does not encrypt the keys +openssl req -new -x509 -nodes -extensions v3_ca -keyout private/rdc_cakey.pem \ + -out rdc_cacert.pem -days 3650 -config ../openssl.cnf +# This generates: +# A private key in private/rdc_cakey.pem +# A root CA certificate in rdc_cacert.pem (distribute to clients) + +popd + diff --git a/projects/rdc/authentication/02gen_ssl_artifacts.sh b/projects/rdc/authentication/02gen_ssl_artifacts.sh new file mode 100755 index 0000000000..0e5d6f0171 --- /dev/null +++ b/projects/rdc/authentication/02gen_ssl_artifacts.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# This script generates ssl keys and self-signed certificates + +INSTALL_RT="artifacts" + +generate_artifacts() { + HOST=$1 + echo "**********************************" + echo "*** Generating $HOST artifacts ***" + echo "**********************************" + + mkdir -p ${INSTALL_RT}/${HOST}/private + mkdir -p ${INSTALL_RT}/${HOST}/certs + + echo "Generate CSR..." + openssl req -new -nodes -out rdc_csr.pem -config ../openssl.cnf + echo "Sign Certificate..." + openssl ca -out rdc_${HOST}_cert.pem -config ../openssl.cnf -infiles rdc_csr.pem + mv rdc_${HOST}_cert.pem ${INSTALL_RT}/${HOST}/certs/ + mv key.pem ${INSTALL_RT}/${HOST}/private/rdc_${HOST}_cert.key + cp rdc_cacert.pem ${INSTALL_RT}/${HOST}/certs/ +} + +pushd CA +echo +echo "**********************" +echo "IMPORTANT:" +echo " * Make sure to use the same hostname (wildcards accepted) each" +echo " time when prompted for \"Common Name\"" +echo " * Make sure to select \"y\" when you are asked whether you want" +echo " to sign the certificates" +echo "**********************" +echo +generate_artifacts "server" +generate_artifacts "client" +rm rdc_cacert.pem +cp ../install_client.sh ../install_server.sh $INSTALL_RT + +popd + + diff --git a/projects/rdc/authentication/install_client.sh b/projects/rdc/authentication/install_client.sh new file mode 100755 index 0000000000..9b89171ce0 --- /dev/null +++ b/projects/rdc/authentication/install_client.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Note: +# * This script should reside in the artifacts directory +# when executed. +# * This script may require root privilege + +if [ $# -lt 1 ]; then + echo "Need to specify a installation root directory (e.g., /etc/rdc)" + exit 1 +fi + +INSTALL_DIR=$1 +mkdir -p $INSTALL_DIR +cp -R client $INSTALL_DIR +chown -R rdc:rdc $INSTALL_DIR/client + diff --git a/projects/rdc/authentication/install_server.sh b/projects/rdc/authentication/install_server.sh new file mode 100755 index 0000000000..49a9ec0465 --- /dev/null +++ b/projects/rdc/authentication/install_server.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Note: +# * This script should reside in the artifacts directory +# when executed. +# * This script may require root privilege + +if [ $# -lt 1 ]; then + echo "Need to specify a installation root directory (e.g., /etc/rdc)" + exit 1 +fi + +INSTALL_DIR=$1 +mkdir -p $INSTALL_DIR +cp -R server $INSTALL_DIR +mkdir -p $INSTALL_DIR/client/certs +cp client/certs/rdc_cacert.pem $INSTALL_DIR/client/certs +chmod 700 $INSTALL_DIR/server/private +chown -R rdc:rdc $INSTALL_DIR/server +chown -R rdc:rdc $INSTALL_DIR/client + diff --git a/projects/rdc/authentication/openssl.cnf b/projects/rdc/authentication/openssl.cnf new file mode 100755 index 0000000000..0d1e093028 --- /dev/null +++ b/projects/rdc/authentication/openssl.cnf @@ -0,0 +1,90 @@ +# +# OpenSSL configuration file. +# + +# Establish working directory. + +dir = . + +[ ca ] +default_ca = CA_default + +[ CA_default ] +serial = $dir/serial +database = $dir/index.txt +new_certs_dir = $dir/newcerts +certificate = $dir/rdc_cacert.pem +private_key = $dir/private/rdc_cakey.pem +default_days = 365 +default_md = sha512 +preserve = no +email_in_dn = no +nameopt = default_ca +certopt = default_ca +policy = policy_match +unique_subject = no +copy_extensions = copyall + +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +[ req ] +default_bits = 4096 # Size of keys +default_keyfile = key.pem # name of generated keys +default_md = sha512 # message digest algorithm +string_mask = nombstr # permitted characters +distinguished_name = req_distinguished_name +req_extensions = v3_req + +[ req_distinguished_name ] +# Variable name Prompt string +#---------------------- ---------------------------------- +0.organizationName = Organization Name (company) +organizationalUnitName = Organizational Unit Name (department, division) +emailAddress = Email Address +emailAddress_max = 40 +localityName = Locality Name (city, district) +stateOrProvinceName = State or Province Name (full name) +countryName = Country Name (2 letter code) +countryName_min = 2 +countryName_max = 2 +commonName = Common Name (hostname, IP, or your name) +commonName_max = 64 + +#------------------------------------------------------------------------------- +# Specify default values below for the fields above. This speeds things up if +# and is more consistent if you have to run the openssl commands repeatedly. +#------------------------------------------------------------------------------- +# < ** REPLACE VALUES IN THIS SECTION WITH APPROPRIATE VALUES FOR YOUR ORG. **> +0.organizationName_default = MyCompany +organizationalUnitName_default = MyCompanyUnit +emailAddress_default = MyEmailAddress +localityName_default = MyCity +stateOrProvinceName_default = MyStateProvince +countryName_default = MC +# wildcards are acceptable for domain; e.g., *.amd.com +commonName_default = Mydomain + +[ v3_ca ] +basicConstraints = CA:TRUE +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always + +[ v3_req ] +basicConstraints = CA:FALSE +subjectKeyIdentifier = hash +subjectAltName = @alt_names + +[ req_ext ] +subjectAltName = @alt_names + +[alt_names] +# < ** MODIFY BELOW TO YOUR NEEDS. WILDCARDS ARE ACCEPTED. **> +DNS.1 = localhost +DNS.2 = *.amd.com + diff --git a/projects/rdc/authentication/readme.txt b/projects/rdc/authentication/readme.txt new file mode 100644 index 0000000000..3200d69cf4 --- /dev/null +++ b/projects/rdc/authentication/readme.txt @@ -0,0 +1,11 @@ +# How-to generate authentication files + +1. Modify openssl.cnf to match your company info +2. ./01gen_root_cert.sh +3. ./02gen_ssl_artifacts.sh +4. cd CA/artifacts +5. sudo ./install_client.sh /etc/rdc +6. sudo ./install_server.sh /etc/rdc + +For a full guide refer to: +https://rocm.docs.amd.com/projects/rdc/en/latest/install/handbook.html#generate-files-for-authentication diff --git a/projects/rdc/cmake_modules/Findrocprofiler.cmake b/projects/rdc/cmake_modules/Findrocprofiler.cmake new file mode 100644 index 0000000000..559e90eece --- /dev/null +++ b/projects/rdc/cmake_modules/Findrocprofiler.cmake @@ -0,0 +1,38 @@ +# This module provides a rocprofiler::rocprofiler package +# You can specify the ROCM directory by setting ROCM_DIR + +set(NAME rocprofiler) + +if(NOT DEFINED ROCM_DIR) + set(ROCM_DIR "/opt/rocm") +endif() +list(APPEND CMAKE_PREFIX_PATH ${ROCM_DIR}) + +find_library(${NAME}_LIBRARY NAMES ${NAME} ${NAME}64 REQUIRED REGISTRY_VIEW BOTH PATH_SUFFIXES lib) + +if(NOT DEFINED (${NAME}_INCLUDE_DIR)) + find_path( + ${NAME}_INCLUDE_DIR + NAMES ${NAME}.h + HINTS "${ROCM_DIR}/include" + PATH_SUFFIXES ${NAME} ${NAME}/inc + ) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + ${NAME} + FOUND_VAR ${NAME}_FOUND + REQUIRED_VARS ${NAME}_LIBRARY ${NAME}_INCLUDE_DIR +) + +if(${NAME}_FOUND AND NOT TARGET ${NAME}::${NAME}) + add_library(${NAME}::${NAME} UNKNOWN IMPORTED) + set_target_properties( + ${NAME}::${NAME} + PROPERTIES + IMPORTED_LOCATION "${${NAME}_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PC_${NAME}_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIR}" + ) +endif() diff --git a/projects/rdc/cmake_modules/Findrvs.cmake b/projects/rdc/cmake_modules/Findrvs.cmake new file mode 100644 index 0000000000..981e659a36 --- /dev/null +++ b/projects/rdc/cmake_modules/Findrvs.cmake @@ -0,0 +1,68 @@ +# This module provides a rvs::rvs package +# You can specify the ROCM directory by setting ROCM_DIR + +set(NAME rvs) + +if(NOT DEFINED ROCM_DIR) + set(ROCM_DIR "/opt/rocm") +endif() +list(APPEND CMAKE_PREFIX_PATH ${ROCM_DIR}) + +find_library( + ${NAME}_LIBRARY + NAMES + ${NAME} + ${NAME}64 + ${NAME}lib # RVS is special and is named librvslib.so + REQUIRED + REGISTRY_VIEW + BOTH + PATH_SUFFIXES lib +) + +if(NOT DEFINED (${NAME}_INCLUDE_DIR)) + find_path( + ${NAME}_INCLUDE_DIR + NAMES ${NAME}.h + HINTS "${ROCM_DIR}/include" + PATH_SUFFIXES ${NAME} ${NAME}/inc + ) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + ${NAME} + FOUND_VAR ${NAME}_FOUND + REQUIRED_VARS ${NAME}_LIBRARY ${NAME}_INCLUDE_DIR +) + +if(${NAME}_FOUND AND NOT TARGET ${NAME}::${NAME}) + add_library(${NAME}::${NAME} UNKNOWN IMPORTED) + set_target_properties( + ${NAME}::${NAME} + PROPERTIES + IMPORTED_LOCATION "${${NAME}_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PC_${NAME}_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIR}" + ) + find_library(rocm-core NAMES rocm-core REQUIRED) + find_package(yaml-cpp REQUIRED) + find_package(rocblas REQUIRED) + find_package(hipblaslt REQUIRED) + find_package(hsakmt REQUIRED) + find_package(hip REQUIRED) + find_package(hsa-runtime64 REQUIRED) + find_package(amd_smi REQUIRED) + target_link_libraries( + ${NAME}::${NAME} + INTERFACE + ${rocm-core} + yaml-cpp + roc::rocblas + roc::hipblaslt + hsakmt::hsakmt + hip::amdhip64 + hsa-runtime64::hsa-runtime64 + amd_smi + ) +endif() diff --git a/projects/rdc/cmake_modules/rdc-config-version.cmake.in b/projects/rdc/cmake_modules/rdc-config-version.cmake.in new file mode 100644 index 0000000000..dbfe16400c --- /dev/null +++ b/projects/rdc/cmake_modules/rdc-config-version.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "@RDC_VERSION@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/projects/rdc/cmake_modules/rdc-config.cmake.in b/projects/rdc/cmake_modules/rdc-config.cmake.in new file mode 100644 index 0000000000..b35fa387ee --- /dev/null +++ b/projects/rdc/cmake_modules/rdc-config.cmake.in @@ -0,0 +1,19 @@ +# - Config file for the rdc package +# It defines the following variables +# RDC_INCLUDE_DIRS - include directories for rdc +# RDC_LIBRARIES - libraries to link against + +@PACKAGE_INIT@ + +# Compute paths +get_filename_component(RDC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(ROCM_RDC_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") +set(ROCM_RDC_LIB_DIR "${PACKAGE_PREFIX_DIR}/${CMAKE_INSTALL_LIBDIR}") + +# Our library dependencies (contains definitions for IMPORTED targets) +if(NOT TARGET rdc_libs AND NOT rdc_BINARY_DIR) + include("${RDC_CMAKE_DIR}/rdcTargets.cmake") +endif() + +# These are IMPORTED targets created by rdcTargets.cmake +set(ROCM_RDC_LIBRARIES "@CONF_LIBS@") diff --git a/projects/rdc/cmake_modules/utils.cmake b/projects/rdc/cmake_modules/utils.cmake new file mode 100755 index 0000000000..d2b1333614 --- /dev/null +++ b/projects/rdc/cmake_modules/utils.cmake @@ -0,0 +1,126 @@ +################################################################################ +## +## The University of Illinois/NCSA +## Open Source License (NCSA) +## +## Copyright (c) 2014-2017, Advanced Micro Devices, Inc. All rights reserved. +## +## Developed by: +## +## AMD Research and AMD HSA Software Development +## +## Advanced Micro Devices, Inc. +## +## www.amd.com +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to +## deal with the Software without restriction, including without limitation +## the rights to use, copy, modify, merge, publish, distribute, sublicense, +## and#or sell copies of the Software, and to permit persons to whom the +## Software is furnished to do so, subject to the following conditions: +## +## - Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimers. +## - Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimers in +## the documentation and#or other materials provided with the distribution. +## - Neither the names of Advanced Micro Devices, Inc, +## nor the names of its contributors may be used to endorse or promote +## products derived from this Software without specific prior written +## permission. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +## THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +## OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +## ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +## DEALINGS WITH THE SOFTWARE. +## +################################################################################ + +## Parses the VERSION_STRING variable and places +## the first, second and third number values in +## the major, minor and patch variables. +function(parse_version VERSION_STRING) + string(FIND ${VERSION_STRING} "-" STRING_INDEX) + + if(${STRING_INDEX} GREATER -1) + math(EXPR STRING_INDEX "${STRING_INDEX} + 1") + string(SUBSTRING ${VERSION_STRING} ${STRING_INDEX} -1 VERSION_BUILD) + endif() + + string(REGEX MATCHALL "[0123456789]+" VERSIONS ${VERSION_STRING}) + list(LENGTH VERSIONS VERSION_COUNT) + + if(${VERSION_COUNT} GREATER 0) + list(GET VERSIONS 0 MAJOR) + set(VERSION_MAJOR ${MAJOR} PARENT_SCOPE) + set(TEMP_VERSION_STRING "${MAJOR}") + endif() + + if(${VERSION_COUNT} GREATER 1) + list(GET VERSIONS 1 MINOR) + set(VERSION_MINOR ${MINOR} PARENT_SCOPE) + set(TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${MINOR}") + endif() + + if(${VERSION_COUNT} GREATER 2) + list(GET VERSIONS 2 PATCH) + set(VERSION_PATCH ${PATCH} PARENT_SCOPE) + set(TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${PATCH}") + endif() + + set(VERSION_STRING "${TEMP_VERSION_STRING}" PARENT_SCOPE) +endfunction() + +## Gets the current version of the repository +## using versioning tags and git describe. +## Passes back a packaging version string +## and a library version string. +function(get_version_from_tag DEFAULT_VERSION_STRING VERSION_PREFIX GIT) + parse_version(${DEFAULT_VERSION_STRING}) + + if(GIT) + execute_process( + COMMAND git describe --tags --dirty --long --match ${VERSION_PREFIX}-[0-9.]* + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_TAG_STRING + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE RESULT + ) + if(${RESULT} EQUAL 0) + parse_version(${GIT_TAG_STRING}) + endif() + endif() + + set(VERSION_STRING "${VERSION_STRING}" PARENT_SCOPE) + set(VERSION_MAJOR "${VERSION_MAJOR}" PARENT_SCOPE) + set(VERSION_MINOR "${VERSION_MINOR}" PARENT_SCOPE) + set(VERSION_PATCH "${VERSION_PATCH}" PARENT_SCOPE) +endfunction() + +function(num_change_since_prev_pkg VERSION_PREFIX) + find_program(get_commits NAMES version_util.sh PATHS ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules) + if(get_commits) + execute_process( + COMMAND ${get_commits} -c ${VERSION_PREFIX} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE NUM_COMMITS + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE RESULT + ) + + set(NUM_COMMITS "${NUM_COMMITS}" PARENT_SCOPE) + + if(${RESULT} EQUAL 0) + message("${NUM_COMMITS} were found since previous release") + else() + message("Unable to determine number of commits since previous release") + endif() + else() + message("WARNING: Didn't find version_util.sh") + set(NUM_COMMITS "unknown" PARENT_SCOPE) + endif() +endfunction() diff --git a/projects/rdc/cmake_modules/version_util.sh b/projects/rdc/cmake_modules/version_util.sh new file mode 100755 index 0000000000..b55f9e8207 --- /dev/null +++ b/projects/rdc/cmake_modules/version_util.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Handle commandline args +while [ "$1" != "" ]; do + case $1 in + -c ) # Commits since prevous tag + TARGET="count" ;; + * ) + TARGET="count" + break ;; + esac + shift 1 +done +TAG_PREFIX=$1 +reg_ex="${TAG_PREFIX}*" + +commits_since_last_tag() { + TAG_ARR=(`git tag --sort=committerdate -l ${reg_ex} | tail -2`) + # if we don't have 2 tags, just say there were 0 commits since + # last tag + if [ ${#TAG_ARR[@]} != 2 ]; then + echo 0 + exit 0 + fi + + PREVIOUS_TAG=${TAG_ARR[0]} + CURRENT_TAG=${TAG_ARR[1]} + + PREV_CMT_NUM=`git rev-list --count $PREVIOUS_TAG` + CURR_CMT_NUM=`git rev-list --count $CURRENT_TAG` + + # Commits since prevous tag: + let NUM_COMMITS="${CURR_CMT_NUM}-${PREV_CMT_NUM}" + echo $NUM_COMMITS +} + +case $TARGET in + count) commits_since_last_tag ;; + *) die "Invalid target $target" ;; +esac + +exit 0 + diff --git a/projects/rdc/common/rdc_capabilities.cc b/projects/rdc/common/rdc_capabilities.cc new file mode 100644 index 0000000000..db41302288 --- /dev/null +++ b/projects/rdc/common/rdc_capabilities.cc @@ -0,0 +1,95 @@ +/* +Copyright (c) 2021 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include "common/rdc_capabilities.h" + +#include +#include +#include + +namespace amd { +namespace rdc { + +int GetCapability(cap_value_t cap, cap_flag_t cap_type, bool* enabled) { + cap_t caps; + + assert(enabled != nullptr); + + if (enabled == nullptr) { + return -1; + } + + // Get process's current capabilities + caps = cap_get_proc(); + if (caps == nullptr) { + return errno; + } + + cap_flag_value_t val; + if (cap_get_flag(caps, cap, cap_type, &val) == -1) { + int ret = errno; + cap_free(caps); + return ret; + } + + if (cap_free(caps) == -1) { + return errno; + } + + *enabled = (val == CAP_SET ? true : false); + + return 0; +} + +// !enable means disable; +int ModifyCapability(cap_value_t cap, cap_flag_t cap_type, bool enable) { + cap_t caps; + cap_value_t cap_list[1]; + + // Get process's current capabilities + caps = cap_get_proc(); + if (caps == nullptr) { + return errno; + } + + // the 1 in the call below is the size of the cap_list array + cap_list[0] = cap; + if (cap_set_flag(caps, cap_type, 1, cap_list, enable ? CAP_SET : CAP_CLEAR) == -1) { + int ret = errno; + cap_free(caps); + return ret; + } + + if (cap_set_proc(caps) == -1) { + int ret = errno; + cap_free(caps); + return ret; + } + + if (cap_free(caps) == -1) { + return errno; + } + return 0; +} + +} // namespace rdc +} // namespace amd diff --git a/projects/rdc/common/rdc_capabilities.h b/projects/rdc/common/rdc_capabilities.h new file mode 100644 index 0000000000..15b8e793db --- /dev/null +++ b/projects/rdc/common/rdc_capabilities.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 2021 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#ifndef COMMON_RDC_CAPABILITIES_H_ +#define COMMON_RDC_CAPABILITIES_H_ + +#include + +namespace amd { +namespace rdc { + +int GetCapability(cap_value_t cap, cap_flag_t cap_type, bool* enabled); +int ModifyCapability(cap_value_t cap, cap_flag_t cap_type, bool enable); + +struct ScopedCapability { + ScopedCapability(cap_value_t cp, cap_flag_t cpt) : cap_(cp), cap_type_(cpt), error_(0) { + error_ = ModifyCapability(cap_, cap_type_, true); + } + ~ScopedCapability() { error_ = ModifyCapability(cap_, cap_type_, false); } + void Relinquish(void) { error_ = ModifyCapability(cap_, cap_type_, false); } + int error(void) { return error_; } + + private: + cap_value_t cap_; + cap_flag_t cap_type_; + int error_; +}; + +} // namespace rdc +} // namespace amd + +#endif // COMMON_RDC_CAPABILITIES_H_ diff --git a/projects/rdc/common/rdc_field.data b/projects/rdc/common/rdc_field.data new file mode 100644 index 0000000000..6e447974ea --- /dev/null +++ b/projects/rdc/common/rdc_field.data @@ -0,0 +1,241 @@ +/* +Copyright (c) 2020 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +// clang-format off + +// Description Fields: +// Arg # Type Meaning +// ------------------------------------------------- +// 1 rdc_field_t enum of field +// 2 string description of enum +// 3 string rdci display label +// 4 bool do or do not display in rdci +// rdc_field_t Description rdci label To Display +// =========== =========== ========= ========== +#ifndef FLD_DESC_ENT +#define FLD_DESC_ENT(ID, DESC, LABEL, DISPLAY) +#endif + +FLD_DESC_ENT(RDC_FI_INVALID, "Unknown/Invalid field", "INVALID", false) +FLD_DESC_ENT(RDC_FI_GPU_COUNT, "GPU count in the system", "GPU_COUNT", true) +FLD_DESC_ENT(RDC_FI_DEV_NAME, "Name of the device", "DEV_NAME", true) +FLD_DESC_ENT(RDC_FI_OAM_ID, "OAM ID of the device", "OAM_ID", true) + +FLD_DESC_ENT(RDC_FI_DEV_ID, "ID of the device", "DEV_ID", true) +FLD_DESC_ENT(RDC_FI_REV_ID, "Revision ID of the device", "REV_ID", true) +FLD_DESC_ENT(RDC_FI_TARGET_GRAPHICS_VERSION, "GFX version of the device", "GFX", true) +FLD_DESC_ENT(RDC_FI_NUM_OF_COMPUTE_UNITS, "Number of Compute Units", "COMPUTE_UNITS", true) +FLD_DESC_ENT(RDC_FI_UUID, "Unique ID of the device AKA asic_serial", "UUID", true) +FLD_DESC_ENT(RDC_FI_GPU_PARTITION_COUNT, "GPU partition count", "PARTITION_COUNT", true) + +FLD_DESC_ENT(RDC_FI_GPU_CLOCK, "Current GPU clock frequencies", "GPU_CLOCK", true) +FLD_DESC_ENT(RDC_FI_MEM_CLOCK, "Current Memory clock frequencies", "MEM_CLOCK", true) +FLD_DESC_ENT(RDC_FI_MEMORY_TEMP, "Memory temperature in millidegrees Celsius", "MEMORY_TEMP", true) +FLD_DESC_ENT(RDC_FI_GPU_TEMP, "GPU temperature in millidegrees Celsius", "GPU_TEMP", true) +FLD_DESC_ENT(RDC_FI_POWER_USAGE, "Power usage in microwatts", "POWER_USAGE", true) +FLD_DESC_ENT(RDC_FI_PCIE_TX, "PCIe Tx utilization in bytes/second", "PCIE_TX", true) +FLD_DESC_ENT(RDC_FI_PCIE_RX, "PCIe Rx utilization in bytes/second", "PCIE_RX", true) +FLD_DESC_ENT(RDC_FI_PCIE_BANDWIDTH, "PCIe bandwidth in Mbps", "PCIE_BANDWIDTH", true) + +FLD_DESC_ENT(RDC_FI_GPU_UTIL, "GPU busy percentage", "GPU_UTIL", true) +FLD_DESC_ENT(RDC_FI_GPU_MEMORY_USAGE, "Memory usage of the GPU instance in bytes", "GPU_MEMORY_USAGE", true) +FLD_DESC_ENT(RDC_FI_GPU_MEMORY_TOTAL, "Total memory of the GPU instance", "GPU_MEMORY_TOTAL", true) +FLD_DESC_ENT(RDC_FI_GPU_MM_ENC_UTIL, "Mutilmedia encoder busy percentage", "GPU_MM_ENC_UTIL", true) +FLD_DESC_ENT(RDC_FI_GPU_MM_DEC_UTIL, "Mutilmedia decoder busy percentage", "GPU_MM_DEC_UTIL", true) +FLD_DESC_ENT(RDC_FI_GPU_MEMORY_ACTIVITY, "Memory busy percentage", "GPU_MEM_UTIL", true) +FLD_DESC_ENT(RDC_FI_GPU_MEMORY_MAX_BANDWIDTH, "Memory max bandwidth", "GPU_MEM_MAX_BANDWIDTH", true) +FLD_DESC_ENT(RDC_FI_GPU_MEMORY_CUR_BANDWIDTH, "Memory current bandwidth", "GPU_MEM_CUR_BANDWIDTH", true) +FLD_DESC_ENT(RDC_FI_GPU_BUSY_PERCENT, "GPU busy percentage", "GPU_BUSY_PERCENT", true) +FLD_DESC_ENT(RDC_FI_GPU_PAGE_RETRIED, "Retried page of the GPU instance", "GPU_PAGE_RETRIED", true) + +// ECC totals +FLD_DESC_ENT(RDC_FI_ECC_CORRECT_TOTAL, "Accumulated Single Error Correction", "ECC_CORRECT", true) +FLD_DESC_ENT(RDC_FI_ECC_UNCORRECT_TOTAL, "Accumulated Double Error Detection", "ECC_UNCORRECT", true) + +// ECC blocks +FLD_DESC_ENT(RDC_FI_ECC_SDMA_CE, "SDMA Correctable Error", "ECC_SDMA_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_SDMA_UE, "SDMA Uncorrectable Error", "ECC_SDMA_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_GFX_CE, "GFX Correctable Error", "ECC_GFX_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_GFX_UE, "GFX Uncorrectable Error", "ECC_GFX_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_MMHUB_CE, "MMHUB Correctable Error", "ECC_MMHUB_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_MMHUB_UE, "MMHUB Uncorrectable Error", "ECC_MMHUB_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_ATHUB_CE, "ATHUB Correctable Error", "ECC_ATHUB_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_ATHUB_UE, "ATHUB Uncorrectable Error", "ECC_ATHUB_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_PCIE_BIF_CE, "PCIE_BIF Correctable Error", "ECC_PCIE_BIF_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_PCIE_BIF_UE, "PCIE_BIF Uncorrectable Error", "ECC_PCIE_BIF_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_HDP_CE, "HDP Correctable Error", "ECC_HDP_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_HDP_UE, "HDP Uncorrectable Error", "ECC_HDP_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_XGMI_WAFL_CE, "XGMI_WAFL Correctable Error", "ECC_XGMI_WAFL_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_XGMI_WAFL_UE, "XGMI_WAFL Uncorrectable Error", "ECC_XGMI_WAFL_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_DF_CE, "DF Correctable Error", "ECC_DF_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_DF_UE, "DF Uncorrectable Error", "ECC_DF_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_SMN_CE, "SMN Correctable Error", "ECC_SMN_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_SMN_UE, "SMN Uncorrectable Error", "ECC_SMN_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_SEM_CE, "SEM Correctable Error", "ECC_SEM_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_SEM_UE, "SEM Uncorrectable Error", "ECC_SEM_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_MP0_CE, "MP0 Correctable Error", "ECC_MP0_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_MP0_UE, "MP0 Uncorrectable Error", "ECC_MP0_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_MP1_CE, "MP1 Correctable Error", "ECC_MP1_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_MP1_UE, "MP1 Uncorrectable Error", "ECC_MP1_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_FUSE_CE, "FUSE Correctable Error", "ECC_FUSE_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_FUSE_UE, "FUSE Uncorrectable Error", "ECC_FUSE_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_UMC_CE, "UMC Correctable Error", "ECC_UMC_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_UMC_UE, "UMC Uncorrectable Error", "ECC_UMC_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_MCA_CE, "MCA Correctable Error", "ECC_MCA_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_MCA_UE, "MCA Uncorrectable Error", "ECC_MCA_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_VCN_CE, "VCN Correctable Error", "ECC_VCN_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_VCN_UE, "VCN Uncorrectable Error", "ECC_VCN_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_JPEG_CE, "JPEG Correctable Error", "ECC_JPEG_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_JPEG_UE, "JPEG Uncorrectable Error", "ECC_JPEG_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_IH_CE, "IH Correctable Error", "ECC_IH_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_IH_UE, "IH Uncorrectable Error", "ECC_IH_UE", true) +FLD_DESC_ENT(RDC_FI_ECC_MPIO_CE, "MPIO Correctable Error", "ECC_MPIO_CE", true) +FLD_DESC_ENT(RDC_FI_ECC_MPIO_UE, "MPIO Uncorrectable Error", "ECC_MPIO_UE", true) + +// XGMI +FLD_DESC_ENT(RDC_FI_XGMI_0_READ_KB, "XGMI0 accumulated data read size (KB)", "XGMI_0_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_1_READ_KB, "XGMI1 accumulated data read size (KB)", "XGMI_1_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_2_READ_KB, "XGMI2 accumulated data read size (KB)", "XGMI_2_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_3_READ_KB, "XGMI3 accumulated data read size (KB)", "XGMI_3_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_4_READ_KB, "XGMI4 accumulated data read size (KB)", "XGMI_4_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_5_READ_KB, "XGMI5 accumulated data read size (KB)", "XGMI_5_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_6_READ_KB, "XGMI6 accumulated data read size (KB)", "XGMI_6_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_7_READ_KB, "XGMI7 accumulated data read size (KB)", "XGMI_7_READ", true) + +FLD_DESC_ENT(RDC_FI_XGMI_0_WRITE_KB, "XGMI0 accumulated data write size (KB)", "XGMI_0_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_1_WRITE_KB, "XGMI1 accumulated data write size (KB)", "XGMI_1_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_2_WRITE_KB, "XGMI2 accumulated data write size (KB)", "XGMI_2_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_3_WRITE_KB, "XGMI3 accumulated data write size (KB)", "XGMI_3_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_4_WRITE_KB, "XGMI4 accumulated data write size (KB)", "XGMI_4_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_5_WRITE_KB, "XGMI5 accumulated data write size (KB)", "XGMI_5_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_6_WRITE_KB, "XGMI6 accumulated data write size (KB)", "XGMI_6_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_7_WRITE_KB, "XGMI7 accumulated data write size (KB)", "XGMI_7_WRITE", true) +FLD_DESC_ENT(RDC_FI_XGMI_TOTAL_READ_KB, "XGMI accumlated data read size across all lanes (KB)", "XGMI_TOTAL_READ", true) +FLD_DESC_ENT(RDC_FI_XGMI_TOTAL_WRITE_KB, "XGMI accumlated data write size across all lanes (KB)", "XGMI_TOTAL_WRITE", true) + + +// ROCProfiler fields +// This doesn't map to rocprofiler counters directly +// See counter_map in rdc/include/rdc_libs/rdc_modules/rdc_rocp/RdcRocpBase.h +// See metrics.xml in rocprofiler +FLD_DESC_ENT(RDC_FI_PROF_OCCUPANCY_PERCENT, "Percent of GPU occupancy", "OCCUPANCY_PERCENT", true) +FLD_DESC_ENT(RDC_FI_PROF_ACTIVE_CYCLES, "Number of Active Cycles", "ACTIVE_CYCLES", true) +FLD_DESC_ENT(RDC_FI_PROF_ACTIVE_WAVES, "Number of Active Waves", "ACTIVE_WAVES", true) +FLD_DESC_ENT(RDC_FI_PROF_ELAPSED_CYCLES, "Number of Elapsed Cycles over all SMs", "ELAPSED_CYCLES", true) +FLD_DESC_ENT(RDC_FI_PROF_TENSOR_ACTIVE_PERCENT, "Percent of Active Pipe Tensors", "TENSOR_PERCENT", true) +FLD_DESC_ENT(RDC_FI_PROF_GPU_UTIL_PERCENT, "Percent of GPU Utilization", "GPU_UTIL_PERCENT", true) +// metrics with EVAL are divided by time passed +FLD_DESC_ENT(RDC_FI_PROF_EVAL_MEM_R_BW, "Fetched from video memory kb / ms", "MEM_R_BW", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_MEM_W_BW, "Written to video memory kb / ms", "MEM_W_BW", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_16, "Number of fp16 OPS / ms", "FLOPS_16", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_32, "Number of fp32 OPS / ms", "FLOPS_32", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_64, "Number of fp64 OPS / ms", "FLOPS_64", true) +FLD_DESC_ENT(RDC_FI_PROF_VALU_PIPE_ISSUE_UTIL, "Percent of Active Pipe VALU", "VALU_UTILIZATION", true) +FLD_DESC_ENT(RDC_FI_PROF_SM_ACTIVE, "Ratio of Cycles with active warp on SM","VALUBusy", true) +FLD_DESC_ENT(RDC_FI_PROF_OCC_PER_ACTIVE_CU, "Mean occ per active compute unit", "OCC_CU", true) +FLD_DESC_ENT(RDC_FI_PROF_OCC_ELAPSED, "Mean occ per active cu over elapsed", "OCC_CU_ELAPSED", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_16_PERCENT, "Number of fp16 OPS percent of max", "FLOPS_16_PERCENT", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_32_PERCENT, "Number of fp32 OPS percent of max", "FLOPS_32_PERCENT", true) +FLD_DESC_ENT(RDC_FI_PROF_EVAL_FLOPS_64_PERCENT, "Number of fp64 OPS percent of max", "FLOPS_64_PERCENT", true) +// CPC +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_STAT_BUSY, "", "CPC_CPC_STAT_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_STAT_IDLE, "", "CPC_CPC_STAT_IDLE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_STAT_STALL, "", "CPC_CPC_STAT_STALL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_TCIU_BUSY, "", "CPC_CPC_TCIU_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_TCIU_IDLE, "", "CPC_CPC_TCIU_IDLE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_UTCL2IU_BUSY, "", "CPC_CPC_UTCL2IU_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_UTCL2IU_IDLE, "", "CPC_CPC_UTCL2IU_IDLE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CPC_UTCL2IU_STALL, "", "CPC_CPC_UTCL2IU_STALL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ME1_BUSY_FOR_PACKET_DECODE, "", "CPC_ME1_BUSY_FOR_PACKET_DECODE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ME1_DC0_SPI_BUSY, "", "CPC_ME1_DC0_SPI_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_UTCL1_STALL_ON_TRANSLATION, "", "CPC_UTCL1_STALL_ON_TRANSLATION", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ALWAYS_COUNT, "", "CPC_ALWAYS_COUNT", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ADC_VALID_CHUNK_NOT_AVAIL, "", "CPC_ADC_VALID_CHUNK_NOT_AVAIL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ADC_DISPATCH_ALLOC_DONE, "", "CPC_ADC_DISPATCH_ALLOC_DONE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_ADC_VALID_CHUNK_END, "", "CPC_ADC_VALID_CHUNK_END", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_SYNC_FIFO_FULL_LEVEL, "", "CPC_SYNC_FIFO_FULL_LEVEL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_SYNC_FIFO_FULL, "", "CPC_SYNC_FIFO_FULL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_GD_BUSY, "", "CPC_GD_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_TG_SEND, "", "CPC_TG_SEND", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_WALK_NEXT_CHUNK, "", "CPC_WALK_NEXT_CHUNK", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_STALLED_BY_SE0_SPI, "", "CPC_STALLED_BY_SE0_SPI", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_STALLED_BY_SE1_SPI, "", "CPC_STALLED_BY_SE1_SPI", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_STALLED_BY_SE2_SPI, "", "CPC_STALLED_BY_SE2_SPI", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_STALLED_BY_SE3_SPI, "", "CPC_STALLED_BY_SE3_SPI", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_LTE_ALL, "", "CPC_LTE_ALL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_SYNC_WRREQ_FIFO_BUSY, "", "CPC_SYNC_WRREQ_FIFO_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CANE_BUSY, "", "CPC_CANE_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPC_CANE_STALL, "", "CPC_CANE_STALL", false) +// CPF +FLD_DESC_ENT(RDC_FI_PROF_CPF_CMP_UTCL1_STALL_ON_TRANSLATION, "", "CPF_CMP_UTCL1_STALL_ON_TRANSLATION", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_STAT_BUSY, "", "CPF_CPF_STAT_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_STAT_IDLE, "", "CPF_CPF_STAT_IDLE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_STAT_STALL, "", "CPF_CPF_STAT_STALL", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_TCIU_BUSY, "", "CPF_CPF_TCIU_BUSY", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_TCIU_IDLE, "", "CPF_CPF_TCIU_IDLE", false) +FLD_DESC_ENT(RDC_FI_PROF_CPF_CPF_TCIU_STALL, "", "CPF_CPF_TCIU_STALL", false) +// Misc +FLD_DESC_ENT(RDC_FI_PROF_SIMD_UTILIZATION, "Fraction of time the SIMDs are being utilized", "SIMD_UTILIZATION", false) +FLD_DESC_ENT(RDC_FI_PROF_UUID, "UUID from rocprofiler", "PROF_UUID", true) +FLD_DESC_ENT(RDC_FI_PROF_KFD_ID, "GPU_ID from rocprofiler, same as KFD_ID", "PROF_KFD_ID", true) + +// Events +FLD_DESC_ENT(RDC_EVNT_XGMI_0_NOP_TX, "NOPs sent to neighbor 0", "XGMI_NOP_0", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_0_REQ_TX, "Outgoing requests to neighbor 0", "XGMI_REQ_0", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_0_RESP_TX, "Outgoing responses to neighbor 0", "XGMI_RES_0", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_0_BEATS_TX, "Data sent to neighbor 0 (32 byte pkts)", "XGMI_BTS_0", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_1_NOP_TX, "NOPs sent to neighbor 1", "XGMI_NOP_1", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_1_REQ_TX, "Outgoing requests to neighbor 1", "XGMI_REQ_1", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_1_RESP_TX, "Outgoing responses to neighbor 1", "XGMI_RES_1", false) +FLD_DESC_ENT(RDC_EVNT_XGMI_1_BEATS_TX, "Data sent to neighbor 1 (32 byte pkts)", "XGMI_BTS_1", false) + +FLD_DESC_ENT(RDC_EVNT_XGMI_0_THRPUT, "Tx throughput to XGMI neighbor 0 in b/s", "XGMI_0_T", true) +FLD_DESC_ENT(RDC_EVNT_XGMI_1_THRPUT, "Tx throughput to XGMI neighbor 1 in b/s", "XGMI_1_T", true) +FLD_DESC_ENT(RDC_EVNT_XGMI_2_THRPUT, "Tx throughput to XGMI neighbor 2 in b/s", "XGMI_2_T", true) +FLD_DESC_ENT(RDC_EVNT_XGMI_3_THRPUT, "Tx throughput to XGMI neighbor 3 in b/s", "XGMI_3_T", true) +FLD_DESC_ENT(RDC_EVNT_XGMI_4_THRPUT, "Tx throughput to XGMI neighbor 4 in b/s", "XGMI_4_T", true) +FLD_DESC_ENT(RDC_EVNT_XGMI_5_THRPUT, "Tx throughput to XGMI neighbor 5 in b/s", "XGMI_5_T", true) + +// Asynchronous event notifications +FLD_DESC_ENT(RDC_EVNT_NOTIF_VMFAULT, "VM page fault", "VM_PAGE_FAULT", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_THERMAL_THROTTLE, "Clk freq decrease due to temp", "THERMAL_THROT", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_PRE_RESET, "GPU reset is about to occur", "GPU_PRE_RESET", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_POST_RESET, "GPU reset just occurred", "GPU_POST_RESET", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_MIGRATE_START, "GPU migrate has started", "MIGRATE_START", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_MIGRATE_END, "GPU migrate has ended", "MIGRATE_END", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_PAGE_FAULT_START, "GPU page fault started", "PAGE_FAULT_START", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_PAGE_FAULT_END, "GPU page fault ended", "PAGE_FAULT_END", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_QUEUE_EVICTION, "GPU queue eviction occured", "QUEUE_EVICITION", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_QUEUE_RESTORE, "GPU queue restore occured", "QUEUE_RESTORE", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_UNMAP_FROM_GPU, "GPU unmap occured", "UNMAP_FROM_GPU", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_PROCESS_START, "GPU process started", "PROCESS_START", false) +FLD_DESC_ENT(RDC_EVNT_NOTIF_PROCESS_END, "GPU process ended", "PROCESS_END", false) + +// RDC health related fields +FLD_DESC_ENT(RDC_HEALTH_XGMI_ERROR, "XGMI one or more errors detected", "XGMI_ERROR", true) +FLD_DESC_ENT(RDC_HEALTH_PCIE_REPLAY_COUNT, "Total PCIE replay count", "PCIE_REPLAY_COUNT", true) +FLD_DESC_ENT(RDC_HEALTH_RETIRED_PAGE_NUM, "Retired page number", "RETIRED_PAGE_NUM", true) +FLD_DESC_ENT(RDC_HEALTH_PENDING_PAGE_NUM, "Pending page number", "PENDING_PAGE_NUM", true) +FLD_DESC_ENT(RDC_HEALTH_RETIRED_PAGE_LIMIT, "Retired page limit", "RETIRED_PAGE_LIMIT", true) +FLD_DESC_ENT(RDC_HEALTH_EEPROM_CONFIG_VALID, "Verify checksum of EEPROM", "EEPROM_CONFIG_VALID", true) +FLD_DESC_ENT(RDC_HEALTH_POWER_THROTTLE_TIME, "Power throttle status counter", "POWER_THROTTLE_TIME", true) +FLD_DESC_ENT(RDC_HEALTH_THERMAL_THROTTLE_TIME, "Total time(ms) in thermal throttle status", "THERMAL_THROTTLE_TIME", true) diff --git a/projects/rdc/common/rdc_fields_supported.cc b/projects/rdc/common/rdc_fields_supported.cc new file mode 100644 index 0000000000..243dab2559 --- /dev/null +++ b/projects/rdc/common/rdc_fields_supported.cc @@ -0,0 +1,66 @@ +/* +Copyright (c) 2020 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +#include "common/rdc_fields_supported.h" + +#include + +#include + +#include "rdc/rdc.h" +namespace amd { +namespace rdc { + +#define FLD_DESC_ENT(ID, DESC, LABEL, DISPLAY) \ + {static_cast(ID), {#ID, (DESC), (LABEL), (DISPLAY)}}, +static const fld_id2name_map_t field_id_to_descript = { +#include "common/rdc_field.data" +}; +#undef FLD_DESC_ENT + +#define FLD_DESC_ENT(ID, DESC, LABEL, DISPLAY) {#ID, (ID)}, +static fld_name2id_map_t field_name_to_id = { +#include "common/rdc_field.data" // NOLINT +}; +#undef FLD_DESC_ENT + +amd::rdc::fld_id2name_map_t& get_field_id_description_from_id(void) { return field_id_to_descript; } + +bool get_field_id_from_name(const std::string name, rdc_field_t* value) { + assert(value != nullptr); + auto id = field_name_to_id.find(name); + if (id == field_name_to_id.end()) { + return false; + } + + *value = static_cast(id->second); + return true; +} + +bool is_field_valid(rdc_field_t field_id) { + if (field_id == RDC_FI_INVALID) { + return false; + } + return field_id_to_descript.find(static_cast(field_id)) != field_id_to_descript.end(); +} + +} // namespace rdc +} // namespace amd diff --git a/projects/rdc/common/rdc_fields_supported.h b/projects/rdc/common/rdc_fields_supported.h new file mode 100644 index 0000000000..6cc7f8dcd1 --- /dev/null +++ b/projects/rdc/common/rdc_fields_supported.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 2020 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +#ifndef COMMON_RDC_FIELDS_SUPPORTED_H_ +#define COMMON_RDC_FIELDS_SUPPORTED_H_ + +#include +#include +#include + +#include "rdc/rdc.h" + +namespace amd { +namespace rdc { + +typedef struct { + std::string enum_name; + std::string description; + std::string label; + bool do_display; +} field_id_descript; + +typedef const std::map fld_id2name_map_t; +typedef std::unordered_map fld_name2id_map_t; + +bool get_field_id_from_name(const std::string name, rdc_field_t* value); +fld_id2name_map_t& get_field_id_description_from_id(void); // NOLINT +bool is_field_valid(rdc_field_t field_id); + +} // namespace rdc +} // namespace amd + +#endif // COMMON_RDC_FIELDS_SUPPORTED_H_ diff --git a/projects/rdc/common/rdc_utils.cc b/projects/rdc/common/rdc_utils.cc new file mode 100644 index 0000000000..4650731caf --- /dev/null +++ b/projects/rdc/common/rdc_utils.cc @@ -0,0 +1,90 @@ + +/* +Copyright (c) 2019 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +#include "common/rdc_utils.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace amd { +namespace rdc { + +bool FileExists(char const* filename) { + struct stat buf; + return (stat(filename, &buf) == 0); +} + +int ReadFile(std::string path, std::string* retStr, bool chop_newline) { + std::stringstream ss; + int ret = 0; + + assert(retStr != nullptr); + + std::ifstream fs; + fs.open(path); + + if (!fs.is_open()) { + ret = errno; + errno = 0; + return ret; + } + ss << fs.rdbuf(); + fs.close(); + + *retStr = ss.str(); + + if (chop_newline) { + retStr->erase(std::remove(retStr->begin(), retStr->end(), '\n'), retStr->end()); + } + return ret; +} + +int ReadFile(const char* path, std::string* retStr, bool chop_newline) { + assert(path != nullptr); + assert(retStr != nullptr); + + std::string file_path(path); + + return amd::rdc::ReadFile(file_path, retStr, chop_newline); +} + +bool IsNumber(const std::string& s) { + return !s.empty() && std::all_of(s.begin(), s.end(), ::isdigit); +} + +bool IsIP(const std::string& s) { + struct sockaddr_in sa; + int result = inet_pton(AF_INET, s.c_str(), &sa); + // inet_pton returns 1 on success + return result == 1; +} + +} // namespace rdc +} // namespace amd diff --git a/projects/rdc/common/rdc_utils.h b/projects/rdc/common/rdc_utils.h new file mode 100644 index 0000000000..3f14d7f70b --- /dev/null +++ b/projects/rdc/common/rdc_utils.h @@ -0,0 +1,54 @@ + +/* +Copyright (c) 2019 - present Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#ifndef COMMON_RDC_UTILS_H_ +#define COMMON_RDC_UTILS_H_ + +#include + +namespace amd { +namespace rdc { + +#ifdef NDEBUG +#define debug_print(fmt, ...) \ + do { \ + } while (false) +#else +#define debug_print(fmt, ...) \ + do { \ + fprintf(stderr, fmt, ##__VA_ARGS__); \ + } while (false) +#endif + +bool FileExists(char const* filename); + +int ReadFile(std::string path, std::string* retStr, bool chop_newline = false); +int ReadFile(const char* path, std::string* retStr, bool chop_newline = false); + +bool IsNumber(const std::string& s); +bool IsIP(const std::string& s); + +} // namespace rdc +} // namespace amd + +#endif // COMMON_RDC_UTILS_H_ diff --git a/projects/rdc/docs/Conceptual/components.rst b/projects/rdc/docs/Conceptual/components.rst new file mode 100644 index 0000000000..f846189845 --- /dev/null +++ b/projects/rdc/docs/Conceptual/components.rst @@ -0,0 +1,35 @@ +.. meta:: + :description: documentation of the installation, configuration, and use of the ROCm Data Center tool + :keywords: ROCm Data Center tool, RDC, ROCm, API, reference, data type, support + +.. _components: + +*************** +RDC components +*************** + +The components of the RDC tool are illustrated in the following figure. + +.. figure:: ../data/install_components.png + + High-level diagram of RDC components + +RDC (API) library +----------------- + +This library is the central piece, which interacts with different modules and provides all the features described. This shared library provides C API and Python bindings so that third-party tools should be able to use it directly if required. + +RDC daemon (``rdcd``) +--------------------- + +The ``rdcd`` daemon records telemetry information from GPUs. It also provides an interface to RDC command-line tool (``rdci``) running locally or remotely. It relies on the above RDC Library for all the core features. + +RDC command-line tool (``rdci``) +-------------------------------- + +A command-line tool to invoke all the features of the RDC tool. This CLI can be run locally or remotely. + +AMDSMI library +-------------- + +A stateless system management library that provides low-level interfaces to access GPU information \ No newline at end of file diff --git a/projects/rdc/docs/conf.py b/projects/rdc/docs/conf.py new file mode 100644 index 0000000000..a6b948e751 --- /dev/null +++ b/projects/rdc/docs/conf.py @@ -0,0 +1,25 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# for PDF output on Read the Docs +project = "ROCm Data Center tool" +author = "Advanced Micro Devices, Inc." +copyright = "Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved." + +html_theme = "rocm_docs_theme" +html_theme_options = {"flavor": "rocm"} +html_title = f"RDC documentation" +external_toc_path = "./sphinx/_toc.yml" + +external_projects_current_project = "rdc" +extensions = ["rocm_docs", "rocm_docs.doxygen"] + +doxygen_root = "doxygen" +doxysphinx_enabled = True +doxygen_project = { + "name": "ROCm Data Center Tool API reference", + "path": "doxygen/xml", +} diff --git a/projects/rdc/docs/data/api_libs.png b/projects/rdc/docs/data/api_libs.png new file mode 100644 index 0000000000..43e4cf2bba Binary files /dev/null and b/projects/rdc/docs/data/api_libs.png differ diff --git a/projects/rdc/docs/data/features.png b/projects/rdc/docs/data/features.png new file mode 100644 index 0000000000..bbfe47d904 Binary files /dev/null and b/projects/rdc/docs/data/features.png differ diff --git a/projects/rdc/docs/data/features_jobs.png b/projects/rdc/docs/data/features_jobs.png new file mode 100644 index 0000000000..ebe3267332 Binary files /dev/null and b/projects/rdc/docs/data/features_jobs.png differ diff --git a/projects/rdc/docs/data/handbook_openssl.png b/projects/rdc/docs/data/handbook_openssl.png new file mode 100644 index 0000000000..a7b753d0e9 Binary files /dev/null and b/projects/rdc/docs/data/handbook_openssl.png differ diff --git a/projects/rdc/docs/data/install_components.png b/projects/rdc/docs/data/install_components.png new file mode 100644 index 0000000000..440ca9a74a Binary files /dev/null and b/projects/rdc/docs/data/install_components.png differ diff --git a/projects/rdc/docs/data/integration_config1.png b/projects/rdc/docs/data/integration_config1.png new file mode 100644 index 0000000000..af9ed2510f Binary files /dev/null and b/projects/rdc/docs/data/integration_config1.png differ diff --git a/projects/rdc/docs/data/integration_config2.png b/projects/rdc/docs/data/integration_config2.png new file mode 100644 index 0000000000..f12fcd3229 Binary files /dev/null and b/projects/rdc/docs/data/integration_config2.png differ diff --git a/projects/rdc/docs/data/integration_config3.png b/projects/rdc/docs/data/integration_config3.png new file mode 100644 index 0000000000..28d8bced30 Binary files /dev/null and b/projects/rdc/docs/data/integration_config3.png differ diff --git a/projects/rdc/docs/data/integration_config4.png b/projects/rdc/docs/data/integration_config4.png new file mode 100644 index 0000000000..3bf6e8ce43 Binary files /dev/null and b/projects/rdc/docs/data/integration_config4.png differ diff --git a/projects/rdc/docs/data/integration_config5.png b/projects/rdc/docs/data/integration_config5.png new file mode 100644 index 0000000000..cd774f38a5 Binary files /dev/null and b/projects/rdc/docs/data/integration_config5.png differ diff --git a/projects/rdc/docs/data/integration_config6.png b/projects/rdc/docs/data/integration_config6.png new file mode 100644 index 0000000000..5461b067ce Binary files /dev/null and b/projects/rdc/docs/data/integration_config6.png differ diff --git a/projects/rdc/docs/data/integration_gpu_clock.png b/projects/rdc/docs/data/integration_gpu_clock.png new file mode 100644 index 0000000000..c902a5e9c4 Binary files /dev/null and b/projects/rdc/docs/data/integration_gpu_clock.png differ diff --git a/projects/rdc/docs/data/integration_login.png b/projects/rdc/docs/data/integration_login.png new file mode 100644 index 0000000000..377e925572 Binary files /dev/null and b/projects/rdc/docs/data/integration_login.png differ diff --git a/projects/rdc/docs/doxygen/.gitignore b/projects/rdc/docs/doxygen/.gitignore new file mode 100644 index 0000000000..431b205665 --- /dev/null +++ b/projects/rdc/docs/doxygen/.gitignore @@ -0,0 +1,2 @@ +html/ +xml/ diff --git a/projects/rdc/docs/doxygen/Doxyfile b/projects/rdc/docs/doxygen/Doxyfile new file mode 100644 index 0000000000..eaccd45536 --- /dev/null +++ b/projects/rdc/docs/doxygen/Doxyfile @@ -0,0 +1,2526 @@ +# Doxyfile 1.9.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = ROCm Data Center Tool + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = ROCm Data Center Tool Reference Manual + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = NO + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = "rst=\verbatim embed:rst:leading-asterisk" \ + "endrst=\endverbatim" + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the reference definitions. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. This requires the bibtex +# tool to be installed. For LaTeX the style of the bibliography can be +# controlled using LATEX_BIB_STYLE. To use this feature you need bibtex and +# perl available in the search path. See also \cite for info how to create +# references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../../include/rdc/rdc.h + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = ../_doxygen/header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = ../_doxygen/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = ../_doxygen/stylesheet.css + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = ../_doxygen/extra_stylesheet.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel For instance the +# value 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, +# 300 purple, and 360 is red again. Minimum value: 0, maximum value: 359, +# default value: 220. This tag requires that the tag GENERATE_HTML is set to +# YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see https://docs.mathjax.org/en/v2.7-latest/tex.html +# #tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /