Commit Graph

117 Commits

Author SHA1 Message Date
Elena Sakhnovitch 9a7f79905d rocm_smi_lib: add gpu_metrics_v1_3 support
Signed-off-by: Elena Sakhnovitch
Change-Id: I4a9dedc80b8fce60e12c5baf8651d54d16a6a41c


[ROCm/amdsmi commit: fee82af1fe]
2021-08-13 09:23:35 -04:00
Harish Kasiviswanathan 10a16579c1 Add timestamp resolution info in comments
Specify that timestamp resolution is in ns in header file.

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


[ROCm/amdsmi commit: 14201290a2]
2021-05-05 12:32:58 -04:00
Harish Kasiviswanathan 0e17236bc5 Add support to read gpu_metrics version 1.2
gpu_metrics version 1.2 provides atomic timestamp. Use this timestamp.

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


[ROCm/amdsmi commit: 6b10a7761b]
2021-05-05 12:31:10 -04:00
Harish Kasiviswanathan 3c7b9cef95 Change #define RSMI_GPU_METRICS_API_CONTENT_VER
Chnage to RSMI_GPU_METRICS_API_CONTENT_VER_1. In preparation for
supporting additional formats

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


[ROCm/amdsmi commit: e83cf605c6]
2021-05-04 20:51:10 -04:00
Ori Messinger 9537c89a6b ROCm SMI LIB: Add Default GPU Power Cap
Implement default GPU power cap functionality in the LIB.

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


[ROCm/amdsmi commit: 83cd2fe4f1]
2021-04-22 10:49:55 -04:00
Harish Kasiviswanathan 52dc52654d Add energy counter resolution to rsmi_dev_energy_count_get
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Change-Id: I03b70968257db7a45e21d7ba62542cdedd18eb85


[ROCm/amdsmi commit: 844acbc0d8]
2021-04-22 10:25:06 -04:00
Divya Shikre 5db8002118 Add new setrange function in C++ lib
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I670aaeb93827bf4b2cc08eb36d0f9756f00e4e4e


[ROCm/amdsmi commit: 9f9a7aaf65]
2021-04-19 22:38:59 -04:00
Elena 1fa63e0e9c [rocm-smi-lib] add HBM temperature conversion factor
Change-Id: I45339c87c3d2a40670baf1b76ada60dceb650dc0


[ROCm/amdsmi commit: a383dd23aa]
2021-04-19 16:41:48 -04:00
Bill(Shuzhou) Liu 919364871d Add energy accumulator counter
The energy accumulator counter tracks all energy consumed.

Change-Id: I5b25f817b7802d81c477361447f0ecd7ec02fc61


[ROCm/amdsmi commit: 8eec0a7d36]
2021-04-14 10:43:01 -04:00
Bill(Shuzhou) Liu 38ddf00856 Add coarse grain utilization counter
The coarse grain utilization counter includes GFX and Memory activity.

Change-Id: I5d09976792d3f4a1c1081651fa24ff857016d4c0


[ROCm/amdsmi commit: 9bfb9ac297]
2021-04-14 10:40:19 -04:00
Divya Shikre 0fc1abdced Update performance determinism api as per the modified sysfs interface.
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Ib0ec5128819644a2ff6c916da9194a7fe1dad795


[ROCm/amdsmi commit: aaf2120117]
2021-04-07 16:38:48 -04:00
Bill(Shuzhou) Liu 7b48f14374 Add support for the HBM temperature
The rsmi_dev_temp_metric_get() can also support the HBM
temperatures which is retrieved from gpu_metrics.

Change-Id: I96b979296e90cf881523627b41b1a02849676416


[ROCm/amdsmi commit: da480b4589]
2021-04-05 15:55:55 -04:00
Chris Freehill 7337bfaef9 Handle different gpu_metrics content versions for format v1
Change-Id: I344d1815da683befc8f8b5caf921803b267ae29f


[ROCm/amdsmi commit: 5e2a4f3a15]
2021-03-24 14:34:55 -05:00
Chris Freehill 826996c1c1 Adjust event counters to report only new events
Previously, RSMI assumed that the event counter values returned
from perf were only new events. But in fact, when we read the
counter values, they are running totals. To account for this, we
now record the value we read and take the difference between the
current value and the previously recorded value.

Change-Id: I1e04b514e89c7c4d4719889f2dae3a1283864e7f


[ROCm/amdsmi commit: ce475b009c]
2021-02-24 11:02:17 -06:00
Chris Freehill fff19b1b3e Don't use hwmon# as indicator of gpu
Previously, during the rsmi_init discovery process, the existence
of an hwmon# directory was used to distinguish between gpus nodes
and non-gpu nodes. This isn't reliable in some scenarios. Instead,
the existence of the vbios_version file is used as an
indicator that the node is indeed a gpu.

Change-Id: Icfbe5c42ed0970077b05f25c3d209308a31bec85


[ROCm/amdsmi commit: ff9546aa62]
2021-01-29 13:05:10 -05:00
Ori Messinger d41364d1cf ROCm SMI Python CLI & LIB: Add GPU Reset Functionality
The purpose of this patch is to implement GPU reset functionality
in the LIB, and to call it from the rocm_smi python CLI.

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


[ROCm/amdsmi commit: 80f629b9be]
2021-01-26 17:52:24 -05:00
Chris Freehill 76323354d1 Introduce RSMI_DEBUG_INFINITE_LOOP
The environment variable RSMI_DEBUG_INFINITE_LOOP is introduced
to facilitate debugging RSMI in user applications. When this
env. variable is non-zero, an infinite loop will be entered in
rsmi_init(). At this point, a debugger can be attached and RSMI
can be debugger. This only applies to debug builds.

Change-Id: I23f6dd730fc965764295070de053314a1cc5b6aa


[ROCm/amdsmi commit: 68095b50e7]
2021-01-06 10:30:24 -05:00
Divya Shikre 22516a3b63 Fix for error while reading gpu_metrics sysfs file
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: If69b7eeb3573ebece9ed0cb539f5ddffbe3c2f09


[ROCm/amdsmi commit: efd234c9e3]
2020-12-18 15:31:16 -05:00
Divya Shikre 4fd8d18e22 Adding Performance Determinism Mode to rocm_smi lib, CLI & gtest.
A special mode of operation to achieve minimal performance variation by letting
the user have the ability to provide the desired frequency to be set as the soft limit.
The user can control the entry and exit to the mode via rocm-smi a mechanism to
enter / exit performance determinism mode as below.

Enter performance determinism mode:
- hold a lock
- write performance_determinism to power_dpm_force_performance_level
- write input clk_freq to pp_dpm_sclk
- release lock

Exit performance determinism_mode:
- hold a lock
- write auto to power_dpm_force_performance_level
- release lock

Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Ia24e27954cdf1c4337ffc83d8948fbdfaf4552d2


[ROCm/amdsmi commit: 60d0f3052f]
2020-12-02 11:11:00 -05:00
Chris Freehill c6a58d91cb Quiet address sanitizer warnings
Also,
* Fix some doxygen issues
* Fix address sanitizer issues in rsmitst

Change-Id: Ie6c6fd9af5c418210b7064e79650fb92cd4a5e2b


[ROCm/amdsmi commit: 63064b0000]
2020-11-10 14:16:39 -06:00
Chris Freehill cac03f5a0e Add new XGMI counter events to rsmiBindings.py
Also, correct RSMI_EVNT_LAST to new value.

Change-Id: I9f693cb398bba583201f6b5b5f0e2d45ede2e4e0


[ROCm/amdsmi commit: 1982fdc4fb]
2020-10-22 17:21:50 -04:00
Ramesh Errabolu c69c210a6e Update ROCm SMI library with ability to read CU occupancy
Change-Id: Ib9882fa2d81c13604af282279bfa116bc2fd05a4


[ROCm/amdsmi commit: 328878343c]
2020-10-14 09:33:37 -04:00
Chris Freehill 137e33a1e6 Revert "Revert "Support for RSMI_EVNT_GRP_XGMI_DATA_OUT counters""
This reverts commit 1be2933806.



Change-Id: Ic412a64d35aab74caf12bf4c791f0a66ac15b061


[ROCm/amdsmi commit: 5465d872aa]
2020-10-08 10:36:30 -04:00
Chris Freehill 1be2933806 Revert "Support for RSMI_EVNT_GRP_XGMI_DATA_OUT counters"
This reverts commit dc48f149f0.

Temporarily reverting until the driver side of this is upstream

Change-Id: I2d8243208c1271ebad90bc2ee0fda2dfefb0831b


[ROCm/amdsmi commit: ae6d3fbdd0]
2020-10-07 18:42:56 -04:00
Kent Russell d41e3be1b0 Check FRU-based product information if available
WKS and server cards have an FRU with product information, so try to use
that for product name and product SKU if it exists.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I40bbd3bf62f4cb02e96015ed1630112691cacbc3


[ROCm/amdsmi commit: df7c3434cd]
2020-10-07 14:09:23 -04:00
Chris Freehill dc48f149f0 Support for RSMI_EVNT_GRP_XGMI_DATA_OUT counters
Also some format fixes

Change-Id: Id3c0f6b3cf5b327bb9ca6acb6091dc67764c8032


[ROCm/amdsmi commit: 946bf93dfb]
2020-10-05 17:22:19 -05:00
Divya Shikre 5cddbccec6 Adding functionality that will parse gpu_metrics sysfs file
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I3a84870b83eb4cd0ed46f10bb19169c91f99fd8e


[ROCm/amdsmi commit: 8b48564ce3]
2020-10-02 10:25:41 -04:00
Mukul Joshi cdb6fd8870 Add support for GPU reset SMI events
Add handling for both pre GPU reset and post GPU reset SMI
events.

Change-Id: I64d5e006bef58cb28b1c580c75f482a4590427da


[ROCm/amdsmi commit: 8b95705e6f]
2020-09-16 13:25:06 -04:00
Mukul Joshi e6f5d59edf Add support for KFD Thermal Throttling SMI event
Add handling for receiving thermal throttling SMI event from the
kernel.
Also, update the event notification test to work with the new event.

Change-Id: Ib89c12b244f90998ccbae0a38b37f25705d156e0


[ROCm/amdsmi commit: aff75c955f]
2020-09-16 13:24:57 -04:00
Mukul Joshi d7e3e0f579 Update KFD SMI event notification handling
Event bitmask in KFD SMI event is now replaced with event index in
the SMI event message. Sending a event bitmask, which was a 64-bit
field with only 1 bit set, was quite wasteful of memory and also
potentially limiting to 64 events. Instead the kernel would send
event index in the SMI event message. As a result, update the
KFD SMI event handling to expect the event index in the message.

Change-Id: I3e74620788d3c1f7c0bdaa69e9d9ab3d1aba2c92


[ROCm/amdsmi commit: 406859ca8a]
2020-09-16 13:24:50 -04:00
Chris Freehill 34fd068d3c Add missing docs section for EvntNotif
Change-Id: I69187c734d2618ddb4272c58bb76d04646908793


[ROCm/amdsmi commit: cafd678d5d]
2020-09-11 15:48:56 -05:00
Divya Shikre b0b388b538 Adding setsrange, setmrange, setvc, setslevel and setmlevel functionality to rocm lib and cli
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: I5fd65ea7bcd5403aaf2e42d2aa28d837929da253


[ROCm/amdsmi commit: 54d4b9d500]
2020-09-08 18:42:39 -04:00
Chris Freehill 596799c441 Correct event counter documentation example
Change-Id: I74c41de8e4aacbd42d9e156983369eb76bec3367


[ROCm/amdsmi commit: 0468aa4971]
2020-08-06 08:49:21 -05:00
Chris Freehill 43fd9d8044 Correct usage of bitwise &
Also, fix warning related to catch() and cpplint error.

Change-Id: I4292170538d0f700fccb605814c5058543abe74a


[ROCm/amdsmi commit: c2439d28e8]
2020-07-26 20:08:24 -05:00
Chris Freehill 77fc313a36 Update xgmi event counter documentation
Also:
* fix doxygen manual generation that was altered during
  OAM refactor
* quiet some compile warnings.

Change-Id: I548a3cf00eb887bea3dbf58e362ca6dfe90bde28


[ROCm/amdsmi commit: 52514835f0]
2020-07-16 17:42:56 -05:00
Mukul Joshi 7c6027d790 Add support to retrieve process SDMA usage information.
Also, print SDMA usage information in TestProcInfoRead.

Change-Id: I8d19be3b8653e298c81237e5067eca75a1743e70


[ROCm/amdsmi commit: eea1ed8c3d]
2020-07-13 17:32:08 -04:00
Chris Freehill 55c91f9c24 Handle un-readable kfd properties files
Some systems have kfd sysfs properties entries that
are unreadable--for example, when a multi-gpu system is
dividing the gpus among containers, each container may
only be able to access certain gpus.

Previously, all kfd topology node properties entries were
assumed to be valid. Now, we check for readability before
declaring them "valid".

Fixes SWDEV-240169

Also:
* remove an assertion that would happen when no pcie
device identifier files are found on the system.
* fix cpplint issues

Change-Id: I74321b685159dd2628c890b33c39ad82988cb9dd


[ROCm/amdsmi commit: 68155baed5]
2020-07-10 12:35:31 -04:00
Chris Freehill ca36d70cee Fix docs + cmake_utils path issues
This corrects issues that arose after OAM reorganization.
It should address SWDEV-243294.

Also, fix some compile warnings that show up on RHEL.

Change-Id: Id14d444905da35cd7346bcfbcd82b6d0572708c4


[ROCm/amdsmi commit: c2ef9a6879]
2020-07-08 09:47:25 -05:00
Chris Freehill 9e57932639 Refactor rsmi to support oam
Change-Id: Idc524e01ba06eb5c8d1682becaf5bf8ced5bffcf


[ROCm/amdsmi commit: 6594f8f58b]
2020-06-22 18:51:46 -05:00
Mike Li 9375ef92fc Add support to retrieve XGMI hive id
Change-Id: I1eee05dd85ecb856889d1cfe0565454d2f538856
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>


[ROCm/amdsmi commit: 488bbb668a]
2020-06-19 07:35:23 -07:00
Divya Shikre 50c41fc401 Adding current voltage feature & gtest.
Signed-off-by: Divya Shikre <DivyaUday.Shikre@amd.com>
Change-Id: Ic555a3af265e603419e2875d1989a366abc82596


[ROCm/amdsmi commit: 2805ed16a4]
2020-06-16 11:48:56 -04:00
Chris Freehill b30200cd48 Update XGMI perf counter test to show utilization
Also:
* When destroying a counter, make sure to stop the counter first
* In the test, do not stop (disable) the counter before
  reading it.
* Clean up some whitespace in other tests
* Re-add manual pdf file

Change-Id: I0786ef3a994ca568299c77e44f092af8943ac33d


[ROCm/amdsmi commit: f946ea37ef]
2020-06-10 12:49:49 -04:00
Mukul Joshi 46a04aa3ae Add support to retrieve process VRAM usage information.
Change-Id: I60843a99207a658022a26aa346b79f91863833cf


[ROCm/amdsmi commit: e30ebbc787]
2020-05-26 15:19:24 -04:00
Chris Freehill b1c550f82d Add RSMI ref manual to packages
Also,
* remove extraneous test files
* fix Doxygen docs. issues
* fix whitespace issues

Change-Id: I9b58b0d68bd125a34f4fe0dc84d609c7b0b6e30e


[ROCm/amdsmi commit: 8ced9c986a]
2020-05-18 23:40:38 -04:00
Mike Li 84e3d0f0e9 Add functions that are used to query Hardware topology.
Change-Id: I0f4cd02b237bde4d6dccfb0e83e65376ecb1cfaa
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>


[ROCm/amdsmi commit: c7d349183a]
2020-05-18 12:37:27 -04:00
Chris Freehill 5297b1172d Don't use static variable for monitors
Change-Id: I24b5ccfa94b2d722b070a6c6385af9201d21d9c5


[ROCm/amdsmi commit: 02e4a9c14f]
2020-05-15 08:05:06 -04:00
Chris Freehill 42aa39ac22 Add ref counting for rsmi init and shutdown
Also, clean lint from kfd_ioctl.h file.

Change-Id: I5a2ae127ab6ab6676a1b075ed10858d0ebfe13c1


[ROCm/amdsmi commit: 8e03d10035]
2020-05-11 15:57:42 -05:00
Chris Freehill dcacb71f68 Use user-mode version of kfd_ioctl.h file
Previously using kernel mode version.

Change-Id: I82bfff9c019a9059b4d0d198c6cf06dc515cc528


[ROCm/amdsmi commit: e1f0d7e85a]
2020-05-07 17:13:59 -05:00
Chris Freehill b10500a770 Add event notification API
Change-Id: Ib6e8efbe6cdefaa7de1f74bd26993e9b4b011649


[ROCm/amdsmi commit: 2235ede34c]
2020-05-06 14:07:25 -05:00
Chris Freehill d592203ff5 Add device mutual exclusion tests and related fixes
* Added a new test to verify mutual exclusion of access to device
  resources
* Added some missing acquiring of mutexes to some RSMI calls, as
  well as try-catch blocks.

Change-Id: I87aac009878a0b2d1f975e1d5b794d887bb23ff9


[ROCm/amdsmi commit: f8b57c3b16]
2020-04-08 15:05:11 -05:00