47 Commits

Autor SHA1 Mensaje Fecha
Mario Limonciello 08949cb884 Run pre-commit's whitespace related hooks on projects/amdsmi (#2119)
* Run pre-commit's whitespace related hooks on projects/amdsmi

In order for pre-commit to be useful, everything needs to meet a common
baseline.

* Add whitespace back to Changelog for formatting

---------

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
2025-12-15 13:20:47 -06:00
arvindcheru 0f76bb45c7 Enable Lintian configuration/Files for AMDSMI (#2140)
* Enable Lintian configuration/Files for AMDSMI
2025-12-04 22:01:57 -05:00
Billakanti, Koushik a428180cb8 [SWDEV-434556] Updated warning text when argcomplete fails to install (#778)
* Solved error: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/dist-packages/argcomplete/bash_completion.d/python-argcomplete.sh'

[ROCm/amdsmi commit: 013d6cb511]
2025-10-27 13:05:17 -05:00
Galantsev, Dmitrii 51088382c8 [SWDEV-529762] CMAKE - Fix lintian issues (#325)
Change-Id: Ide3563a876cb530d0e80676e78f36f18a233a3ba

Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>

[ROCm/amdsmi commit: bd82e881f5]
2025-05-06 17:59:47 -05:00
Maisam Arif 597edb6eb8 Removed post install pciids udpate
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: If6a3fcec4778c99246e899890f1d586656841d3e


[ROCm/amdsmi commit: ea1b24003e]
2025-04-29 18:52:32 -05:00
Liu, Shuzhou (Bill) 7a1d836338 [SWDEV-526610] Palamida scan remediation copyright (#279)
Add missing copyrights
Signed-off-by: Joseph Narlo <joseph.narlo@amd.com>

[ROCm/amdsmi commit: d73452b3bf]
2025-04-16 14:54:45 -05:00
Williams, Justin f06d56838c [SWDEV-489695] Fixed lib tests install logic (#103)
Signed-off-by: Justin Williams <Justin.Williams@amd.com>

[ROCm/amdsmi commit: c01e0bd47a]
2025-02-11 15:59:09 -06:00
Charis Poag f01eea6077 [SWDEV-488276/SWDEV-497613] Update memory partition set functionality
Changes:
  - [CLI] Added warning screen to AMD SMI users
    setting memory partition
  - [CLI] Added a progress bar time-bar for CLI sets display to 40 seconds
  - [API] Updated to wait until the driver reloads with SYSFS files active
  - [CLI] Now users can set or reset without providing:
    amd-smi set -g all <set arguments>
    or amd-smi reset -g all <set arguments>
    now can directly call -> sudo amd-smi set <set arguments>
    or sudo amd-smi reset <set arguments>
  - [SWDEV-475712][CLI/API] Fixed target_graphics_version field
    not properly displaying for older MI or Navi ASICs.
  - [All APIs] Added a catch for the driver to report invalid arguments
    now these APIs will show AMDSMI_STATUS_INVAL
    (ex. changing to NPS8 if the device does not support it)
  - [Install] Modified paths for Python install commands to support
    multi-ROCm installs

Change-Id: Id11f25d68a82d23c6b2d77ccb30b51e860dd0ca7
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: 3ea4a42a6e]
2024-11-12 16:50:32 -04:00
Justin Williams fcb033f780 [SWDEV-482058 / SWDEV-482971] Added setup.py install
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: Ibad07d34dfb455043ce307fe036289f1d5c20a9a


[ROCm/amdsmi commit: 2e5b164c43]
2024-10-18 16:59:13 -04:00
Justin Williams 8eee7b2d1e Removed Post Install PyYAML and Pip Upgrades
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I25f0e8087a212fd29d33a8a40303436279789029


[ROCm/amdsmi commit: 807f1e3111]
2024-09-25 18:20:23 -05:00
Maisam Arif 457619bfad [SWDEV-469278] - Lowered PyYAML dependency
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Icfee09b84cf1071ec82b65fc2877be69e0283489


[ROCm/amdsmi commit: 09c9574454]
2024-09-20 18:03:00 -04:00
Dmitrii Galantsev f59f2caf2c Revert "[SWDEV-469278] Lowered PyYAML post install script dependency"
Revert submission 1125402

Reason for revert: Packaging a tar archive of 3rd party sources
Reverted Changes:
I8908451c0:[SWDEV-482058] Updated Packaging for offline insta...
I764c8bf01:[SWDEV-469278] Lowered PyYAML post install script ...

Change-Id: I3886b5370e352fc33a249c4657d7ed0c1ee75baf


[ROCm/amdsmi commit: 6beec5f3ec]
2024-09-20 16:42:29 -04:00
Dmitrii Galantsev 4fbcdc5862 Revert "[SWDEV-482058] Updated Packaging for offline installs"
Revert submission 1125402

Reason for revert: Packaging a tar archive of 3rd party sources
Reverted Changes:
I8908451c0:[SWDEV-482058] Updated Packaging for offline insta...
I764c8bf01:[SWDEV-469278] Lowered PyYAML post install script ...

Change-Id: Ib32fa5b9351b1cfc2a8d453e744c0d00209359eb


[ROCm/amdsmi commit: 9924574cbe]
2024-09-20 16:42:29 -04:00
Maisam Arif f1eae9f051 [SWDEV-482058] Updated Packaging for offline installs
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I8908451c013fc944645b5b5df3104a2ff73e72bd


[ROCm/amdsmi commit: 2cfae06560]
2024-09-20 00:55:48 -04:00
Justin Williams 90c854ad72 [SWDEV-469278] Lowered PyYAML post install script dependency
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I764c8bf01e6cb6acb0b3fc1db396707099e5ed12


[ROCm/amdsmi commit: f2f02aa317]
2024-09-20 00:55:48 -04:00
Juan Castillo 487fd5e1fd [SWDEV-482966/ SWDEV-482967] Removing pytest dependency + install path change
Signed-off-by: Juan Castillo <juan.castillo@amd.com>
Change-Id: I7aace93fcad18d67443e6849c10a1fbbc65d0fa8
Signed-off-by: Juan Castillo <juan.castillo@amd.com>


[ROCm/amdsmi commit: ac593f9fa0]
2024-09-18 00:27:00 -04:00
Charis Poag 31a2921b62 [SWDEV-451960] [WIP] Add Pytest
Updates:
- Added pytest to shared/pytest folder
- User can execute tests:

[pytest]
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -s -v
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -s -v

[unittest]
/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v
/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v

- Automatically installs pytest

Change-Id: Ia3281a9608aeeb803b91f8b83f87ff84b01037f4
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: d9d6637cb7]
2024-08-29 10:09:29 -04:00
Charis Poag 312034409e SWDEV-462728 Add update-pciids to install + remove subsystem name
Added to install to update-pciids if there is network connection.
Removed subsystem name from outputting under model. Added TODO
to add later on.

Change-Id: I028269f2931f61e094116a85a7a1286de548122a
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: c5da93ab90]
2024-05-20 12:03:31 -05:00
Galantsev, Dmitrii 3a2f4286cc SWDEV-449212 - Fix static build
Disable Python interface and CLI tool for static builds (when
-DBUILD_SHARED_LIBS=OFF is passed to cmake)

Change-Id: I32bbd94d70628a50029a748f7493b55c91d45e02
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: eef4169a0f]
2024-03-14 13:31:34 -04:00
Maisam Arif 9bbd32046e SWDEV-449314 - Added pyyaml check before installing via pip
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Ie6d0d664e74b47c1efce6e6fac19ee4a1bf0d5eb


[ROCm/amdsmi commit: 25c8ff6c2a]
2024-03-14 13:31:06 -04:00
Maisam Arif 030a971ce4 SWDEV-437729 - Post install script fixes for pip & pyyaml
Change-Id: If5c4a7947764a0cb5717c906198436304fa62784
Signed-off-by: Maisam Arif <maisarif@amd.com>


[ROCm/amdsmi commit: 498fde5cf4]
2023-12-15 13:34:56 -06:00
Galantsev, Dmitrii b2785f6b7b SWDEV-423944 - Clean-up un/install scripts
Change-Id: Ib16935ca456f889dc8d1280a37693858afa82715
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 4022889701]
2023-11-20 13:09:09 -05:00
Maisam Arif 6e39064453 Fixed python3 lib install for DEB & RPM
Upgraded python3-yaml into a dependency; needed for cli
	Added checks before uninstalling amdsmi system
	Made argcomplete activation only for installing user
	Corrected returns outside of function to exit
	Removed returns if python3 library install fails

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I299dc01e07029b255a3469fd63fdc8ffec943828


[ROCm/amdsmi commit: e0a1a6ca96]
2023-11-09 00:17:44 -06:00
Galantsev, Dmitrii 8535f6993d Don't crash [un]install scripts on python failure
Change-Id: Icfbcc647bda94dd2ff2f65016de5c80af5d1ec79
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 08268ba1c1]
2023-11-02 15:15:27 -04:00
Maisam Arif 0a90c7cfc8 SWDEV-429037 - Automatically install amdsmi python lib with package
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I9c8c1335982ebd61a29da6f66c635f0a97d95f6e


[ROCm/amdsmi commit: c2e12feb6a]
2023-11-02 15:15:27 -04:00
Galantsev, Dmitrii 10207f0a3a Remove old gpuv-smi symlink
Change-Id: I39d9aa96eb8ed2dd6a4a222c3c4da9ff2b2de007
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: db3e119f7d]
2023-09-25 00:52:17 -05:00
Galantsev, Dmitrii 43591c22cf Merge remote-tracking branch 'rocmsmi/amd-staging' into HEAD
Change-Id: I65ed7f3a0d1b6e58bc8377932d7c39db21d1b422


[ROCm/amdsmi commit: 5c41319c83]
2023-09-21 23:43:20 -05:00
Galantsev, Dmitrii fcef65621d PACKAGE - Fix packaging
Allow for configureLogrotate to fail without failing configure

In previous commit I forgot to invert the check when switching
"IS_SYSTEMD" and "!IS_SYSTEMD" if-else statements.

Change-Id: I8eb8e7981c6353a2e60064eb3a6e35821ea2a0d0
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: b99867eb80]
2023-09-20 10:37:35 -05:00
Galantsev, Dmitrii 89667d82a0 PACKAGE - Cleanup packaging
- Clean-up packaging scripts. More consistent with RDC.
- Remove all 'sudo' calls. all these scripts are to be ran by root.
- Reduce scope of variables.
- Remove unnecessary functions

Change-Id: Ib90f8e66ef4eae24f73e940fff44f515e12233f5
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 431a7071a0]
2023-09-20 01:07:51 -04:00
Galantsev, Dmitrii 205e1577de PACKAGE - Remove __pycache__ on uninstall
After running the amd-smi tool, the following directories get created:

- /opt/rocm/libexec/amdsmi_cli/__pycache__
- /opt/rocm/share/amd_smi/amdsmi/__pycache__

Those need to be removed so rocm can be cleanly uninstalled.

Change-Id: I1738aed444ef9427179e99f6e25ad1beab3d8fab
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: daa2c42627]
2023-09-15 03:06:01 -05:00
Galantsev, Dmitrii 413698396a Merge remote-tracking branch 'rocmsmi/amd-staging' into amd-dev
Change-Id: I9c38b4facd472b877d1ad133f3176a023c890955
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 936719eeb6]
2023-08-23 16:04:15 -05:00
Galantsev, Dmitrii 20f853deb9 RPM:DEB: replace rocm_smi with amd_smi where needed
__pycache__ directory wasn't getting removed.
Turns out we missed some rocm-smi renames when merging changes from it.

Culprit: I695bd085d4a43b678b563b4c35f6d2e8ddfa7d7c

Change-Id: Ieb0db41163af0337f1a3c06eb63a6960e6c52ff6
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 7cd72a583d]
2023-08-17 01:37:40 -05:00
Charis Poag 65c425c77f [lib] Enhance Logger: gpu_metrics + enable console out
* Updates:
    - Env variable RSMI_LOGGING=0 or any other value
        -> all logging off
    - Env variable RSMI_LOGGING=1 -> logs only
    - Env variable RSMI_LOGGING=2 -> console only
    - Env variable RSMI_LOGGING=3 -> both logs + console
    - Metrics output includes hexdump of current file
      and decoded metrics (functions: logHexDump
      and log_gpu_metrics)
    - System info gathered, now includes if system's
      perceived endianness - little or big endian
      helpful for viewing decoded hexdump or any
      binary translation
    - Added templates for printing unsigned hex
      (print_unsigned_hex_and_int), unsigned integers
      (print_unsigned_int), and printing both unsigned
      hex and int with an optional header
      (print_unsigned_hex_and_int)
    - Fixed some build compile warnings/errors -
      ex. doing strncpys for sku or board names
      this operation is expected and needed
      and for temp file writes if unsuccessful
      we now properly send RSMI_STATUS_FILE_ERROR
    - Fixed on RHEL 8.8/9.x logrotate does not properly
      initialize

Change-Id: Ifa0f0218c9cafd0a8cd6aa8e7f94d61e9107200f
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: 9c7eed7edc]
2023-08-01 21:46:19 -05:00
Charis Poag 43075e2886 Update logging and README for other project usage
Updates:
    * [rocm-smi] Logging now can update files on
      per-project-basis for install/remove
    * [rocm-smi] README now has latest build
      instructions, including test builds
    * [rocm-smi] Updated README to include
      revision dates

Change-Id: Ifb19a6f32ccf6938f47225db53fef88021909264
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: 4613e8dec3]
2023-07-20 19:09:11 -05:00
Charis Poag 9fbf58a0c9 Merge 'rocm-smi/amd-staging' into 'amd-smi/amd-dev'
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
Change-Id: Id35c9807c45a965c968fb430e3ce4f3c7069c210


[ROCm/amdsmi commit: afa174c655]
2023-07-19 18:46:28 -05:00
Charis Poag 298268a0c5 [SWDEV-402336 + SWDEV-398070] Fix RPM install part2
Updates:
    [rocm-smi] RPM installation comment included a macro,
    now removed

Change-Id: Ifa7a8d2d1a713940c39e20df9d02635e0e623dd8
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: e2dec17284]
2023-06-05 13:50:57 -05:00
Charis Poag 63def40bf2 [SWDEV-402336 + SWDEV-398070] Fix RPM install - override macros
Updates:
    * [rocm-smi] RPM installation now overrides macro usage

Change-Id: I2a5ba14670becc178f672182eabe71965a526178
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: b0f2a9d2ef]
2023-06-01 11:58:42 -04:00
Charis Poag 14b2f93d48 [SWDEV-398070] Adding logging to ROCm SMI (by default off)
Updates:
    * [rocm-smi] Provide a thread-safe logging feature
    * [rocm-smi] Adding logrotation into install/upgrade/remove
      scripts
    * [rocm-smi] Updated cmake lists to include rocm_smi_logger
    * [rocm-smi] Updated DEB/RPM install/remove logging file &
      folder with all users having r/w privledges for
      /var/log/rocm_smi_lib/ROCm-SMI-lib.log
    * [rocm-smi] Added ability to do a glob search for multiple files
      (globFileExists), assists doing file searches with * strings
    * [rocm-smi] Added ability to log system details when RSMI_LOGGING
      is turned on (getSystemDetails())
    * [rocm-smi] Added logging to provide which ROCm API is being called
      when RSMI_LOGGING is on
    * [rocm-smi] Added logging to provide SYSFS path and read value,
      when RSMI_LOGGING is on. Provides error reponse on failure.
    * [rocm-smi] Added logging to provide SYSFS path and read value,
      when RSMI_LOGGING is on. Provides error reponse on failure.
    * [rocm-smi] Added environment variable RSMI_LOGGING to control
      when logging is enabled or disabled. By default, by not
      setting this env. variable, logging is turned off. When
      setting RSMI_LOGGING=<any value>, logging is enabled
      which is placed in /var/log/rocm_smi_lib/ROCm-SMI-lib.log file.
      Setting RSMI_LOGGING is allowed in both debug and release builds.
    * [rocm-smi] Removed an initialize procedure which keeps
      debug_inf_loop. Seems this feature is not being used.

Change-Id: I79b48387609c6233c6f05b04fb8bba66b68c2399
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: c3a095a180]
2023-05-17 21:18:52 -05:00
Ranjith Ramakrishnan 4ff7dc0c49 SWDEV-321112 - Use GNUInstallDirs
Use GNUInstallDirs variables to determine the location of LIBDIR, BINDIR, INCLUDEDIR, DOCDIR

Note that CMAKE_INSTALL_LIBDIR is overriden, since the default for RHEL
is lib64, but ROCm packaging wants it to be lib always. Distros or users
can easily override this.

Change-Id: I616152ccd2bc1f5a60bffa940312b38ca6e88c04


[ROCm/amdsmi commit: b72c464ac0]
2022-06-16 13:22:49 -04:00
Bill(Shuzhou) Liu 4884de63fd Correct the __pycache__ folder
Remove the __pycache__ in the folder libexec/rocm_smi

Change-Id: I0ad505ff7e7368d5fe86e1eee12080039edc7111


[ROCm/amdsmi commit: 9f814e150e]
2022-03-24 09:44:33 -04:00
Bill(Shuzhou) Liu ee67414d43 Remove python pyc file when uninstall
Remove python pyc file when uninstall.

Change-Id: I383faf8fcfaeeb346c9ee38c1aad8577a460281e


[ROCm/amdsmi commit: c37d4bac8f]
2022-03-23 13:39:57 -04:00
Ranjith Ramakrishnan 2a0ecb1e56 File reorganization with backward compatibility
Wrapper header files
Soft link to libraries and binaries
rocm_smi.py and rsmiBindings.py installed in libexec/rocm_smi
Binaries, libraries and header files installed as per File Reorg folder structure

Change-Id: I3166ab67f89c2ae4aafbc87bb00c9a5233221ade


[ROCm/amdsmi commit: f1da5591b5]
2022-03-03 18:48:52 -05:00
Saravanan Solaiyappan e8ea51109b Consider apt/yum upgrade operation check in package scripts.
Include the upgrade operation check in the prerm and postun scripts
for rocm-smi-lib package.

Signed-off-by: Saravanan Solaiyappan <saravanan.solaiyappan@amd.com>
Change-Id: Ic3dee7ae50a2ac317f1aab88472b6d4805c4de90


[ROCm/amdsmi commit: 3a3b8dd25d]
2022-02-24 10:11:32 -05:00
Cole Nelson 005f98d117 CMakeLists.txt: add ENABLE_LDCONFIG to support multi-version install
Signed-off-by: Cole Nelson <cole.nelson@amd.com>
Change-Id: If06e8b7b57ad12f22c1970622d241a42083d575e


[ROCm/amdsmi commit: f990d775b7]
2021-03-30 15:39:47 -04:00
Chris Freehill 9d2e2ffffd Change Debian Architecture from amd64 to any
rocm_smi_lib is not currently known to only compile
on specific architectures.

Change-Id: I209e8baa063e99ebe5ff09eaf0dc6541770aa829


[ROCm/amdsmi commit: 7effb405f0]
2021-02-01 13:48:38 -06:00
Chris Freehill 73200ba07d Add postinst and prerm scripts for debian and rpm
[ROCm/amdsmi commit: 15efd11dcc]
2019-01-10 10:38:34 -06:00
Chris Freehill 340f3bc424 Add postinst and prerm scripts for debian and rpm
[ROCm/amdsmi commit: b9b0b26a78]
2019-01-09 10:28:01 -06:00