docs: Remove redundant/stale docs

bump rocm-docs-core to 1.8.2

rm unused files

rm stale docs

fix sphinx conf

reorg docs

SWDEV-482203 -- add note to usage guides

update readmes

Change-Id: I9e0111ac8fe2a691ac964b27436ba47747c27904
Signed-off-by: Peter Park <Peter.Park@amd.com>
Этот коммит содержится в:
Peter Park
2024-10-02 14:42:34 -04:00
коммит произвёл Maisam Arif
родитель 6e843436f5
Коммит e196f98dba
26 изменённых файлов: 2871 добавлений и 7034 удалений
+110
Просмотреть файл
@@ -0,0 +1,110 @@
---
myst:
html_meta:
"description lang=en": "How to build AMD SMI from source."
"keywords": "system, management, interface, contribute, contributing, ROCm, develop, testing"
---
# Building AMD SMI
This section describes the prerequisites and steps to build AMD SMI from source.
(build_reqs)=
## Required software
To build the AMD SMI library, the following components are required. Note that
the software versions specified were used during development; earlier
versions are not guaranteed to work.
* CMake (v3.14.0 or later) -- `python3 -m pip install cmake`
* g++ (v5.4.0 or later)
In order to build the AMD SMI Python package, the following components are
required:
* Python (3.6.8 or later)
* prerequisite modules:
* python3-wheel
* python3-setuptools
* virtualenv -- `python3 -m pip install virtualenv`
## Build steps
1. Clone the AMD SMI repository to your local Linux machine.
```shell
git clone https://github.com/ROCm/amdsmi.git
```
2. The default installation location for the library and headers is `/opt/rocm`.
Before installation, any old ROCm directories should be deleted:
* `/opt/rocm`
* `/opt/rocm-<version_number>`
3. Build the library by following the typical CMake build sequence (run as root
user or use `sudo` before `make install` command); for instance:
```bash
mkdir -p build
cd build
cmake ..
make -j $(nproc)
make install
```
The built library is located in the `build/` directory. To build the `rpm`
and `deb` packages use the following command:
```bash
make package
```
(rebuild_py_wrapper)=
## Rebuild the Python wrapper
The Python wrapper for the AMD SMI library is found in the [auto-generated
file](#py_lib_fs) `py-interface/amdsmi_wrapper.py`. It is essential to
regenerate this wrapper whenever there are changes to the C++ API. It is not
regenerated automatically.
To regenerate the wrapper, use the following command.
```shell
./update_wrapper.sh
```
After this command, the file in `py-interface/amdsmi_wrapper.py` will be updated
on compile.
```{note}
You need Docker installed on your system to regenerate the Python wrapper.
```
(build_tests)=
## Build the tests
To verify the build and capabilities of AMD SMI on your system, as well as to
see practical examples of its usage, you can build and run the available [tests
in the repository](https://github.com/ROCm/amdsmi/tree/amd-staging/tests).
Follow these steps to build the tests:
```bash
mkdir -p build
cd build
cmake -DBUILD_TESTS=ON ..
make -j $(nproc)
```
(run_tests)=
### Run the tests
Once the tests are [built](#build_tests), you can run them by executing the
`amdsmitst` program. The executable can be found at `build/tests/amd_smi_test/`.
(build_docs)=
## Build the docs
To build the documentation, follow the instructions at [Building
documentation](https://rocm.docs.amd.com/en/latest/contribute/building.html).
+144
Просмотреть файл
@@ -0,0 +1,144 @@
---
myst:
html_meta:
"description lang=en": "How to install AMD SMI libraries and CLI tool."
"keywords": "system, management, interface, cpu, gpu, hsmp, versions"
---
# AMD SMI library and CLI tool
This section describes how to install the AMD SMI library, Python interface,
and command line tool either as part of the
{doc}`ROCm software stack <rocm:what-is-rocm>` -- or manually.
(install_reqs)=
## Requirements
The following are required to install and use the AMD SMI libraries and CLI
tool.
* Python 3.6.8+ (64-bit)
* `amdgpu` driver must be loaded for [`amdsmi_init()`](#cpp_hello_amdsmi) to
work.
### Supported platforms
At initial release, the AMD SMI library will support Linux bare metal and Linux
virtual machine guest for AMD GPUs. In a future release, the library will be
extended to support AMD EPYC™ CPUs.
AMD SMI library can run on AMD ROCm supported platforms, refer to
{doc}`System requirements (Linux) <rocm-install-on-linux:reference/system-requirements>`
for more information.
<!--https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html-->
To run the AMD SMI library, the `amdgpu` driver and the `amd_hsmp` driver need
to be installed. Optionally, `libdrm` can be installed to query firmware
information and hardware IPs.
(install_amdgpu_rocm)=
## Install amdgpu driver and AMD SMI with ROCm
<!--https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/amdgpu-install.html-->
1. Get the `amdgpu-install` installer following the instructions for your
Linux distribution at {doc}`rocm-install-on-linux:install/amdgpu-install`.
See the following example; your desired ROCm release and install URL may be
different.
```shell
sudo apt update
wget https://repo.radeon.com/amdgpu-install/6.2.2/ubuntu/noble/amdgpu-install_6.2.60202-1_all.deb
sudo apt install ./amdgpu-install_6.2.60202-1_all.deb
```
2. Use `amdgpu-install` to install the `amdgpu` driver and ROCm packages with
AMD SMI included.
``` shell
sudo amdgpu-install --usecase=rocm
```
The `amdgpu-install --usecase=rocm` option triggers both an `amdgpu` driver
update and AMD SMI packages to be installed on your device.
3. Verify your installation.
```shell
amd-smi --help
```
(install_without_rocm)=
## Install AMD SMI without ROCm
The following are example steps to install the AMD SMI libraries and CLI tool on
Ubuntu 22.04.
1. Install the library.
```shell
sudo apt install amd-smi-lib
```
2. Add the installation directory to your PATH. If installed with ROCm, ignore
this step.
```shell
export PATH="${PATH:+${PATH}:}~/opt/rocm/bin"
```
3. Verify your installation.
```shell
amd-smi --help
```
## Optionally enable CLI autocompletion
The `amd-smi` CLI application supports autocompletion. If `argcomplete` is not
installed and enabled already, do so using the following commands.
```shell
python3 -m pip install argcomplete
activate-global-python-argcomplete --user
# restart shell to enable
```
(install-manual-py-lib)=
## Install the Python library for multiple ROCm instances
If {doc}`multiple ROCm versions are installed
<rocm-install-on-linux:install/native-install/multi-version-install>` and you
are not using `pyenv`, uninstall previous versions of AMD SMI before installing
the desired version from your ROCm instance.
### Manually install the Python library
The following are example AMD SMI installation steps on Ubuntu 22.04 without
ROCm.
1. Remove previous AMD SMI installation.
```shell
python3 -m pip list | grep amd
python3 -m pip uninstall amdsmi
```
2. Install the AMD SMI Python library from your target ROCm instance.
```shell
apt install amd-smi-lib
cd /opt/rocm/share/amd_smi
python3 -m pip install --upgrade pip
python3 -m pip install --user .
```
3. You should now have the AMD SMI Python library in your Python path:
```shell-session
~$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import amdsmi
>>>
```
-147
Просмотреть файл
@@ -1,147 +0,0 @@
.. meta::
:description: Install AMD SMI
:keywords: install, SMI, AMD, ROCm
********************************************************************
Installation
********************************************************************
AMD System Management Interface (AMD SMI) library
-------------------------------------------------
The AMD System Management Interface Library (AMD SMI library) is a C library for Linux that provides a user space interface for applications to monitor and control AMD devices.
.. Note::
This project is a successor to `rocm_smi_lib. <https://github.com/RadeonOpenCompute/rocm_smi_lib>`_
Supported platforms
=====================
In its initial release, the AMD SMI library supports Linux bare metal and Linux virtual machine guest for AMD GPUs. In a future release, the library will extend to support AMD EPYC™ CPUs.
The AMD SMI library can run on AMD ROCm-supported platforms. Refer to `System requirements - Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html>`_ for more information.
To run the AMD SMI library, the `amdgpu` driver and the `hsmp` driver must be installed. Optionally, `libdrm` can be installed to query firmware information and hardware IPs.
CLI tool and libraries installation
------------------------------------
Requirements
=============
* Python 3.6.8+ 64-bit
* amdgpu driver must be loaded for `amdsmi_init()` to pass
Installation steps
-------------------
1. Install amdgpu using ROCm.
2. Install amdgpu driver. See the following example. Note that your release and link may differ. The `amdgpu-install --usecase=rocm` triggers both the amdgpu driver update and AMD 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
sudo amdgpu-install --usecase=rocm
amd-smi --help
3. Install an example for Ubuntu 22.04 (without ROCm).
.. code-block:: bash
apt install amd-smi-lib
# if installed with rocm ignore the export
export PATH="${PATH:+${PATH}:}~/opt/rocm/bin"
amd-smi --help
Optional autocompletion
------------------------
The `amd-smi` cli application supports autocompletion. The package should attempt to install it, if argcomplete is not installed, you can enable it by using the following commands:
.. code:: bash
python3 -m pip install argcomplete
activate-global-python-argcomplete --user
# restart shell to enable
Manual/Multiple ROCm instance Python library install
------------------------------------------------------
In the event there are multiple ROCm installations and `pyenv` is not being used to use the correct amdsmi version, you must uninstall previous versions of AMD SMI and install the latest version you want directly from your ROCm instance.
Python library install example for Ubuntu 22.04
=================================================
1. Remove any existing AMD SMI installation:
.. code-block:: bash
python3 -m pip list | grep amd
python3 -m pip uninstall amdsmi
2. Install Python library from your target ROCm instance:
.. code:: bash
apt install amd-smi-lib
cd /opt/rocm/share/amd_smi
python3 -m pip install --upgrade pip
python3 -m pip install --user
Now you have the AMD SMI Python library in your Python path:
.. code:: bash
~$ python3
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0] on linux
3. Type "help", "copyright", "credits" or "license" for more information
.. code:: bash
import amdsmi
Sphinx documentation
=====================
Run the following commands to build the documentation locally:
.. code-block:: bash
cd docs
python3 -m pip install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
The output is available in `docs/_build/html`.
For additional details, see `Contribute to ROCm documentation <https://rocm.docs.amd.com/en/latest/contribute/contributing.html>`_.