Граф коммитов

43 Коммитов

Автор SHA1 Сообщение Дата
Galantsev, Dmitrii 14e81725f6 [SWDEV-509342] Fix uninstall script on older RPM based systems
Change-Id: Ic85cd27e4460fbcdefab6fdd7e813a579c539525
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2025-03-12 01:05:30 +00:00
Ramakrishnan, Ranjith bf01732e7f SWDEV-514558 - Use RPM_INSTALL_PREFIX variable rather than hard coded install prefix paths in RPM post/prerm scripts (#114) 2025-02-20 21:29:41 +05:30
Williams, Justin c01e0bd47a [SWDEV-489695] Fixed lib tests install logic (#103)
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
2025-02-11 15:59:09 -06:00
Justin Williams 747834624b Fixed Python module error 2024-12-19 11:19:01 -06:00
Charis Poag 3ea4a42a6e [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>
2024-11-12 16:50:32 -04:00
Justin Williams 2e5b164c43 [SWDEV-482058 / SWDEV-482971] Added setup.py install
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: Ibad07d34dfb455043ce307fe036289f1d5c20a9a
2024-10-18 16:59:13 -04:00
Justin Williams 807f1e3111 Removed Post Install PyYAML and Pip Upgrades
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I25f0e8087a212fd29d33a8a40303436279789029
2024-09-25 18:20:23 -05:00
Maisam Arif 09c9574454 [SWDEV-469278] - Lowered PyYAML dependency
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Icfee09b84cf1071ec82b65fc2877be69e0283489
2024-09-20 18:03:00 -04:00
Dmitrii Galantsev 6beec5f3ec 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
2024-09-20 16:42:29 -04:00
Dmitrii Galantsev 9924574cbe 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
2024-09-20 16:42:29 -04:00
Maisam Arif 2cfae06560 [SWDEV-482058] Updated Packaging for offline installs
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I8908451c013fc944645b5b5df3104a2ff73e72bd
2024-09-20 00:55:48 -04:00
Justin Williams f2f02aa317 [SWDEV-469278] Lowered PyYAML post install script dependency
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I764c8bf01e6cb6acb0b3fc1db396707099e5ed12
2024-09-20 00:55:48 -04:00
Juan Castillo ac593f9fa0 [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>
2024-09-18 00:27:00 -04:00
Charis Poag d9d6637cb7 [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>
2024-08-29 10:09:29 -04:00
Charis Poag c5da93ab90 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>
2024-05-20 12:03:31 -05:00
Galantsev, Dmitrii eef4169a0f 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>
2024-03-14 13:31:34 -04:00
Maisam Arif 25c8ff6c2a SWDEV-449314 - Added pyyaml check before installing via pip
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Ie6d0d664e74b47c1efce6e6fac19ee4a1bf0d5eb
2024-03-14 13:31:06 -04:00
Maisam Arif 498fde5cf4 SWDEV-437729 - Post install script fixes for pip & pyyaml
Change-Id: If5c4a7947764a0cb5717c906198436304fa62784
Signed-off-by: Maisam Arif <maisarif@amd.com>
2023-12-15 13:34:56 -06:00
Galantsev, Dmitrii 4022889701 SWDEV-423944 - Clean-up un/install scripts
Change-Id: Ib16935ca456f889dc8d1280a37693858afa82715
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-11-20 13:09:09 -05:00
Maisam Arif e0a1a6ca96 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
2023-11-09 00:17:44 -06:00
Galantsev, Dmitrii 08268ba1c1 Don't crash [un]install scripts on python failure
Change-Id: Icfbcc647bda94dd2ff2f65016de5c80af5d1ec79
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-11-02 15:15:27 -04:00
Maisam Arif c2e12feb6a SWDEV-429037 - Automatically install amdsmi python lib with package
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I9c8c1335982ebd61a29da6f66c635f0a97d95f6e
2023-11-02 15:15:27 -04:00
Galantsev, Dmitrii db3e119f7d Remove old gpuv-smi symlink
Change-Id: I39d9aa96eb8ed2dd6a4a222c3c4da9ff2b2de007
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-09-25 00:52:17 -05:00
Galantsev, Dmitrii 5c41319c83 Merge remote-tracking branch 'rocmsmi/amd-staging' into HEAD
Change-Id: I65ed7f3a0d1b6e58bc8377932d7c39db21d1b422
2023-09-21 23:43:20 -05:00
Galantsev, Dmitrii b99867eb80 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>
2023-09-20 10:37:35 -05:00
Galantsev, Dmitrii 431a7071a0 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>
2023-09-20 01:07:51 -04:00
Galantsev, Dmitrii daa2c42627 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>
2023-09-15 03:06:01 -05:00
Galantsev, Dmitrii 936719eeb6 Merge remote-tracking branch 'rocmsmi/amd-staging' into amd-dev
Change-Id: I9c38b4facd472b877d1ad133f3176a023c890955
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-08-23 16:04:15 -05:00
Galantsev, Dmitrii 7cd72a583d 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>
2023-08-17 01:37:40 -05:00
Charis Poag 9c7eed7edc [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>
2023-08-01 21:46:19 -05:00
Charis Poag 4613e8dec3 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>
2023-07-20 19:09:11 -05:00
Charis Poag afa174c655 Merge 'rocm-smi/amd-staging' into 'amd-smi/amd-dev'
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
Change-Id: Id35c9807c45a965c968fb430e3ce4f3c7069c210
2023-07-19 18:46:28 -05:00
Charis Poag e2dec17284 [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>
2023-06-05 13:50:57 -05:00
Charis Poag b0f2a9d2ef [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>
2023-06-01 11:58:42 -04:00
Charis Poag c3a095a180 [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>
2023-05-17 21:18:52 -05:00
Galantsev, Dmitrii cd11d7530b Remove python pyc file before uninstall
I6520b51aac34060b5b90f94a016cec1827a4973f happens after uninstall, which
leaves a dangling directory under /opt/rocm/libexec/rocm_smi.
Removing __pycache__ before uninstall fixes the issue.

Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Change-Id: I695bd085d4a43b678b563b4c35f6d2e8ddfa7d7c
2022-08-11 19:55:14 -05:00
Ranjith Ramakrishnan b72c464ac0 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
2022-06-16 13:22:49 -04:00
Bill(Shuzhou) Liu 42f11bdd63 Remove python pyc file when uninstall rpm
Remove python pyc file when uninstall rpm.

Change-Id: I6520b51aac34060b5b90f94a016cec1827a4973f
2022-06-09 09:00:38 -04:00
Ranjith Ramakrishnan f1da5591b5 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
2022-03-03 18:48:52 -05:00
Saravanan Solaiyappan 3a3b8dd25d 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
2022-02-24 10:11:32 -05:00
Cole Nelson f990d775b7 CMakeLists.txt: add ENABLE_LDCONFIG to support multi-version install
Signed-off-by: Cole Nelson <cole.nelson@amd.com>
Change-Id: If06e8b7b57ad12f22c1970622d241a42083d575e
2021-03-30 15:39:47 -04:00
Chris Freehill 15efd11dcc Add postinst and prerm scripts for debian and rpm 2019-01-10 10:38:34 -06:00
Chris Freehill b9b0b26a78 Add postinst and prerm scripts for debian and rpm 2019-01-09 10:28:01 -06:00