Commit Graph

49 Commits

Author SHA1 Message Date
Yuan, Perry 68e44c7f66 [SWDEV-482949] Add CPU model name querying support (#33)
- Add support to check CPU vendor info which will be called by RDC to
discovery CPU information
- Move esmi headers declaration to impl/amd_smi_common.h
- remove duplicated amdsmi_cpu_util_t

---------

Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Deepak Mewar <deepak.mewar@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Co-authored-by: Deepak Mewar <deepak.mewar@amd.com>
2025-03-28 21:21:39 -05:00
Poag, Charis 48cb5529d2 [SWDEV-493274/SWDEV-514998] Add AMD SMI partition tests + Add Guest amd-smi static --partition (#127)
* [SWDEV-493274/SWDEV-514998] Add AMD SMI partition tests + Add Guest amd-smi static --partition

Changes:
    - Added amd-smi static --partition for guest systems
    - Added C++ tests for memory and compute (accelerator) partitions
    - Added Python tests for amdsmi_get_gpu_vram_info(),
       amdsmi_get_gpu_accelerator_partition_profile_config()
    - Updated Python tests for
      amdsmi_get_gpu_accelerator_partition_profile()
      Now includes more profile and resource detail
    - Added amdsmi_get_gpu_xcd_counter();
      Tests provided for both C++/Python APIs
    - Added AmdSmiVramType & AmdSmiVramVendor: they were missing
      python testing required adding.

Change-Id: Ib6549d8ccc5fb68726f38745b87c78f890186022
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2025-03-11 16:38:46 -05:00
AL Musaffar, Yazen 2936e00fed [SWDEV-453922] AMD SMI to provide mapping feature of other enumeration methods (#51)
Added enumeration mapping for 
- drm render
- drm card
- hsa id 
- hip id
- hip uuid (rocminfo uuid)

Signed-off-by: AL Musaffar, Yazen <Yazen.ALMusaffar@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Co-authored-by: Maisam Arif <Maisam.Arif@amd.com>
2025-03-07 09:09:12 -06:00
Pham, Gabriel 0f79efac78 [SWDEV-462952] Options enabled for GPU passthrough scenarios
Added Dynamic Passthrough detection

Signed-off-by: Pham, Gabriel <Gabriel.Pham@amd.com>
Signed-off-by: Arif, Maisam <Maisam.Arif@amd.com>
Co-authored-by: Arif, Maisam <Maisam.Arif@amd.com>
2025-01-30 18:12:03 -06:00
Ramalingam, Muthusamy ced110dbb6 amdsmi: Adding Support to get hsmp Driver version
* amdsmi: Adding Support to get hsmp Driver version

Adding Support to fetch hsmp driver version from ESmi Interfaces.
Adding Support to fetch memory bandwidth per socket.

Signed-off-by: muthusamy <muthusamy.ramalingam@amd.com>
2025-01-29 13:45:02 -06:00
Meng, Li (Jassmine) dc400d916e [SWDEV-230863] add two new interfaces for background health check (#4)
1. Get the bad pages threshold of a processor.
2. Verify the checksum of RAS EEPROM

Signed-off-by: Meng Li <li.meng@amd.com>
2025-01-07 17:26:55 -06:00
Maisam Arif 338cdd63ce [SWDEV-481702] Update marketing name source
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
2024-12-19 18:32:51 -06:00
Justin Williams 2c24cab86c [SWDEV-502001] Added amd_hsmp.h locally
Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Change-Id: I28e48913743f86fb5fc9082307ec326830d55960
2024-12-05 17:02:48 -05:00
Charis Poag 7d061f9ae4 [SWDEV-499029] Fix unable to change memory partition modes
Changes:
  * [API] Removed checking board name, fixes for other MI ASICs
  * [API] Fixed unable to restart AMD GPU, libdrm blocked
    doing this operation
  * [API] Added ability to unload/reload libdrm
    from within AMD SMI APIs
  * [CLI] Increased progress bar to change memory partition modes
    to 140 seconds, since driver reload is variable per system

Change-Id: I52f227f2ab850c4a6332ff3ecdc899903b1080f1
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2024-11-25 09:28:02 -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
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
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
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
Dalibor Stanisavljevic 458dc8f180 SWDEV-457337 - Header aligment
Missing AMDSMI_STATUS prefix

Change-Id: I15d050a146c92f6897d48317d8fec51d046535d1
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2024-05-30 15:35:38 -04:00
Dalibor Stanisavljevic 7b2463abe0 SWDEV-457337 - Fix header alignment
Change-Id: I9f25f6c4f0d00c76b66d13162f30be11368f5b59
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2024-05-23 04:41:57 -04:00
Oliveira, Daniel 08e2e21bab fix: [SWDEV-442525] [rocm/amd_smi_lib]
Fixes gpu_process_list

Code changes related to the following:
  * amdsmi_get_gpu_process_list()
  * CLI
  * Examples
  * Unit tests
  * Changelog
  * Readme
  * rocm_smi_lib commit: 677433b367

Change-Id: I9210fbca7a5da92d0a8b472b72ca82597c8e4fb5
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-03-27 16:48:24 -05:00
Oliveira, Daniel 1310c767ce fix: [SWDEV-448201] [rocm/amd_smi_lib]
Adds Add PCIE Errors

Code changes related to the following:
  * amdsmi_get_pcie_info()
  * CLI
  * examples

Change-Id: Ie0b7053e77c88fb18309c16e74bce75d862c45a9
Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
2024-03-24 23:33:32 -04:00
Deepak Mewar 6f7273fda5 Added amdsmi cpu family & cpu model
- Updated header and source files
- Updated python interface
- Generated python wrapper for updated header
- Updated the CLI to have cpu family & cpu model
  as part of metric table

Change-Id: Iea440251797270d5d29ffe883b0ad6db790be658
2024-02-06 18:46:27 -05:00
Bill(Shuzhou) Liu 5a6b5d2a0a Use the same mutex as rocm-smi
Share the same mutex as rocm-smi implementation. Handle the crash
when a user is not in render group.

Change-Id: I486b26569f9b523b41bbdaf95d51f4a730978cfd
2024-01-15 13:12:49 -05:00
Naveen Krishna Chatradhi 65eed73f4d amd-smi: fix cpu specific apis and header
1. provide prototype and documentation for esmi specific api.
   define structures and update classes as required
2. update cmake files as required and add esmi api to the
   amdsmi esmi integration example.

Change-Id: I753ec176f9b381e74c9646525dfd9075237bf8d9
2023-12-18 06:28:15 -05:00
Charis Poag 8f3861e1d9 Add vcn and jpeg activity
Changes:
    - Add new engine field vcn_activity (from 1.4/1.5
      gpu_metrics
    - Updated log output to enhance view of gpu_metric
      data as json pretty print
    - Added new fields provided in 1.5
    - Added unit overview in python API, CLI is WIP

Signed-off-by: Charis Poag <Charis.Poag@amd.com>
Change-Id: I7d9f29e7ecc35dcd0697814c222cdd02b0d5518e
2023-12-15 22:18:46 -05:00
Bill(Shuzhou) Liu de7e74f7db Collect compute partition devices under the same socket
The socket represents a physical device, and the partition devices
should belong to the socket. The partition devices are only
different in function id in BDF. Use the BD part of the BDF to
identify a socket.

Change-Id: I5d355a6f5db02faa7555b760a36c7351b8d8d835
2023-11-29 08:23:23 -06:00
Maisam Arif d790ebc62b Refactor gpu_metrics usage in libraries
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I763638d4b546bf49b234e823df81028c357e8f49
2023-11-22 03:32:15 -06:00
Deepak Mewar 0c790752ac modified local esmi functions called from amdsmi_init
for gtest compatibility

Change-Id: I627c9887a1f1e340c358f060818a1a7d74ce33f9
2023-11-10 15:50:42 -05:00
Maisam Arif 5dba2f3120 Updated License Dates
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Id6fd66b03c602232ecc1a063a534a15fe3a03f56
2023-11-07 03:57:08 -05:00
Deepak Mewar 28f6383639 Esmi Auxillary API wrappers removed from amdsmi library
that are called during amdsmi inititalization
    amdsmi_get_cpu_family,
    amdsmi_get_cpu_model,
    amdsmi_get_cpu_threads_per_core,
    amdsmi_get_number_of_cpu_cores,
    amdsmi_get_number_of_cpu_sockets

Added amdsmi_get_cpucore_info to amdsmi library

Change-Id: Ib88d580e1d85afdf578963247e585cfae05c58ad
2023-10-30 20:59:21 -04:00
Maisam Arif 572bf563d1 Added driver_name to amdsmi_cli tool
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I8f3d52e0b23298443b2b16afec418cbbbc5f77e0
2023-10-04 08:54:19 -04:00
Maisam Arif 95337c88fc Added sleep state to amd-smi metric --clock
Change-Id: Idb5fbc84a787ef1affdf0449b6dd77ab6e50e91d
Signed-off-by: Maisam Arif <maisarif@amd.com>
2023-09-26 15:21:25 -05:00
Maisam Arif e4fac177c1 SWDEV-417124 - Implement Power Management
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Ib0d37038e49cec61d5415076a46a5666d95dcea2
2023-09-21 14:23:26 -05:00
Deepak Mewar 8a9771b225 esmi library integration update v1.0
1. new class files for cpu socket and cpu core created
2. wrapper API's for getting energy monitoring, system
   statistics, power monitoring values implemented
3. modified amdsmi init & cleanup functions for esmi lib support
4. modified amdsmi system class for esmi lib support
5. sample test code created in example dir

Change-Id: Ic41f31641c283a681de696bb4346b557265bad42
2023-07-27 17:29:27 -05:00
Bill(Shuzhou) Liu 55bf9cbe13 Change API to get the driver date
Support the driver date from libdrm.

Change-Id: I88e694732b538220e11fdb4029712bb5a6f44380
2023-07-21 08:28:06 -05:00
Bill(Shuzhou) Liu 8f26e881fb SWDEV-405668 - BDF difference between amdsmi and rocmsmi
The render node discovery is changed to match rocm-smi index.

Change-Id: I707d0844b377304f4e8fc15035902c707805c2dc
2023-06-16 17:06:00 -04:00
Suma Hegde a8acfbf8ff Renamed amd_smi_device.h to amd_smi_processor.h
Change-Id: I9f3cd8b29e4b5e9e552faeb7e977d7a1002abd65
2023-05-11 11:01:14 -04:00
Suma Hegde 6e6176b04a Change variable name from device to processor
device_count to processor_count
devices to processor
device to processor
also handle_to_device is renamed to handle_to_processor

Change-Id: Ie9c7e01bc1b83058eeaae80934526d06468f4f5c
2023-05-11 10:29:35 -04:00
Suma Hegde ae39d9707d Change device to processor in API names and variable names
Change-Id: Ide71fabeaa837f2035dc9726162cc537e40b4a57
2023-05-11 10:29:01 -04:00
Suma Hegde dd00a16124 Change device_type to processor_type
also rename amdsmi_get_device_type to amdsmi_get_processor_type

grep -rli 'device_type' * | xargs -i@ sed -i
's/device_type/processor_type/g' @

Change-Id: Ic6a73c1a170757d5ab5d10ad20b4fc2f0b280e78
2023-05-11 10:28:31 -04:00
Suma Hegde 3f9e4d95d4 Change device_handle to processor_handle
grep -rli 'device_handle' * | xargs -i@ sed -i
's/device_handle/processor_handle/g' @

Change-Id: Ifc8b7fa3b5488ce1fa8d8cf9eb3981a09450de11
2023-05-11 10:11:24 -04:00
Suma Hegde 3963036a05 Change amdsmi_device_handle to amdsmi_processor_handle
grep -rli 'amdsmi_device_handle' * | xargs -i@ sed -i
's/amdsmi_device_handle/amdsmi_processor_handle/g' @

Change-Id: Ie25c51933dcc31e5b34c8070d0d5ba0e8cd05cc1
2023-05-11 10:09:11 -04:00
Suma Hegde c4aa7d2c03 Change AMDSmiDevice to AMDSmiProcessor
grep -rli 'AMDSmiDevice' * | xargs -i@ sed -i 's/AMDSmiDevice/AMDSmiProcessor/g' @

Change-Id: Ib71e11d7122699cc62df3c4e9711ce3fc51e6fdf
2023-05-11 10:08:40 -04:00
Marko Oblak d1325fcf40 SWDEV-379772 - [Navi32] [SMI-LIB] [Linux] [BM] [Guest] Wrong market name
Signed-off-by: Marko Oblak <Marko.Oblak@amd.com>
Change-Id: I12d3e650851a3aa474ccbf62628b60d4c385e68c
2023-03-06 17:08:33 +01:00
Marko Oblak 8429df989c SWDEV-371210 - [AMDSMI][LinuxBM] SMILIB returns wrong pcie speed value
Signed-off-by: Marko Oblak <Marko.Oblak@amd.com>
Change-Id: Ie3ca6997f11d18505df799fef9cd9d53716d53f9
2023-02-28 11:49:20 +01:00
Dalibor Stanisavljevic 943c42f58f SWDEV-374716 - Fixed asic info
Change-Id: I8d806ef09eca4300fcec0ce6a226d13547dfb728
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2023-01-11 11:03:17 -05:00
Dalibor Stanisavljevic 4c56e9e3d6 SWDEV-371199 - Return NOT_INIT when amdsmi initialization fails
Change-Id: Ifb40aef3a62885b08164e9aa944bf9b5c375ebfd
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2022-12-19 16:29:29 +01:00
Dalibor Stanisavljevic b4b761d02f SWDEV-370223 - Change the name of the header to amdsmi.h
Change dev to device_handle throughout the file
Change the pcie_info pcie_speed field type to uint32_t
Add AMDSMI prefix before amdsmi_mm_ip enum

Change-Id: I242145389ddc3f2ad05dfd6ca371640f4d118fc4
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2022-12-08 13:34:34 +01:00
Bill(Shuzhou) Liu b34b7451e8 Init the amdsmi using rocm_smi for libdrm
Init the ams_smi using the rocm-smi, which makes the GPU discovery
consistent with or without libdrm.

Change-Id: Ic714781f8ce791451b0c057621525926edb7f5ee
2022-11-07 11:09:09 -06:00
Galantsev, Dmitrii c99e4e1501 Cleanup CMakeLists.txt for packaging
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2022-11-03 12:44:23 -05:00
Dejan Andjelkovic 6064f160a3 SWDEV-361376 - Add python wrapper
- Add generator for python wrapper
- Add interface, exception and init files
- Add CMake custom targets

Change-Id: I63c1d94fbb587387c22f559a3db79987eb214a2e
Signed-off-by: Dejan Andjelkovic <Dejan.Andjelkovic@amd.com>
2022-10-20 09:24:53 -05:00
Dalibor Stanisavljevic 3daf9c1063 SWDEV-353742 - Port smilib function to amdsmi
Change-Id: I99df249755a5c665a8dd1777fa82d046e139bd77
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
2022-10-20 09:24:22 -05:00
Bill(Shuzhou) Liu 0c91ef919d Restructure the folder
Move rocm_smi related function to rocm_smi folder. Move amd_smi to
top level include/ and src/ folder. Remove obsolte oam folder.
Change the CMakeLists.txt to update folder locations.

Change-Id: I52e6be739e49f3b0545865f25364787f5985e9c3
2022-10-20 09:23:51 -05:00