Commit graph

348 Commits

Autor SHA1 Nachricht Datum
gabrpham bd01cfc203 Fixed post reset and ring_hang issues
Issues include:
	SWDEV-480250
	SWDEV-480255
	SWDEV-480248
Known issue:
	`amd-smi event` has threads taking events from the same device
which, in the case of resetting gpus, makes it seem like some gpus have
reset mulitple times and other have not reset at all.

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: Ic7dcc214e0366fc1532ece579d915d34d35d5407
2024-12-06 17:46:00 -05:00
Justin Williams 2370aa1b40 [SWDEV-469278] Removed PyYAML Dependency
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: Idec32cfb0de84cc255b506d7f972e2750992745e
2024-12-03 15:40:44 -05:00
Joe Narlo 35d8e827b9 SWDEV-497305 [AMDSMI] Consistent string lengths
Unify max string length to AMDSMI_MAX_STRING_LENGTH 256
Replace AMDSMI_NORMAL_STRING_LENGTH, AMDSMI_256_LENGTH

Signed-off-by: Joe Narlo <Joseph.Narlo@amd.com>
Change-Id: Ia81d738be0eefb9683ee53d51c969598fe587f50
2024-11-22 15:37:24 -05:00
Joe Narlo 3052ad4220 SWDEV-495787 [AMDSMI] Different license headers
Change copyrights to MIT and remove date

Signed-off-by: Joe Narlo <Joseph.Narlo@amd.com>
Change-Id: I16f5b412f2b9ddefaaa1771aa714cc18829a1be4
2024-11-22 08:55:28 -05:00
Justin Williams d3d6157854 [SWDEV-492047] Removed setup.cfg.in
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I97b14d05b17fefbb87368824f57bc4ab690f1bf0
2024-11-13 12:45:09 -05: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
gabrpham 19cc4718c0 Documented and adjusted APIs for asic info, vram info, and P2P topology
Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: I7ac9a868148e29c92299b21540e057f64cb4123e
2024-11-11 20:45:37 -05:00
gabrpham 4d26db84ca Documented and adjusted python apis for pm metrics and reg table info
* amdsmi_get_gpu_pm_metrics_info and amdsmi_get_gpu_reg_table_info
were added to python api documentation
* AmdSmiRegType added as enum
* amdsmi_get_gpu_reg_table_info reg_type changed to AmdSmiRegType

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: I57239ecf048e82226151db071e8d9299e9182647
2024-11-11 20:45:37 -05:00
Peter Park e196f98dba docs: Remove redundant/stale docs
bump rocm-docs-core to 1.8.2

rm unused files

rm stale docs

fix sphinx conf

reorg docs

SWDEV-482203 -- add note to usage guides

update readmes

Change-Id: I9e0111ac8fe2a691ac964b27436ba47747c27904
Signed-off-by: Peter Park <Peter.Park@amd.com>
2024-11-11 16:49:17 -04:00
gabrpham f5b7761ac7 [SWDEV-490187] reset gpu partition were removed
The reset gpu partition support for both compute and memory were removed

Code changes related to the following:
  * amdsmi_reset_gpu_compute_partition()
  * amdsmi_reset_gpu_memory_partition()
  * CLI

Change-Id: I372589074b4da172bedd39223edde18939e373ae
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-10-18 16:22:26 -05: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
Khader Basha Shaik 8308ede9e8 amdsmi [CPU]: Add implementation to get cpu handles and core handles API
- Update the API names, parameters to return cpu handles and core
handles in the system.
  - Update the amdsmi_wrapper.py.
  - Update the amdsmi_interface.py to use the processor handles and
    core handles API.

Change-Id: Ie24f62f345864f8b6773fdb3c6369993bca7e25b
2024-10-14 05:41:19 -04:00
Charis Poag 5eff39915b [SWDEV-463406] Add volation_status current counter/accumulated values
Changes:
  - amdsmi_violation_status_t now includes current accumulated/counter
   values
  - Tests/wrapper now include added values
  - Removed ASIC references in header for host/bm alignment
  - Fix violation_status->per_hbm_thrm /
    violation_status->active_hbm_thrm
    calculations.

Change-Id: Ic86a7cbad5198a41018f82f6b588b83158d9ba0b
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-10-04 15:56:01 -04:00
gabrpham 4e2fc2d604 Added amd-smi partition as preliminary command.
new command includes following arguments:
  - current - display the current partition information for the selected
    gpu(s)
  - memory - display memory partition information for the selected
    gpu(s)
  - accelerator - display accelerator partition information for the
    selected gpu(s)
additional functionality will be added as more partition APIs are added.

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: Ica86160139002ef5213d6d4b0e390670aeef01c8
2024-09-27 17:05:04 -05:00
Charis Poag 3a4abbd8c0 [SWDEV-422195/SWDEV-440985] GPU metrics 1.6
Changes:
    - Added new GPU metrics:
      1) Violation status' (ex. PVIOL/TVIOL) accumulators
      2) XCP (Graphics Compute Partitions) statistics
      3) pcie other end recovery counter
    - CLI/API/tests changes were made accordingly

Change-Id: I589b9b1f570f25dda12d95bb501feca85da8b3bb
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-09-27 12:04:21 -05:00
Lang Yu 7a557b1c50 SWDEV-463405: Add amdsmi_get_link_topology_nearest support
amdsmi_get_link_topology_nearest() is used to retrieve
the set of GPUs that are nearest to a given device
at a specific interconnectivity level.

Code changes related to the following:
    * API
    * CLI
    * Unit tests
    * Examples

Header Unification Change: "/amdsmi/+/1122408"

Change-Id: Id0317797c652c267742513936d321677793ec634
Signed-off-by: Lang Yu <lang.yu@amd.com>
2024-09-26 16:43:27 -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
gabrpham 8bc4abc88b Corrected partition changes in header and wrapper
Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: Iafd7de8f08924873da841ee6eca62100a17b2b6c
2024-09-20 17:01:55 -05: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
gabrpham c9a489d437 Moved partition_id from static --asic-info to static --partition.
partition_id also removed from the `amdsmi_asic_info_t` struct and
supporting API has been added for querying partition information.

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: Id5a6291a77d11bb97a1c7a200fc465898e86e081
2024-09-20 03:48:42 -04:00
Maisam Arif 3b7f661e71 Moved KFD information to separate structure and API
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: If6eaea589edc704cf408d6391b5f2154134035e7
2024-09-20 03:48:42 -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
gabrpham b7f779182d [SWDEV-448738] Added rocmsmi extremum command as 'set -L'
Change-Id: I997c630bd20cc61673813a2301eb5e3002619a32
Signed-off-by: gabrpham <Gabriel.Pham@amd.com>

Change-Id: Ifa884303f9a0fa058af093a23f5be449bba54f29
2024-09-18 14:51:01 -04:00
Maisam Arif 639daa3d90 Fixed amdsmi_get_utilization_count() wrapper generation
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ifd59fca042c4b3b0fc53e100b6892c6b4f7b3e95
2024-09-17 16:34:42 -04:00
Maisam Arif 105db1afcd Udpated License Dates
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I8ca199c129c06508bc3e23745ab5ac2d20dce928
2024-09-16 16:14:47 -04:00
Broderick Gardner a3b0bc5390 Fix amdsmi_get_clk_freq list size
Python list slice is exclusive for the end index, so this -1 is cutting off an element.

Change-Id: I309a0a41447405b1aac465472871e169f2c405e8
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-09-16 15:45:44 -04:00
Maisam Arif 787d4462fa [SWDEV-482412] Optimized PCIe Bandwidth gpu_metrics calls
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ib37d232b94a080e9b490dd065628d2567aaf4642
2024-09-11 23:26:30 -05:00
Charis Poag a33e4c9e14 [SWDEV-483526] Fix MI3x partitions not showing all logical nodes
Changes:
- Updates to amdsmi_asic_info_t structure to include:
  target_graphics_version, kfd_id, node_id, partition_id
- Updates to amd-smi static --asic to display new
  samdsmi_asic_info_t fields
- Updates to gpu enumeration during amdsmi_init()
  to discover all logical GPUs when in a non-SPX mode
  (ex. DPX, TPX, QPX, or CPX)
 - Updates to amdsmi_get_gpu_bdf_id(..) to include
   partition_id details when in BDF or optional bits.
     - bits [63:32] = domain
     - bits [31:28] or bits [2:0] = partition id
     - bits [27:16] = reserved
     - bits [15:8]  = Bus
     - bits [7:3] = Device
     - bits [2:0] = Function (partition id maybe in bits [2:0]) <-- Fallback for non SPX modes

- C++/Python tests updated to reflect these outputs

Change-Id: I4be0ea35bb98f3109ae2ca9e82f6b21baa38de29
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-09-11 16:35:17 -05:00
Tim Huang 260edaa752 [SWDEV-463402] - Support retrieving connection type and P2P capabilities between two GPUs
1. Add a API interface amdsmi_topo_get_p2p_status to retrieve
connection type and P2P capabilities between 2 GPUs.

2. Add getting p2p status test in hw_topology_read
to print P2P capability information.

3. Add below tables for cli topology sub commands:
  - CACHE COHERANCY TABLE
  - ATOMICS TABLE
  - DMA TABLE
  - BI-DIRECTIONAL TABLE

Change-Id: I199173030d4170115cea27c472958a4826e4e1bf
Signed-off-by: Tim Huang <tim.huang@amd.com>
2024-09-06 09:42:34 -04:00
Maisam Arif 97c487372f Clean up unused files & Update License info
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I5b58e8fe3d9eeac207b07ce0fe4134dd717dbd90
2024-09-05 09:52:48 -04:00
Galantsev, Dmitrii fa4e488111 Remove python-clang dependency
python3-clang was only used to generate the python wrapper
We now use it only within the docker image for the generator

Change-Id: Id574f109b959d72f0734b0df4c26b3bbab3238fd
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-09-04 15:33:28 -05:00
Maisam Arif bc4ca45862 [SWDEV-450553] Added Subsystem Device ID to amd-smi static --asic
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I428b4993cca027a6eb1bb9c617fe715118a59407
2024-09-04 12:51:02 -05:00
gabrpham 7d8e54d0e1 [SWDEV-450553] Added gpu memory overdrive to metric function
Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: If7bd6865d641a5a83c594a4d3c57938b1b6dc18e
2024-09-04 12:54:14 -04:00
Maisam Arif e5569ee925 Fix C Library call in amdsmi_get_gpu_reg_table_info
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ib732ade8c0e48fdc7d09d920bca8b4fe4e773cac
2024-09-04 11:42:45 -05:00
gabrpham 95ca2b83a1 Changed power parameter in amdsmi_get_energy_count() to energy_accumulator
Issue linked here: https://github.com/ROCm/amdsmi/issues/38

Signed-off-by: gabrpham <Gabriel.Pham@amd.com>
Change-Id: I622236eb3f0144aefeb6c82d2713b4822bfeeb11
2024-09-04 09:38:08 -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
Oliveira, Daniel b05849dad0 SWDEV-463401: amdsmi_get_gpu_asic_info() adds num_of_compute_units
number of compute units `amdgpu_gpu_info.num_of_compute_units` is exposed through amdsmi_get_gpu_asic_info().

Code changes related to the following:
  * API
  * CLI
  * Unit tests
  * Examples

Change-Id: Ibeb612d079ed87437a0e56124b8504098fc2dcfd
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-08-28 10:15:07 -04:00
Oliveira, Daniel 893f13ab98 SWDEV-463399: amdsmi_get_gpu_vram_info() adds bit-width
Driver info `amdgpu_gpu_info.vram_bit_width` is exposed through amdsmi_get_gpu_vram_info().

Code changes related to the following:
  * API
  * CLI
  * Unit tests
  * Examples

Change-Id: I8abd8db7a603078b2b1c008b2685cecf35caf3d2
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-08-27 18:22:50 -04:00
Oliveira, Daniel af3670d758 SWDEV-463372: amdsmi_get_utilization_count() adds decoder_activity
GPU Metrics info `gpu_metrics.vcn_activity` is exposed through amdsmi_get_utilization_count().

Code changes related to the following:
  * API
  * CLI
  * Unit tests

Change-Id: I831b2a81bdc0e090a6698dcb689d10f91ed87dd9
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-08-27 16:58:34 -05:00
Maisam Arif 7ac0a49470 Removed extra print statement
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I0043567f4cc17d69860b0c77f42fa77fd41e354d
2024-08-23 19:22:05 -05:00
Charis Poag d7c583d422 [SWDEV-478807] Fix incorrect firmware versions and names
- Fix updates API to have correct enum names (PM->SMU)
 - Python API/CLI now reports correct versions and names for
    SMC/TA_XGMI/TA_RAS

Change-Id: Icbe115b3070b9f252ef15b09b781b9b3f5861e50
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-08-23 18:03:13 -05:00
Charis Poag a2dc934b05 Fix amdsmi_reg_type_t not defined
Latest updates need to use a wrapper defined value. Breaks basic CLI
functionality.

$ /opt/rocm/bin/amd-smi list
Traceback (most recent call last):
  File "/opt/rocm/bin/amd-smi", line 44, in <module>
    from amdsmi_commands import AMDSMICommands
  File "/opt/rocm/libexec/amdsmi_cli/amdsmi_commands.py", line 30, in <module>
    from amdsmi_helpers import AMDSMIHelpers
  File "/opt/rocm/libexec/amdsmi_cli/amdsmi_helpers.py", line 35, in <module>
    from amdsmi_init import *
  File "/opt/rocm/libexec/amdsmi_cli/amdsmi_init.py", line 35, in <module>
    from amdsmi import amdsmi_interface
  File "/usr/local/lib/python3.8/dist-packages/amdsmi/__init__.py", line 26, in <module>
    from .amdsmi_interface import amdsmi_init
  File "/usr/local/lib/python3.8/dist-packages/amdsmi/amdsmi_interface.py", line 1725, in <module>
    reg_type: amdsmi_reg_type_t,
NameError: name 'amdsmi_reg_type_t' is not defined

Change-Id: I628c811c137f57f3177a718c9bce859bc553bf7d
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-08-22 21:57:36 -05:00
Tom St Denis f4506cfd65 Add amdsmi_get_gpu_pm_metrics_info and amdsmi_get_gpu_reg_table_info to py-interface (v3)
v2: drop depend on libc
v3: whitespace

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Change-Id: I2eff7aa9d4f0ca8635796f82b106ac0d36176346
2024-08-21 08:38:14 -04:00
Galantsev, Dmitrii 3784f37a3a Cleanup convert_SI_unit and misc linter warnings
Change-Id: I000ba548b79a7023aabad653125842064fa2e7cb
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-08-02 10:29:06 -04:00
Maisam Arif 8f15c22606 Fix amd-smi event from reading NONE event type
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I7acf91eb682b3f0873ca34a98191eafd3925a344
2024-07-18 17:54:08 -04:00
Maisam Arif 548938389d Bump Version to 24.6.2.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ic389b6783514e88c43958ff5d3413a4c4a8a884f
2024-07-10 19:15:17 -05:00
Maisam Arif 413c9ef6fe SWDEV-466302 - Changed blank processes to N/A & Updated Docs
Change-Id: I2d68430dda8036879f58b0f1dea5d2825b441179
2024-06-24 00:38:17 -04:00
muthusamy 057d688b55 amd-smi [CPU]: Added Support to get number of threads per core
Change-Id: I7e6500f3f53068a3483b64a54d78ac9e1d9cd183
2024-06-21 17:22:55 -04:00
Maisam Arif 92f014059e SWDEV-435197 - Add process table to CLI monitor subcommand
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ibe06f4a4be619ae9cba909c2474b0e482eeb87d5
2024-06-19 23:36:55 -05:00
Maisam Arif a3497702cb Bump Version to 24.6.1.0 and Update Changelog
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I88b8ad1341d7f1a2e14517db82979bb6b28575e8
2024-06-18 23:54:26 -05:00