From 0c358ecffe7a39af7bff1489b0a86a52dd915bae Mon Sep 17 00:00:00 2001 From: "Johar, Adel" Date: Wed, 29 Jan 2025 15:06:09 +0100 Subject: [PATCH] Docs: Fix broken links, warnings and use automodule (#11) - Fixes the broken links in rocm_smi.h - Uses automodule instead of autofunction in docs/reference/python_api.rst - Fixes some warnings during docs build - Update some of the versions in requirements.txt [ROCm/rocm_smi_lib commit: e5c5a1d5b7cba41ab801a987fb6c466503411804] --- projects/rocm-smi-lib/docs/conf.py | 12 +- .../rocm-smi-lib/docs/install/install.rst | 16 +- .../rocm-smi-lib/docs/reference/index.rst | 2 + .../docs/reference/python_api.rst | 264 +----------------- .../rocm-smi-lib/docs/sphinx/requirements.in | 2 +- .../rocm-smi-lib/docs/sphinx/requirements.txt | 24 +- projects/rocm-smi-lib/docs/tutorials/test.rst | 2 +- .../rocm-smi-lib/include/rocm_smi/rocm_smi.h | 28 +- 8 files changed, 52 insertions(+), 298 deletions(-) diff --git a/projects/rocm-smi-lib/docs/conf.py b/projects/rocm-smi-lib/docs/conf.py index b0a99742a0..cfd8d872ec 100755 --- a/projects/rocm-smi-lib/docs/conf.py +++ b/projects/rocm-smi-lib/docs/conf.py @@ -35,6 +35,8 @@ release = version_number external_toc_path = "./sphinx/_toc.yml" +exclude_patterns = ['CHANGELOG.md'] + docs_core = ROCmDocs(left_nav_title) docs_core.run_doxygen(doxygen_root="doxygen", doxygen_path="doxygen/xml") docs_core.enable_api_reference() @@ -47,4 +49,12 @@ suppress_warnings = ["etoc.toctree"] for sphinx_var in ROCmDocs.SPHINX_VARS: globals()[sphinx_var] = getattr(docs_core, sphinx_var) -extensions += ['sphinx.ext.mathjax'] \ No newline at end of file +extensions += ['sphinx.ext.mathjax'] + +# Necessary to remove the header comments from the rocm_smi module +def remove_module_docstring(app, what, name, obj, options, lines): + if what == "module": + del lines[:] + +def setup(app): + app.connect("autodoc-process-docstring", remove_module_docstring) diff --git a/projects/rocm-smi-lib/docs/install/install.rst b/projects/rocm-smi-lib/docs/install/install.rst index 7dad4514ca..1e57bae48d 100644 --- a/projects/rocm-smi-lib/docs/install/install.rst +++ b/projects/rocm-smi-lib/docs/install/install.rst @@ -7,7 +7,7 @@ Installing ROCm SMI ********************* -Planned deprecation notice +Planned deprecation notice ---------------------------- ROCm System Management Interface (ROCm SMI) Library is planned to be ***deprecated***, and the release date will be announced soon. We recommend migration to AMD SMI. @@ -15,11 +15,11 @@ ROCm System Management Interface (ROCm SMI) Library is planned to be ***deprecat Install amdgpu using ROCm -------------------------- Use the following instructions to install AMDGPU using ROCm: - + 1. Install amdgpu driver. Refer to the following example, your release and link may differ. The `amdgpu-install --usecase=rocm` triggers both an amdgpu driver update and ROCm SMI packages to be installed on your device. - + .. code-block:: shell - + sudo apt update wget https://repo.radeon.com/amdgpu-install/6.0.2/ubuntu/jammy/amdgpu-install_6.0.60002-1_all.deb sudo apt install ./amdgpu-install_6.0.60002-1_all.deb @@ -33,10 +33,8 @@ Building ROCm SMI Addtional required software ============================ -To build the ROCm SMI library, the following components are required. - -.. Note:: - +To build the ROCm SMI library, the following components are required. + The following software versions are what was used in development. Earlier versions are not guaranteed to work: * CMake (v3.5.0) @@ -52,7 +50,7 @@ The source code for ROCm SMI is available on `Github PCIe ID (uint64_t) * -------------- | ------- | ---------------- | ---------------------------- | @@ -1837,15 +1837,15 @@ rsmi_dev_pci_bandwidth_get(uint32_t dv_ind, rsmi_pcie_bandwidth_t *bandwidth); * | Device | [ 7: 3] | "location id" | (LOCATION & 0xF8) | * | Function | [ 2: 0] | "location id" | (LOCATION & 0x7) | * \endcode - * + * * Note: In some devices, the partition ID may be stored in the function bits * BDFID[2:0] instead of BDFID[31:28]. - * - * Note: For MI series devices, the function bits are only used to store the - * partition ID, but this modified BDF is internal to the ROCm stack. - * To the OS, partitions share the same BDF as the unpartitioned device and + * + * Note: For MI series devices, the function bits are only used to store the + * partition ID, but this modified BDF is internal to the ROCm stack. + * To the OS, partitions share the same BDF as the unpartitioned device and * have function bits = 0, which can be verified through lspci. - * + * * @param[in] dv_ind a device index * * @param[inout] bdfid a pointer to uint64_t to which the device bdfid value