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

526 Коммитов

Автор SHA1 Сообщение Дата
Hao Zhou 4e6cc32a1d Revert^2 "Revert "Merge amd-staging into amd-master 20230524""
411b27689f

Change-Id: Ibb44f48a8ea2099de01cf04d31b47f2a2f2473ad


[ROCm/rocm_smi_lib commit: be41c19d3c]
2023-06-02 02:12:07 -04:00
Hao Zhou dae9c3c9aa Revert "Merge amd-staging into amd-master 20230602"
Revert submission 869878

Reason for revert: <RPM package on RHEL9.x is broken>
Reverted Changes:
I4886ef2a6:Merge amd-staging into amd-master 20230602
I0f277acf3:Revert "Revert "Merge amd-staging into amd-master ...

Change-Id: Ie370327c8db0404c9cedde42c1376e3cec56fae0


[ROCm/rocm_smi_lib commit: 5aa94c48d1]
2023-06-02 02:12:07 -04:00
Hao Zhou 07f14f41d8 Merge amd-staging into amd-master 20230602
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I4886ef2a60b08e17bd9165ff0cd46b4297e15972


[ROCm/rocm_smi_lib commit: 8560d96c81]
2023-06-02 10:11:48 +08:00
Hao Zhou 411b27689f Revert "Revert "Merge amd-staging into amd-master 20230524""
This reverts commit cad1008c3e.

Change-Id: I0f277acf328566485994b0a771b685172541874c


[ROCm/rocm_smi_lib commit: 4e044a1f6c]
2023-06-02 10:11:10 +08:00
Galantsev, Dmitrii 6aef6b09ea Clean-up python errors and warnings
Used pyright to show errors and warnings and resolved most

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


[ROCm/rocm_smi_lib commit: e8391c9d7c]
2023-06-01 17:37:57 -04:00
Charis Poag b96cc5b897 [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/rocm_smi_lib commit: b0f2a9d2ef]
2023-06-01 11:58:42 -04:00
Galantsev, Dmitrii 98f1868290 Fix memset compile warning
Change-Id: If31210f3c6038e56f43ae8631ed1657d1509488e
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/rocm_smi_lib commit: 2048f8978f]
2023-05-31 21:54:32 -04:00
Hao Zhou cad1008c3e Revert "Merge amd-staging into amd-master 20230524"
This reverts commit 11be79e5fa.

Reason for revert: <commit break mainline rocm builds - RHEL-9>

Change-Id: Ideed94313b15bc8af2bd9855535d490fd84b5c3b


[ROCm/rocm_smi_lib commit: 7d508f75ab]
2023-05-25 01:53:24 -04:00
Bill(Shuzhou) Liu 269e0e23f9 Fallback to gpu_metrics if the sysfs is not available
The gpu_metrics may have required PCI link width and speed.

Change-Id: I939d733f5f6a71088545ba042345eb1b6ad20ee5


[ROCm/rocm_smi_lib commit: a6467c4083]
2023-05-24 14:51:43 -05:00
Hao Zhou 11be79e5fa Merge amd-staging into amd-master 20230524
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I049d28cfd837e104f71051695baaca9e4f2ca4f9


[ROCm/rocm_smi_lib commit: 3629c4d5ca]
2023-05-24 12:40:26 +08:00
Bill(Shuzhou) Liu 6b5406091a SWDEV-400644: Reset the mutex only if errors
To prevent reset the mutex while using it, only reset the mutex
if it cannot acquire it.

Change-Id: I95e0ed1bf543f285ce81b4df9c51e16a88081d38


[ROCm/rocm_smi_lib commit: 160c99d12d]
2023-05-22 11:20:44 -04:00
Charis Poag 99bc3fb502 [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/rocm_smi_lib commit: c3a095a180]
2023-05-17 21:18:52 -05:00
Sam Wu 2496c1bc33 sphinx documentation
ref: https://github.com/RadeonOpenCompute/rocm_smi_lib/pull/119

fix formatting in docs/index.md

Change-Id: I940ef8147a40bd3b702aa591bd56557a870621fb


[ROCm/rocm_smi_lib commit: ed74bc6eca]
2023-05-11 10:41:45 -04:00
Ranjith Ramakrishnan 919d21fdb1 SWDEV-383221 - Set the default value of ROCM_HEADER_WRAPPER_WERROR to OFF
Using wrapper header files will result in #warning message by default

Change-Id: I8941a96bdc1b921a7646ccb353130cb283957ff8


[ROCm/rocm_smi_lib commit: daffcdb930]
2023-05-08 16:56:52 -07:00
Hao Zhou e37e2d67c1 Merge amd-staging into amd-master 20230414
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I518af7182bb6537c9c03a30d53c44d2143f3064f


[ROCm/rocm_smi_lib commit: ecb1303732]
2023-04-14 12:17:58 +08:00
Charis Poag d38ba30a0f [SWDEV-392571] Fix concise info when missing VRAM info
Updates:
    * [rocm-smi] Added larger app width size, which helps
      display missing device info
    * [rocm-smi] Added better context when rsmi_ret_ok
      does not return with RSMI_STATUS_SUCCESS
    * [rocm-smi] Removed all references to an
      undefined function (printLogNoDev())
    * [rocm-smi] Fixed not detecting non-int
      values when setting the voltage curve
    * [rocm-smi] Added better context on missing
      sysfs file when setting clock overdrive
      values
    * [rocm-smi] Fixed getMemInfo() calls not
      referencing tuple values (making it easier
      to read)
    * [rocm-smi] Silenced concise info spitting
      out errors for missing VRAM files, instead
      display which metric is "unsupported" if
      the files are missing
    * [rocm-smi] Updated function descriptions for
      rsmi_ret_ok & getMemInfo
    * [rocm-smi] Updated getMemInfo to provide a
      quiet call, to silence for concise info calls.
      This provides a way to keep the output clean.
    * [rocm-smi-lib] Added when using debug sysfs
      files, to state, which enums are enabled
      for debug

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


[ROCm/rocm_smi_lib commit: 6be92b9e26]
2023-04-13 15:11:35 -04:00
Hao Zhou 79ed75a437 Merge amd-staging into amd-master 20230407
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Icf2ea8ab76a521f31bc551b4cf644fc833765263


[ROCm/rocm_smi_lib commit: b21fe43ec1]
2023-04-07 11:06:58 +08:00
Bill(Shuzhou) Liu 050e38f2a1 Validate the clock frequency when set it
Add the check of the clock frequency when set it.

Change-Id: I707291bfb5007bb69100c780af50a4b0f697bb37


[ROCm/rocm_smi_lib commit: b6789891b0]
2023-04-06 11:54:38 -04:00
Charis Poag 91d8ea7165 [SWDEV-391036 + SWDEV-392933] Fixes for VoltRead and ComputePart.
Updates:
    * VoltRead - needed to properly send out RSMI_STATUS_NOT_SUPPORTED
      when device does not have voltage hwmon files
    * ComputePart. - test failure was likely caused due to EvtNotif
      causing conflicts (unknown exactly why). Test passes when
      moving it ahead of the event notifier. Both API calls may have
      a system resource issue, TBD.
    * rocm_smi_example - now indicates when an API call
      returns RSMI_STATUS_NOT_SUPPORTED or
      RSMI_STATUS_NOT_YET_IMPLEMENTED. Allows example to fully complete
      on systems which may not provide support for all API calls.

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


[ROCm/rocm_smi_lib commit: 78a0812f7f]
2023-04-05 12:44:29 -05:00
Hao Zhou 0befec7982 Merge amd-staging into amd-master 20230331
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I4d59f2bfb9a4f3cf64662d76437ddb808f6b510b


[ROCm/rocm_smi_lib commit: f454d46b31]
2023-03-31 10:34:00 +08:00
Bill(Shuzhou) Liu fe2c2835c9 Increase the max BDF ID length
Increase the max length from 256 to 512.

Change-Id: I3114f7ce6852aafa9dfec0186f27c1121c939c69


[ROCm/rocm_smi_lib commit: 58c83eb379]
2023-03-29 10:04:28 -04:00
Bill(Shuzhou) Liu e328b16358 Correct subsystem name by matching device id.
The rsmi_dev_subsystem_name_get() only matches subvendor id and
subdevice id for a vendor. The change will also match device id.

Change-Id: Ife3aedaf6fc7390ed7fa62edbde40c2340689b23


[ROCm/rocm_smi_lib commit: 0c82a9d577]
2023-03-28 15:48:31 -05:00
Hao Zhou 77eb3c3938 Merge amd-staging into amd-master 20230323
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I2155fa727d4a2a46cbeca3e65f6ae2d9c31c91a5


[ROCm/rocm_smi_lib commit: 230b5bcee3]
2023-03-23 17:11:34 +08:00
AravindanC 3958626b0a SWDEV-351540 - ASAN packaging for rocm_smi_lib
Change-Id: Iab354d02d261a0270a3d118b825835fc6f021c15


[ROCm/rocm_smi_lib commit: 778f3b7fdc]
2023-03-20 13:14:53 -07:00
Charis Poag e264bf6c02 [SWDEV-387906] Fix rocm-smi initialize crash
Fix was needed due to hwmon updates.
Several voltage sensors (ex. vddgfx/vddnb)
are unsupported or not applicable
to upcoming hardware. This was not the case
for previous hardware sensors, resulting in
the rocm-smi crash observed.

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


[ROCm/rocm_smi_lib commit: f44d1ea8bc]
2023-03-17 15:04:34 -05:00
Hao Zhou e6136fc1e4 Merge amd-staging into amd-master 20230317
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Iad8075d8aae2e0577dd6a36ce789d4f07741a448


[ROCm/rocm_smi_lib commit: 74c96dbbff]
2023-03-17 11:20:57 +08:00
Bill(Shuzhou) Liu 3c829750a8 Fix cppcheck static analysis report warning
Fix some warning from static anaysis tool.

Change-Id: I7e8c2f5d6f79aff5fdcad81b1fd832900f213c47


[ROCm/rocm_smi_lib commit: 1b7eb4e1f4]
2023-03-13 09:27:19 -05:00
Ranjith Ramakrishnan c9b70a79e6 SWDEV-366831 - Compile time flag to switch between #warning and #error message
Using backward compatibility paths will provide an #error message. Compile time option added to enable/disable the #error message.
Disabling the same will provide a #warning message

Change-Id: Ib49633501aa6eb6d97158b1ecfc47de6f18fba85


[ROCm/rocm_smi_lib commit: 14b86107a7]
2023-03-10 08:56:45 -08:00
Hao Zhou bc1540e3e2 Merge amd-staging into amd-master 20230307
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: Iec37aa680c552f98eca97279e0b7d99475a7795e


[ROCm/rocm_smi_lib commit: 68ca36e43c]
2023-03-07 10:00:44 +08:00
Bill(Shuzhou) Liu 73f8c1563a Filter out the GPUs not assigned to a container in showpid
The process ids of other container are still visible in the sysfs file,
filter it out to prevent crash.

Change-Id: I665912cd09c606804186aff8cba5c24f5e58ded7


[ROCm/rocm_smi_lib commit: 710649ab66]
2023-03-06 11:05:02 -06:00
Charis Poag da7b59046b [SWDEV-335697 + SWDEV-342812] Fix NPS & Compute tests
Updates:
    * Fixed rsmi_dev_compute_partition_get
      & rsmi_dev_nps_mode_get to properly check
      for invalid arguments
    * Updated compute partition & NPS mode tests
      - Now properly confirms the invalid
        argument is seen
      - Spacing for multiple devices is added
        to better see distinction between
        separate device's tests (for verbose output)
      - Changed expect to assert calls, so errors
        are observed faster for test failures
      - Fixed multiple device testing where a
        variable should have been unset, but
        having multiple devices caused it to
        set
      - Updated multiple device testing to iterate
        accross all devices (previously returned,
        instead of continuing checking support
        after RSMI_STATUS_NOT_SUPPORTED detected)
      - Fixed a few spelling errors & verbose output

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


[ROCm/rocm_smi_lib commit: c252ecccd1]
2023-03-02 13:24:38 -06:00
Hao Zhou 8a7fa92639 Merge amd-staging into amd-master 20230302
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I17c723b907c988754d2da5d04092c1d435e29cc1


[ROCm/rocm_smi_lib commit: c189126be6]
2023-03-02 14:13:00 +08:00
Bill(Shuzhou) Liu 06028876b0 mem_use_pct uninitialized error
Initialize mem_use_pct if the memory info is not available.

Change-Id: Id8e285050149c51077356826c8f99719b473060d


[ROCm/rocm_smi_lib commit: fcb6afa289]
2023-02-27 16:47:45 -06:00
Charis Poag 5c3a3f3641 [SWDEV-335697] Add RSMI_STATUS_SETTING_UNAVAILABLE for dynamic partition
Updates:
    * Added RSMI_STATUS_SETTING_UNAVAILABLE for
      rsmi_dev_compute_partition_set - gives users
      better error output when attempting to set
      compute partition to values not listed in
      available_compute_partition SYSFS
    * Updated python --setcomputepartition to
      provide better output when receiving
      RSMI_STATUS_SETTING_UNAVAILABLE
    * Updated all test & example files to check for
      RSMI_STATUS_SETTING_UNAVAILABLE when doing
      rsmi_dev_compute_partition_set

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


[ROCm/rocm_smi_lib commit: 0d3558945b]
2023-02-27 11:17:44 -06:00
Bill(Shuzhou) Liu b093ec72a1 Memory usage division by zero
The showAllConcise with division by zero error.

Change-Id: I469f1b9f268842cd51662be6f9036f555a8949b2


[ROCm/rocm_smi_lib commit: 55bc2e2072]
2023-02-24 10:12:36 -06:00
Hao Zhou 1ebe5b4722 Merge amd-staging into amd-master 20230223
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: If82fc6ac361e6ef5a68ae9dfe333dd8685a02fb5


[ROCm/rocm_smi_lib commit: d93a307f4b]
2023-02-23 18:13:38 +08:00
Bill(Shuzhou) Liu 84882db8fc Use Unified Changelog Template
The CHANGELOG.md is added to track changes.

Change-Id: I33547cb7f1596b4b8abf206aebdd664649d4d19f


[ROCm/rocm_smi_lib commit: b40933b895]
2023-02-21 14:27:55 -06:00
Charis Poag 2001f3620e [SWDEV-381630] Add reset partition functionality
Updates:
    * Added rsmi_dev_compute_partition_reset & rsmi_dev_nps_mode_reset
    * Added --resetcomputepartition and --resetnpsmode python smi calls
    * Added temp data files rocmsmi_boot_compute_partition_<device num>
      & rocmsmi_boot_nps_mode_partition_<device num>, writes UNKNOWN
      if data cannot be read or device does not support
    * Cleaned up NPS & compute API documentation
    * Added creation and reading of API temp files (used in reset
      functionality)
    * Cleaned up output of rocm_smi_example
    * Updated rocm_smi_example to check if running with sudo permission
      before executing write API calls (cleans up erroneous output)
    * Added template specialization for storing temp data, requires
      specific rsmi_type_t enums (restrics what data can be stored)
    * Added storage of temp data, if temp files do not exist
    * Updated google tests for NPS & compute to include reset API calls

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


[ROCm/rocm_smi_lib commit: 77c950a4bf]
2023-02-17 12:55:08 -06:00
Hao Zhou 923018a3a5 Merge amd-staging into amd-master 20230216
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I1a439acaf0208f9bc68ac19753c1df98ea5387ee


[ROCm/rocm_smi_lib commit: 405dff6b64]
2023-02-16 17:04:21 +08:00
Charis Poag 3ab5bb3230 SWDEV-342812- Add NPS support
Updates:
    * Added rsmi_dev_nps_mode_set and rsmi_dev_nps_mode_get
    * Added ability to set multiple SYSFS files in debug build
    * Added ability to see user's env variables set for debug build
    * Added tests for rsmi_dev_nps_mode_set and rsmi_dev_nps_mode_get
    * Added ability to restart AMD GPU driver, used in nps_mode_set
    * Updated ROCm_SMI_Manual.pdf to include new APIs
    * Added progress bar for long running python_smi_tools, used
      in setting nps_mode if runs longer than .1 seconds

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


[ROCm/rocm_smi_lib commit: 9ef376cd61]
2023-02-14 11:54:24 -06:00
Bill(Shuzhou) Liu 79583335ee rocm-smi --showxgmierr return error instead of error counter values
The rocm-smi pass wrong arguments

Change-Id: I3a3923abdd263d4af87f3ec90670bb16afa2ef9b


[ROCm/rocm_smi_lib commit: ae10e842af]
2023-02-13 16:36:24 -05:00
Bill(Shuzhou) Liu 0cb9fad0bf Dispaly printable device name
Fallback to other methods if the device name in sysfs is not printable.

Change-Id: I20b22950399d4a515d2688b955248a3de3c61d05


[ROCm/rocm_smi_lib commit: 00a6c78a51]
2023-02-10 11:32:46 -05:00
Ranjith Ramakrishnan 33f167725b SWDEV-366831 - File reorg backward compatibility message changed to #error
Change-Id: I3d3b220b31f42140eab5404df790a130d2c238c4


[ROCm/rocm_smi_lib commit: 02141a7f1d]
2023-02-08 14:25:16 -08:00
Hao Zhou 87afa947ed Merge amd-staging into amd-master 20230203
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I0519fc50fbcb604bc548ce1883c9f57c9a3be250


[ROCm/rocm_smi_lib commit: c8aace17df]
2023-02-03 11:28:16 +08:00
Ori Messinger 58d4fd4edb ROCm SMI CLI: Fix --showproductname bug
This patch fixes a --showproductname bug, which is related to the
device's SKU. If a device with a VBIOS value that cannot be decoded
is used, that device's SKU cannot be parsed out of the VBIOS string.

Now, when the VBIOS value cannot be decoded, an error will be
printed instead of crashing with an 'UnboundLocalError' message.

Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Change-Id: I680a182e94107e782235b8a2477ab165988f7703


[ROCm/rocm_smi_lib commit: 56f9d6bfc0]
2023-02-02 14:52:13 -05:00
Hao Zhou 72424134a6 Merge amd-staging into amd-master 20230131
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I9c65e1f119f64e2a990e5e05e253e124f8a03f46


[ROCm/rocm_smi_lib commit: c4fd53f5b3]
2023-01-31 09:47:47 +08:00
Harish Kasiviswanathan 37cfd53304 Don't depend on vbios_version sysfs file
On APU's vbios_version string might not be exposed. Relying on vendor ID
to detect AMDGPU is sufficient

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I08ef4b4bc7491a40f318791803aeaf261f7fac25


[ROCm/rocm_smi_lib commit: 142dcfa8f4]
2023-01-29 21:31:13 -05:00
Hao Zhou 9752d2d8a4 Merge amd-staging into amd-master 20230130
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I80aa789bbf0915810d1f786c2eacc3e210755c59


[ROCm/rocm_smi_lib commit: e24a2f9d73]
2023-01-30 09:51:33 +08:00
Hao Zhou 35704156f0 Merge amd-staging into amd-master 20230118
Signed-off-by: Hao Zhou <Hao.Zhou@amd.com>
Change-Id: I3672f4919d7636f2a9521f0364e65c0dda1c2b2b


[ROCm/rocm_smi_lib commit: 0802602499]
2023-01-18 09:13:06 +08:00
Elena Sakhnovitch 1e7502f300 Measure api execution time
Add new test to measure api execution time.

Change-Id: I0ad10c822bad4a2ae04b5785173b4ff21996021d


[ROCm/rocm_smi_lib commit: 2b449fe58d]
2023-01-16 17:00:36 -05:00