diff --git a/projects/amdsmi/README.md b/projects/amdsmi/README.md index 12a12bd63c..c987c36a82 100755 --- a/projects/amdsmi/README.md +++ b/projects/amdsmi/README.md @@ -1,5 +1,3 @@ - - # ROCm System Management Interface (ROCm SMI) Library The ROCm System Management Interface Library, or ROCm SMI library, is part of the Radeon Open Compute [ROCm](https://github.com/RadeonOpenCompute) software stack . It is a C library for Linux that provides a user space interface for applications to monitor and control GPU applications. @@ -12,22 +10,25 @@ The information contained herein is for informational purposes only, and is subj © 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. +## Building ROCm SMI -# Building ROCm SMI +### Additional Required software for building -#### Additional Required software for building In order to build the ROCm SMI library, the following components are required. Note that the software versions listed are what was used in development. Earlier versions are not guaranteed to work: + * CMake (v3.5.0) * g++ (5.4.0) In order to build the latest documentation, the following are required: + * Python 3.8+ * NPM (sass) The source code for ROCm SMI is available on [Github](https://github.com/RadeonOpenCompute/rocm_smi_lib). After the ROCm SMI library git repository has been cloned to a local Linux machine, building the library is achieved by following the typical CMake build sequence. Specifically, -```bash + +```shell mkdir -p build cd build cmake .. @@ -35,26 +36,27 @@ make -j $(nproc) # Install library file and header; default location is /opt/rocm make install ``` + The built library will appear in the `build` folder. To build the rpm and deb packages follow the above steps with: -```bash + +```shell make package ``` #### Documentation + The following is an example of how to build the docs: -```bash -sudo apt install -y npm -sudo npm install -g sass +```shell python3 -m venv .venv - .venv/bin/python3 -m pip install -r docs/.sphinx/requirements.txt .venv/bin/python3 -m sphinx -T -E -b html -d docs/_build/doctrees -D language=en docs docs/_build/html ``` #### Building the Tests + In order to verify the build and capability of ROCm SMI on your system and to see an example of how ROCm SMI can be used, you may build and run the tests that are available in the repo. To build the tests, follow these steps: ```bash @@ -66,11 +68,14 @@ make -j $(nproc) To run the test, execute the program `rsmitst` that is built from the steps above. -# Usage Basics -## Device Indices +## Usage Basics + +### Device Indices + Many of the functions in the library take a "device index". The device index is a number greater than or equal to 0, and less than the number of devices detected, as determined by `rsmi_num_monitor_devices()`. The index is used to distinguish the detected devices from one another. It is important to note that a device may end up with a different index after a reboot, so an index should not be relied upon to be constant over reboots. -# Hello ROCm SMI +## Hello ROCm SMI + The only required ROCm-SMI call for any program that wants to use ROCm-SMI is the `rsmi_init()` call. This call initializes some internal data structures that will be used by subsequent ROCm-SMI calls. When ROCm-SMI is no longer being used, `rsmi_shut_down()` should be called. This provides a way to do any releasing of resources that ROCm-SMI may have held. In many cases, this may have no effect, but may be necessary in future versions of the library. diff --git a/projects/amdsmi/docs/.doxygen/.gitignore b/projects/amdsmi/docs/.doxygen/.gitignore new file mode 100644 index 0000000000..5ebfac1dea --- /dev/null +++ b/projects/amdsmi/docs/.doxygen/.gitignore @@ -0,0 +1 @@ +docBin/ diff --git a/projects/amdsmi/docs/.gitignore b/projects/amdsmi/docs/.gitignore index b8ea6fcbcd..b84233aed8 100644 --- a/projects/amdsmi/docs/.gitignore +++ b/projects/amdsmi/docs/.gitignore @@ -7,3 +7,5 @@ /_templates/ /html/ /latex/ +404.md +data/AMD-404.png diff --git a/projects/amdsmi/docs/.sphinx/_toc.yml b/projects/amdsmi/docs/.sphinx/_toc.yml index 84f11ded40..45624f4efe 100644 --- a/projects/amdsmi/docs/.sphinx/_toc.yml +++ b/projects/amdsmi/docs/.sphinx/_toc.yml @@ -2,5 +2,6 @@ defaults: numbered: False maxdepth: 6 root: index -entries: - - file: html/index \ No newline at end of file +subtrees: + - entries: + - file: .doxygen/docBin/html/index diff --git a/projects/amdsmi/docs/.sphinx/_toc.yml.in b/projects/amdsmi/docs/.sphinx/_toc.yml.in index ac4814ce11..a9a3dd8f89 100755 --- a/projects/amdsmi/docs/.sphinx/_toc.yml.in +++ b/projects/amdsmi/docs/.sphinx/_toc.yml.in @@ -4,5 +4,6 @@ defaults: numbered: False maxdepth: 6 root: index -entries: - - file: html/index \ No newline at end of file +subtrees: + - entries: + - file: .doxygen/docBin/html/index diff --git a/projects/amdsmi/docs/.sphinx/requirements.in b/projects/amdsmi/docs/.sphinx/requirements.in index b98c8ab534..0bcf7dd930 100755 --- a/projects/amdsmi/docs/.sphinx/requirements.in +++ b/projects/amdsmi/docs/.sphinx/requirements.in @@ -1 +1 @@ -rocm-docs-core[api_reference]==0.9.0 +rocm-docs-core[api_reference]==0.24.1 diff --git a/projects/amdsmi/docs/.sphinx/requirements.txt b/projects/amdsmi/docs/.sphinx/requirements.txt index 5257eac6b3..297193c462 100644 --- a/projects/amdsmi/docs/.sphinx/requirements.txt +++ b/projects/amdsmi/docs/.sphinx/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile .sphinx/requirements.in +# pip-compile requirements.in # accessible-pygments==0.0.4 # via pydata-sphinx-theme @@ -41,7 +41,9 @@ docutils==0.16 # myst-parser # pydata-sphinx-theme # sphinx -doxysphinx==3.2.3 +doxysphinx==3.3.4 + # via rocm-docs-core +fastjsonschema==2.18.0 # via rocm-docs-core gitdb==4.0.10 # via gitpython @@ -59,10 +61,8 @@ jinja2==3.1.2 # via # myst-parser # sphinx -json5==0.9.11 +libsass==0.22.0 # via doxysphinx -linkify-it-py==1.0.3 - # via myst-parser lxml==4.9.2 # via doxysphinx markdown-it-py==2.2.0 @@ -75,7 +75,9 @@ mdit-py-plugins==0.3.5 # via myst-parser mdurl==0.1.2 # via markdown-it-py -myst-parser[linkify]==1.0.0 +mpire==2.8.0 + # via doxysphinx +myst-parser==1.0.0 # via rocm-docs-core packaging==23.1 # via @@ -92,8 +94,11 @@ pygithub==1.58.1 pygments==2.15.0 # via # accessible-pygments + # mpire # pydata-sphinx-theme # sphinx +pyjson5==1.6.4 + # via doxysphinx pyjwt[crypto]==2.6.0 # via pygithub pynacl==1.5.0 @@ -105,13 +110,14 @@ pytz==2023.3 pyyaml==6.0 # via # myst-parser + # rocm-docs-core # sphinx-external-toc requests==2.28.2 # via # pygithub # sphinx -rocm-docs-core[api_reference]==0.9.0 - # via -r .sphinx/requirements.in +rocm-docs-core[api_reference]==0.24.1 + # via -r requirements.in smmap==5.0.0 # via gitdb snowballstemmer==2.2.0 @@ -151,10 +157,10 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx +tqdm==4.66.1 + # via mpire typing-extensions==4.5.0 # via pydata-sphinx-theme -uc-micro-py==1.0.1 - # via linkify-it-py urllib3==1.26.15 # via requests wrapt==1.15.0 diff --git a/projects/amdsmi/docs/conf.py b/projects/amdsmi/docs/conf.py index e2d485b9ce..733e8bcc24 100755 --- a/projects/amdsmi/docs/conf.py +++ b/projects/amdsmi/docs/conf.py @@ -13,5 +13,3 @@ docs_core.setup() for sphinx_var in ROCmDocs.SPHINX_VARS: globals()[sphinx_var] = getattr(docs_core, sphinx_var) - -html_theme_options["show_navbar_depth"] = 2