{"id":18711169,"url":"https://github.com/rocm/amdsmi","last_synced_at":"2025-12-14T10:00:01.729Z","repository":{"id":177089013,"uuid":"605790848","full_name":"ROCm/amdsmi","owner":"ROCm","description":"AMD SMI","archived":false,"fork":false,"pushed_at":"2025-12-11T17:31:13.000Z","size":19822,"stargazers_count":102,"open_issues_count":31,"forks_count":53,"subscribers_count":39,"default_branch":"amd-mainline","last_synced_at":"2025-12-12T02:18:30.660Z","etag":null,"topics":["sysadmin"],"latest_commit_sha":null,"homepage":"https://rocm.docs.amd.com/projects/amdsmi/en/latest","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ROCm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-23T22:52:11.000Z","updated_at":"2025-12-10T14:40:44.000Z","dependencies_parsed_at":"2023-10-24T18:30:44.970Z","dependency_job_id":"dde1feaa-f3bd-4785-b7a6-f761908ccd24","html_url":"https://github.com/ROCm/amdsmi","commit_stats":null,"previous_names":["radeonopencompute/amdsmi","rocm/amdsmi"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/ROCm/amdsmi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2Famdsmi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2Famdsmi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2Famdsmi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2Famdsmi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ROCm","download_url":"https://codeload.github.com/ROCm/amdsmi/tar.gz/refs/heads/amd-mainline","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2Famdsmi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27725882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sysadmin"],"created_at":"2024-11-07T12:37:32.789Z","updated_at":"2025-12-14T10:00:01.716Z","avatar_url":"https://github.com/ROCm.png","language":"C++","readme":"# AMD System Management Interface (AMD SMI) library\n\nThe AMD System Management Interface (AMD SMI) library offers a unified tool for managing and monitoring GPUs,\nparticularly in high-performance computing environments. It provides a user-space interface that allows applications to\ncontrol GPU operations, monitor performance, and retrieve information about the system's drivers and GPUs.\n\nFor information on available features, installation steps, API reference material, and helpful tips, refer to the online\ndocumentation at [rocm.docs.amd.com/projects/amdsmi](https://rocm.docs.amd.com/projects/amdsmi/en/latest/)\n\n\u003e[!NOTE]\n\u003eThis project is a successor to [rocm_smi_lib](https://github.com/ROCm/rocm_smi_lib)\n\u003eand [esmi_ib_library](https://github.com/amd/esmi_ib_library).  \n\u003eThis project is applicable to Linux Baremetal and Linux VM(Guest). To use AMD SMI for Virtualization, please refer to [AMD-SMI Virtualization](https://github.com/amd/MxGPU-Virtualization/tree/mainline/smi-lib).\n\n## Supported platforms\n\nThe AMD SMI library supports Linux bare metal and Linux virtual machine guest\nfor AMD GPUs and AMD EPYC™ CPUs via\n[esmi_ib_library](https://github.com/amd/esmi_ib_library).\n\nAMD SMI library can run on AMD ROCm supported platforms, refer to\n[System requirements (Linux)](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html)\nfor more information.\n\n## Installation\n\n* [Install the AMD SMI library and CLI tool](https://rocm.docs.amd.com/projects/amdsmi/en/latest/install/install.html)\n\n## Requirements\n\nThe following are required to install and use the AMD SMI library through its language interfaces and CLI.\n\n* `amdgpu` driver must be loaded for [`amdsmi_init()`](./docs/how-to/amdsmi-cpp-lib#hello-amd-smi) to work. Refer to the [Instinct documentation](https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/install/detailed-install/prerequisites.html) for installation instructions.\n* Export `LD_LIBRARY_PATH` to the `amdsmi` installation directory.\n\n  ```bash\n  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm/lib64\n  ```\n\n### Python interface and CLI tool prerequisites\n\n* Python 3.6.8+ (64-bit)\n\n### Note: No module named more_itertools warning on Azure Linux 3\nDuring the driver installation process on Azure Linux 3, you might encounter the `ModuleNotFoundError: No module named 'more_itertools'` warning. This warning is a result of the reintroduction of `python3-wheel` and `python3-setuptools` dependencies in the CMake of AMD SMI, which requires `more_itertools` to build these Python libraries. This issue will be fixed in a future ROCm release. As a workaround, use the following command before installation:\n```\nsudo python3 -m pip install more_itertools \n```\n\n### Go API prerequisites\n\n* Go version 1.20 or greater\n\n## AMD SMI basic usage\n\n### C++ library\n\nFor developers focused on performance monitoring, system diagnostics, or resource management, the AMD SMI C++ library\noffers a powerful and versatile tool to unlock the full capabilities of AMD hardware.\n\nRefer to the [user guide](https://rocm.docs.amd.com/projects/amdsmi/en/latest/how-to/amdsmi-cpp-lib.html) and the\ndetailed [C++ API reference](https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-cpp-api.html) in the\nROCm documentation portal.\n\n### Python library\n\nThe AMD SMI Python interface provides an easy-to-use\n[API](https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-py-lib.html) for interacting with AMD\nhardware. It simplifies tasks like monitoring and controlling GPU operations, allowing for rapid development.\n\nRefer to the [user guide](https://rocm.docs.amd.com/projects/amdsmi/en/latest/how-to/amdsmi-py-lib.html) and the\ndetailed [Python API reference](https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-py-api.html) in the\nROCm documentation portal.\n\n### Go library\n\nThe AMD SMI Go interface provides a simple\n[API](https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-go-lib.html)\nfor AMD hardware management. It streamlines hardware monitoring and control\nwhile leveraging Golang's features.\n\nRefer to the [user guide](https://rocm.docs.amd.com/projects/amdsmi/en/latest/how-to/amdsmi-go-lib.html) and the\n[Go API reference](https://rocm.docs.amd.com/projects/amdsmi/en/latest/reference/amdsmi-go-api.html) in the\nROCm documentation portal.\n\n### CLI tool\n\nA versatile command line tool for managing and monitoring AMD hardware. You can use `amd-smi` for:\n\n- Device information: Quickly retrieve detailed information about AMD GPUs\n\n- Performance monitoring: Real-time monitoring of GPU utilization, memory, temperature, and power consumption\n\n- Process information: Identify which processes are using GPUs\n\n- Configuration management: Adjust GPU settings like clock speeds and power limits\n\n- Error reporting: Monitor and report GPU errors for proactive maintenance\n\nCheck out\n[Getting to Know Your GPU: A Deep Dive into AMD SMI -- ROCm Blogs](https://rocm.blogs.amd.com/software-tools-optimization/amd-smi-overview/README.html)\nfor a rundown.\n\n### Docker container configuration\n\nTo ensure proper functionality of AMD SMI within a Docker container, the\nfollowing configuration options must be included. These settings are\nparticularly important for managing memory partitions, as partitioning depends\non loading and unloading kernel drivers.\n\n- `--cap-add=SYS_MODULE`\n\n- `-v /lib/modules:/lib/modules`\n\nSee [Using AMD SMI in a Docker\ncontainer](https://rocm.docs.amd.com/projects/amdsmi/en/latest/how-to/setup-docker-container.html)\nfor more information.\n\n## Building AMD SMI\n\nThis section describes the prerequisites and steps to build AMD SMI from source.\n\n### Required software\n\nTo build the AMD SMI library, the following components are required. Note that the software versions specified were used\nduring development; earlier versions are not guaranteed to work.\n\n* CMake (v3.20.0 or later) -- `python3 -m pip install cmake`\n* g++ (v5.4.0 or later)\n* libdrm-dev (for Ubuntu and Debian)\n* libdrm-devel (for RPM-based distributions)\n\nIn order to build the AMD SMI Python package, the following components are required:\n\n* Python (3.6.8 or later)\n* virtualenv -- `python3 -m pip install virtualenv`\n\n### Build steps\n\n1. Clone the AMD SMI repository to your local Linux machine.\n\n   ```shell\n   git clone https://github.com/ROCm/amdsmi.git\n   ```\n\n2. The default installation location for the library and headers is `/opt/rocm`. Before installation, any old ROCm\n   directories should be deleted:\n\n   * `/opt/rocm`\n   * `/opt/rocm-\u003cversion_number\u003e`\n\n3. Build the library by following the typical CMake build sequence (run as root user or use `sudo` before `make install`\n   command); for instance:\n\n   ```bash\n   mkdir -p build\n   cd build\n   cmake ..\n   make -j $(nproc)\n   make install\n   ```\n\n   The built library is located in the  `build/` directory. To build the `rpm` and `deb` packages use the following\n   command:\n\n   ```bash\n   make package\n   ```\n\n### Rebuild the Python wrapper\n\nThe Python wrapper for the AMD SMI library is found in the [auto-generated file](#py_lib_fs)\n`py-interface/amdsmi_wrapper.py`. It is essential to regenerate this wrapper whenever there are changes to the C++ API.\nIt is not regenerated automatically.\n\nTo regenerate the wrapper, use the following command.\n\n```shell\n./update_wrapper.sh\n```\n\nAfter this command, the file in `py-interface/amdsmi_wrapper.py` will be updated\non compile.\n\n\u003e[!NOTE]\n\u003eYou need Docker installed on your system to regenerate the Python wrapper.\n\n### Build the tests\n\nTo verify the build and capabilities of AMD SMI on your system, as well as to see practical examples of its usage, you\ncan build and run the available [tests in the repository](https://github.com/ROCm/amdsmi/tree/amd-staging/tests). Follow\nthese steps to build the tests:\n\n```bash\nmkdir -p build\ncd build\ncmake -DBUILD_TESTS=ON ..\nmake -j $(nproc)\n```\n\n#### Run the tests\n\nOnce the tests are [built](#build-the-tests), you can run them by executing the `amdsmitst` program. The executable can\nbe found at `build/tests/amd_smi_test/`.\n\n### Build the docs\n\nTo build the documentation, follow the instructions at\n[Building documentation](https://rocm.docs.amd.com/en/latest/contribute/building.html).\n\n## DISCLAIMER\n\nThe information contained herein is for informational purposes only, and is subject to change without notice. In\naddition, any stated support is planned and is also subject to change. While every precaution has been taken in the\npreparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is\nunder no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no\nrepresentations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes\nno liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular\npurposes, with respect to the operation or use of AMD hardware, software or other products described herein.\n\n© 2023-2025 Advanced Micro Devices, Inc. All Rights Reserved.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocm%2Famdsmi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocm%2Famdsmi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocm%2Famdsmi/lists"}