Commit Graph

26 Commits

Author SHA1 Message Date
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