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

160 Коммитов

Автор SHA1 Сообщение Дата
Williams, Justin 5f56d97d57 [DCSM-524] ESMI version fix
Adjusted ESMI version logic

Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Co-authored-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ie6c480d7175b7bffcce183e9104419e87481aa89
2025-01-30 02:38:20 -06:00
Williams, Justin 21841f44a5 [DCSM-524] ESMI build fix (#72)
Fix amd_hsmp failure to copy new version

Signed-off-by: Justin Williams <Justin.Williams@amd.com>
Co-authored-by: Arif, Maisam <Maisam.Arif@amd.com>
2025-01-29 13:39:19 -06:00
Huang, Tim d32f2a109a Add rust bindings for amdsmi c interface (#14)
It consists of two main steps:

1. Generating Bindings with `bindgen`:
- The `build.rs` script uses `bindgen` to generate Rust FFI (Foreign
Function Interface) bindings for the AMD SMI C library. This step
automatically exports all enums, structs, unions, and unsafe functions
from the C library into Rust. This provides a comprehensive low-level
interface to the AMD SMI library.

2. Implementing Safe Rust Wrappers:
- The generated bindings are then wrapped in safe Rust functions. These
safe wrappers handle error checking, resource management, and provide a
more idiomatic Rust interface. This ensures that users of the library
can interact with the AMD SMI functions without dealing with unsafe code
directly.

Change-Id: I7d5e49e59826164fc911ced04ef7ca5706b7cc05

Signed-off-by: Tim Huang <tim.huang@amd.com>
2025-01-07 17:19:46 -06:00
Maisam Arif 6dcbff866b Bump Version to 24.7.2.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
2024-12-19 17:04:55 -06:00
Justin Williams eb5f64a5e2 Removed Wheel & Setuptools dependency 2024-12-18 15:35:28 -06:00
Maisam Arif aed7749a2c [SWDEV-489060] Added python3-setuptools & python3-wheel for base images
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I222395e656469f67405bc94a86ab7f8fd1ed34a2
2024-12-11 16:40: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
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
Maisam Arif 664ade7354 [SWDEV-502001] Fix link for amd_hsmp.h
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I402ee539cdd4c896acd7ccc83f3090c3a5eeba12
2024-12-02 16:30:06 -06:00
Maisam Arif dfcf5b4ae5 Corrected pyyaml debian package name
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ice1541b4c1fc2297ee8bef5a7c7336c93267e01a
2024-11-14 14:42:50 -06: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 4b511a31e1 Bump Version to 24.7.1.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I0fc42fe55cb653102d189db9aa5eaf723280170e
2024-11-11 19:23:20 -06:00
Maisam Arif a266d602c5 Bump Version to 24.7.0.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: Ife9277f6abf64ed862e11e12a6472c6e6ea4d68f
2024-09-27 18:55:19 -05:00
Galantsev, Dmitrii 88ed9e2f09 CMAKE - Fix version
Change-Id: Ieefdd4c64ae657a53f1f5fd9a7fc94b3d2c899c2
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-09-27 18:34:16 -05:00
Ranjith Ramakrishnan f00a03ed2b Remove package provides field from RPM and DEB package
The provides tag is required when the package provides a virtual package.
Package name along with version will be provided by default and the provides tag is not required for this.

Change-Id: I6d42cd1a6e2247e33708a1fa2627897e86099815
2024-09-26 17:42:49 -04:00
muthusamy 66c98fd722 amdsmi: Adding GO wrappers for amd_smi_exporter
Adding GO wrappers as part of amdsmi library, so that
amd_smi_exporter can fetch the cpu, gpu data directly from amdsmi library.

Signed-off-by: muthusamy <muthusamy.ramalingam@amd.com>
Change-Id: I8fba57c1d20d21758a1aed38ed2c00c9d5c9ecfa
2024-09-20 04:08:27 -04:00
Maisam Arif 6a76f8a705 Bump Version to 24.6.5.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I93d6d397bd8d647f472017c28101dabe9ff8199b
2024-09-20 02:53:45 -05:00
Juan Castillo ac593f9fa0 [SWDEV-482966/ SWDEV-482967] Removing pytest dependency + install path change
Signed-off-by: Juan Castillo <juan.castillo@amd.com>
Change-Id: I7aace93fcad18d67443e6849c10a1fbbc65d0fa8
Signed-off-by: Juan Castillo <juan.castillo@amd.com>
2024-09-18 00:27:00 -04:00
Eisuke Kawashima 1b6ec8df07 chore: unset executable permission
Change-Id: I06727774f3b1657a7955b172a40d0dfc9c76d6b9
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-09-16 17:34:39 -04:00
Maisam Arif 397d8d9339 Bump Version to 24.6.4.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I75b6039c221ecea1e36a451d93bb52b5406bd106
2024-09-11 17:36:07 -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
Maisam Arif 1efb5e9910 Updated cli init functions to not intersect with lib init functions
Added Quick start script to quickly test python APIs
"python3 -i tools/amdsmi_quick_start.py"
Fixed ESMI lib macros

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I55370a0cb79d631f7f2f2b91568f089b503ebfad
2024-09-04 10:23:36 -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
Maisam Arif c934291940 Revert "Do not automatically download kernel header amd_hsmp.h"
This reverts commit f3cb51c08e.

Change-Id: I48ef2a6df69e7b8bc4e66009e6ee2987af8448fc
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
2024-08-19 17:20:20 -05:00
Tom Rix f3cb51c08e Do not automatically download kernel header amd_hsmp.h
First look locally following these heuristics
Either as a user specified option -DBUILD_KERNEL_ASM_DIR=<PATH>
or from the running kernel's src
and then from hints at where it could be.

When these fail, download from the upstream kernel

Change-Id: If8d62a4f84a929f550e4a83cda93e4d671e92d02
Signed-off-by: Tom Rix <Tom.Rix@amd.com>
2024-08-13 15:42:20 -05:00
Maisam Arif 40112f5b17 Bump Version to 24.6.3.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I902da5e5e9e7441002420afaaef01ca9c6c9666f
2024-08-08 01:30:51 -05:00
Ranjith Ramakrishnan 92a4093256 SWDEV-476075 - Prevent the modification of interpreter directives
CPACK is converting /usr/bin/env python3 to /usr/libexec/platform-python in RHEL8.
Undefining __brp_mangle_shebangs will prevent the same

Change-Id: I5120274b90aeaf783b62414ac2aeba9e84029205
2024-08-08 02:04:37 -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 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
Maisam Arif 68d8c1ab46 Bump Version to 24.6.0.0 and Update Changelog for 6.2.0
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I7f20094514cbfa32e40a6e4da36785d94839768c
2024-05-31 03:05:42 -05:00
Maisam Arif 721e3ed3ea Bump Version to 24.5.3.0
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I0d1ecddd650320287446a06cd8ce680c52a89342
2024-05-15 04:28:27 -04:00
Galantsev, Dmitrii 65379b39dd CMAKE - Update to 3.20 due to compilation issues
Change-Id: If06b039a7aa7ba5966ceabaac864fda448b100a0
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-05-02 21:52:10 -04:00
Maisam Arif 051d5a4d42 Bump Version to 24.5.2.0
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I2f51ed93a356e55156983c56bac293a5d7d3b5c1
2024-05-02 02:53:48 -04:00
Maisam Arif 092908daee Bump Version to 24.5.1.0
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I842e223b78f337a39098f652fa6e7ef51948fbaf
2024-04-05 02:31:08 -05:00
Maisam Arif 9800156a7a Bump Version to 24.5.0.0
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I2509c8c2df54f0c5e9376fc0a21c09adc74f0ea8
2024-03-27 01:08:42 -05:00
Galantsev, Dmitrii eef4169a0f SWDEV-449212 - Fix static build
Disable Python interface and CLI tool for static builds (when
-DBUILD_SHARED_LIBS=OFF is passed to cmake)

Change-Id: I32bbd94d70628a50029a748f7493b55c91d45e02
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2024-03-14 13:31:34 -04:00
Deepak Mewar cfb9b5e750 Updated as per latest esmi library changes in github
Change-Id: I949e1f2dcffc223274505764c84f2c6b9a533c98
2024-03-04 11:01:36 -05:00
Maisam Arif 69caba8727 Bump Version to 24.4.0.0 & Corrected argument checks for set subcommand
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I651f8ca652c764f30845503dd869f435f728d5ba
2024-02-23 20:47:19 -06:00
Maisam Arif 61f8888488 24.3.0 Version update
Change-Id: I936c896117ad64d06ea919a8b7bd6ba4cc388592
Signed-off-by: Maisam Arif <maisarif@amd.com>
2024-02-15 17:21:24 -05:00
Maisam Arif c400a22d4d 24.2.0 Version update
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Ied7c24d63ca38c2e5ea5eca6b411e0156f61a403
2024-01-24 11:13:02 -06:00
Maisam Arif c48c989bbc 24.1.0 Version update
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Ibfe92d199b10dc48ece85dfdeda1041f5ea98626
2024-01-24 12:09:48 -05: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
Bill(Shuzhou) Liu ac1ba33371 Add APIs for PM table and register table
Read the PM table and register table as the name value pair.

Change-Id: Ie44fe67a28af3341bd6beb90d809e90f280351ac
2023-11-20 12:31:18 -05:00
Maisam Arif 695d4ee065 Correct pyyaml package dependency
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: Iea055d6af87b465060b0ca8c95f855d101143241
2023-11-09 16:16:44 -06: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 1010787865 CMake - Bump version
Change-Id: Idc3c07b5f37309d03b46df7a6400793bc8953f61
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-11-03 03:57:35 -04:00
Galantsev, Dmitrii 513dd8a445 Merge rocmsmi/amd-staging into amd-dev 20231103
Change-Id: Ie70ab54a63b25649b6b9d30620c5546dc66cd766
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-11-03 02:55:02 -05: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
Charis Poag 57b6135e54 Partition EBUSY with RSMI_STATUS_BUSY & invalid GPU Metrics check
* Updates:
   - [API/CLI] rsmi_dev_*_partition_set &
     rsmi_dev_*_partition_reset - exposed RSMI_STATUS_BUSY for
     EBUSY writes + cleaned up accidental map insertions
     (maplookup[] can insert values that are not in the map,
     map.at(key) fixes this potential issue)
   - [API] rsmi_dev_gpu_metrics_info_get() - returns
     RSMI_STATUS_NOT_SUPPORTED for unsupported metric tables
     outside of 1v1/1v2/1v3
   - [API] writeDevInfoStr() - exposes RSMI_STATUS_BUSY for
     EBUSY write errors; kept backward compatibility
     for other writes which do not care about these states
   - [API] rsmi_dev_od_volt_info_get()
      & rsmi_dev_od_volt_curve_regions_get() have better logging
     + Expose more details on why they are erroring
   - [Utils/logs/example] Expose AMD GPU gfx target version to aid in
     system troubleshooting
   - [Utils] Added test methods that look at od volt
     freq & regions into here - for easier access across
     several tests
   - [Utils] Updated getRSMIStatusString(new argument - fullstatus;
     default to true for backwards compatibility)
     -> true shows shortened RSMI STATUS response
   - [Utils] Added splitString to cut out noisy return responses
     (used in getRSMIStatusString(), when fullstatus = true)
   - [Utils] Added getFileCreationDate() to expose build date
     of the library - helpful for local builds or experimental builds
   - [Utils] Macro cleanup
   - [Example] Added a few gpu_metric checks - helpful for upcoming
     updates
   - [Device] SYSFS/DebugFS - now have better r/w displayed in logs
   - [LOGS] Expose library build date - see above for details
   - [Tests] Add more warnings/errors to test builds
   - [Tests] Moved up Partition tests for ordered test runs - helped
     identify issues with GPU BUSY writes
   - [Tests] compute_partition_read_write - handles RSMI_STATUS_BUSY
     with waits for busy status found & cleaned up how we checked
     for partition changes - with RSMI responses exposed more clearly
   - [Tests] perf_determinism - multi gpu now properly runs through
     with full resets as needed
   - [Tests] volt_freq_curv_read - better error handling with more
     verbose output

Change-Id: Ie94c6abb6a9aab95c345996d3ad3843cf6734977
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
2023-10-27 14:52:02 -04:00
Galantsev, Dmitrii 336ef57ed8 CMake - Configure __version__ for python scripts
Change-Id: I646dc27b5dc93e8dde38ff09ae9c826dfc7faaa7
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
2023-10-25 18:03:18 -05:00