Graphe des révisions

429 Révisions

Auteur SHA1 Message Date
Dalibor Stanisavljevic dd0eab575b SWDEV-361376 - Updated python API
Added pcie, power and memory API

Change-Id: I0b3bd1c110099805c700f53974eceb6acd850930
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: 21d6e0f990]
2022-11-14 12:55:30 +01:00
Dalibor Stanisavljevic 9164042117 SWDEV-361376 - Updated python API
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
Change-Id: I8d81154b27111b849dbb645e024ebf322299f851


[ROCm/amdsmi commit: 50133d44c2]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic 3c4a0e6529 SWDEV-361376 - Added additional API calls to the python interface
- Added APIs for "Error Query"
- Added APIs for "System Information Query"

Change-Id: Idd0e8595c37b23025545f54428b824bf41544bb9
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: cec429dbeb]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic 018437360d SWDEV-361376 - Added additional API calls to the python interface
- Added performance counter API calls
- Added part of unsupported functions in virtual env API calls
- README for both additions

Change-Id: I6fdf1fe83370975011fe4ec11c0b0ca2bab0a1b8
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: f9f792230e]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic e09dc2fd47 SWDEV-361376 - Added API calls to the python interface
- Added Physical State Query API calls
- Added Clock, Power and Performance Query API calls
- README for both additions

Change-Id: Icf412364a13c9e51b9630f19f29a7cdfbe46f7fe
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: 62a69fb802]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic a16b55507d SWDEV-361376 - Add README for python tool
- Add up to date README file for python tool

Change-Id: I7a02f79469e990870398b3741b033ea447998fdd
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: 9cad9e5216]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic b155d429c9 SWDEV-361376 - Add events to python interface
- Implement context manager event class for easier usage instead of having 4 different
  APIs.
- Add support for with statement for easier cleanup.

Change-Id: I396947a93d3f04efc068e17804eab12eefa97cf0
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: 23160fa8e0]
2022-11-10 16:57:49 +01:00
Dalibor Stanisavljevic 35196b25bd SWDEV-361376 - Added additional API calls to the python interface
- Added APIs for "Supported Function Checks"
- Added first half of the APIs for "Unsupported Functions In Virtual Environment"

Change-Id: Ia83303e6b7ae65aada608bd9ca5f56fd33e4ef34
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: a6efdd32ed]
2022-11-10 16:57:49 +01:00
Bill(Shuzhou) Liu 2d0fb9744a 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


[ROCm/amdsmi commit: b34b7451e8]
2022-11-07 11:09:09 -06:00
Bill(Shuzhou) Liu 17fa3924d6 Fix the unit tests
Fix a few broken unit tests to handle NOT_YET_IMPLEMENTED errors.

Change-Id: If3afac0dc32f2e3e82d83bffa5906b630bb1894a


[ROCm/amdsmi commit: c8caa80405]
2022-11-04 08:53:09 -05:00
Galantsev, Dmitrii f1125780dd Cleanup tests
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: 7957b63dd4]
2022-11-03 13:30:16 -05:00
Galantsev, Dmitrii 4fede3797c Cleanup CMakeLists.txt for packaging
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: c99e4e1501]
2022-11-03 12:44:23 -05:00
Bill(Shuzhou) Liu 1ae77d9ac0 The device name and vbios version is incorrect
Get the device name from rocm-smi which is not displayed properly
in some cards. Set the vibos version using the rocm-smi.

Change-Id: I138f1760cde94007cb93cad02c6d8cccbb4afa28


[ROCm/amdsmi commit: 9a92ea833f]
2022-10-28 13:03:18 -05:00
Bill(Shuzhou) Liu 33f7fba549 Fix unit test compile error
Update the unit test as header enum type name is changed.

Change-Id: Ie965462da7d46259883650b15644003cf936982a


[ROCm/amdsmi commit: a25c71b730]
2022-10-20 09:54:11 -05:00
Bill(Shuzhou) Liu d944c4e11b Update the document
The README.md is updated for amdsmi

Change-Id: Ic027476d9f6b62e8972793e78db28b12644036ea


[ROCm/amdsmi commit: 93bc47a5c3]
2022-10-20 09:25:02 -05:00
Dejan Andjelkovic 14d9160565 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>


[ROCm/amdsmi commit: 6064f160a3]
2022-10-20 09:24:53 -05:00
Bill(Shuzhou) Liu c68caedcbd Use doxygen to generate amdsmi API document
Change the CMake to generate the API document using doxygen.

Change-Id: I5c2fa661a66ac007f742bfbc15bdfd8d0098285d


[ROCm/amdsmi commit: 4a9bb197b2]
2022-10-20 09:24:41 -05:00
Bill(Shuzhou) Liu b546e272e0 Change the get_socket_handles and get_device_handles APIs interface
Those two APIs are changed to let the user get the handles count,
allocate memory, and then return handles to the allocated memory.

Change-Id: Ibe28a89ad188c99da6af3af1740b2b25ff22ba06


[ROCm/amdsmi commit: 2b2d11c446]
2022-10-20 09:24:31 -05:00
Dalibor Stanisavljevic bd4ff14bd0 SWDEV-353742 - Port smilib function to amdsmi
Change-Id: I99df249755a5c665a8dd1777fa82d046e139bd77
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>


[ROCm/amdsmi commit: 3daf9c1063]
2022-10-20 09:24:22 -05:00
Bill(Shuzhou) Liu cf09c187f1 Fix the compile error
The rocm_smi64Config.h is not generated which break the build.

Change-Id: I9ea43b53a20bf00a2338f96a6f49d630c60962d1


[ROCm/amdsmi commit: 7fa3b36d7f]
2022-10-20 09:24:11 -05:00
Bill(Shuzhou) Liu d83e3a8b6e 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


[ROCm/amdsmi commit: 0c91ef919d]
2022-10-20 09:23:51 -05:00
Bill(Shuzhou) Liu 0b624c50d2 Support rocm-smi related device information
A few fields are added to board_info and asic_info for rocm-smi
device information.

Implement rocm-smi related fw block in amdsmi_get_fw_info().

Change-Id: I825d3e5c7feaa07a6e05386d4f1a59ebf528dfc0


[ROCm/amdsmi commit: 1ec3a2182e]
2022-10-20 09:23:41 -05:00
Bill(Shuzhou) Liu bfa976cf08 Port rocm-smi function to amd-smi
Port most rocm-smi function to amd-smi and add unit tests.

Change-Id: I6387a4bdaf20ead2389c99bb01d438156ccd0747


[ROCm/amdsmi commit: f1d02aca79]
2022-09-06 12:08:59 -04:00
Bill(Shuzhou) Liu 236e4e2d3e Port more rocm-smi function to amd-smi
The API support function, performance counter, process information,
topology and xgmi info.

Change-Id: I3350ec75fdd2ca1438e79134582ae83c49763056


[ROCm/amdsmi commit: 86017b799c]
2022-08-24 12:49:27 -05:00
Bill(Shuzhou) Liu 39c1c4334e Support events in the amdsmi
Port the events handling from rocm-smi to amd-smi

Change-Id: I0b4cb30a585cb2188a24be0e21c1c156b461bb1d


[ROCm/amdsmi commit: 7b92c694a0]
2022-08-23 16:49:56 -04:00
Bill(Shuzhou) Liu 06a481c563 Add unit test support
Add gtest based unit test framework. Implement fan read/write function.

Change-Id: I83375c24b99d24d01d12bccda863a38f75f5987f


[ROCm/amdsmi commit: 98df483bef]
2022-08-05 09:55:34 -04:00
Alexsandar Nedeljkovic f79d7838f4 Update amdsmi header to include GpuvSMI related APIs and definitions
Signed-off-by: Alexsandar Nedeljkovic <alexsandar.nedeljkovic@amd.com>
Change-Id: Iff46d724f35b52028b67ce272f800fcf820c96ac


[ROCm/amdsmi commit: 61289339d8]
2022-07-22 16:06:20 +02:00
Bill(Shuzhou) Liu f7e5bb73d0 Load libdrm at run time
Remove the compile time dependency on libdrm. Load it at the run
time instead.

Add the headers missed from smi-lib

Change-Id: Ie1ecf293b51425b6a61c502d11a42809dc099f70


[ROCm/amdsmi commit: 5ba371f285]
2022-06-28 14:48:59 -04:00
Bill(Shuzhou) Liu 325173a20d The init version of amd_smi
The init version includes the amd_smi.h header, an example uses the
amd_smi, folder structure and CMake files.

Add the support to libdrm.

Change-Id: I779e55e4cf9491c61dc226a30d24e96be9bc6016


[ROCm/amdsmi commit: 91ad08aa65]
2022-06-14 09:14:24 -04:00
Elena Sakhnovitch ccf3ac2b15 [rocm_smi.py]: shownodesbw fix for non xgmi
Improve error output for non-xgmi nodes bandwidth

signed-off-by: Elena Sakhnovitch
Change-Id: I833970d3200a75c7639d33bf19e0e83afe176c8d


[ROCm/amdsmi commit: 44ea49eb01]
2022-05-24 16:45:32 -04:00
Ori Messinger 23b3bcc038 ROCm SMI CLI: Fix --showvoltagerange bug
This patch fixes a --showvoltagerange bug, which attempts to check
the voltage curve on a device that does not have any voltage
regions in its OverDrive voltage frequency data (odvf).

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


[ROCm/amdsmi commit: 786f66671a]
2022-05-21 05:02:15 -04:00
Ori Messinger cf61df76ad ROCm SMI CLI: Fix setPowerOverdrive restPowerOverdrive Bugs
Fixes bug in the 'setPowerOverdrive' function which mishandles
GPUs with secondary dies. Secondary dies have a default power cap
of 0W and cannot be changed, so they are now skipped.

Fixes bug in the 'resetPowerOverdrive' function which incorrectly
resets the wattage to the current value.

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


[ROCm/amdsmi commit: 4298cbb400]
2022-05-21 05:01:32 -04:00
Divya Shikre 92657b2380 Fix mem leaks observed while running rsmitst
1.  Memory allocated for handle was not deleted
when no variant, subvariant or supported function
was found
2. handle->func_id_iter address was set to 0
before delete[]

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


[ROCm/amdsmi commit: b23cfc0e82]
2022-05-18 14:31:44 -04:00
Divya Shikre f4e33b90c9 Update get_frequencies to handle failures.
Show an optional debug log (RSMI_DEBUG_BITFIELD=2) to
the user in the following scenarios:
1. If more than one current frequency is found
2. If frequencies are not read in increasing order of
   their value
If current frequency is not available, index for it is
set to -1, values will not have * next to it in the
output. This will also be handled in rocm_smi.py.

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


[ROCm/amdsmi commit: afe996c2ed]
2022-05-11 15:33:15 -04:00
Divya Shikre 3cbd1652de Add DEBUG_LOG macro
Add DEBUG_LOG that will optionally print error
message when RSMI_DEBUG_BITFIELD is set to 2.

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


[ROCm/amdsmi commit: 99be3451d7]
2022-05-11 11:03:24 -04:00
Divya Shikre 8504d79dfa Add RSMI_CLK_TYPE_PCIE to rsmi_clk_type_t
showclocks/showclkfrq does not display pp_dpm_pcie values
in sriov. This fix adds pcie clocks to rsmi_clk_type_t
where rest of the clocks are present.

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


[ROCm/amdsmi commit: c9b42bff57]
2022-05-06 09:15:39 -04:00
Ori Messinger 821ffaa5b9 ROCm SMI LIB: Add Missing GPU Blocks
This patch adds the following 4 missing GPU blocks to the SMI LIB:
-RSMI_GPU_BLOCK_MMHUB
-RSMI_GPU_BLOCK_PCIE_BIF
-RSMI_GPU_BLOCK_HDP
-RSMI_GPU_BLOCK_XGMI_WAFL

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


[ROCm/amdsmi commit: 9d6403bb17]
2022-05-05 00:44:16 -04:00
Elena Sakhnovitch 65841a8fd0 Revert "rocm_smi.py: Don't try to print absent clock files"
This reverts commit 4de1e4094a.
DRM device id  does not always match GPU ID in the rocm_smi.py. This leads to cases where wrong device is checked by os.path.isfile().

Change-Id: Ib6f2b9be123b7eb64334d3feec57f63d7eb37d6f


[ROCm/amdsmi commit: be66d67ef2]
2022-05-03 16:42:42 -04:00
Elena Sakhnovitch 67d69e127e [rocm_smi.py] Hide unsupported clocks under debug
Signed-off-by: Elena Sakhnovitch <elena.sakhnovitch@amd.com>
Change-Id: I1f2c7b93d9a81f2735c76e8d441f9e298288f5c0


[ROCm/amdsmi commit: 9d7fd34d2b]
2022-05-03 16:38:22 -04:00
Bill(Shuzhou) Liu 9bf38c36a3 Sanity check amdgpu module is loaded in rocm_smi.py
Instead of check /proc/modules for amdgpu, the code will check
/sys/module/amdgpu/initstate which covers the case when the driver
is compiled into the kernel.

Change-Id: Id39ec5b0eb9b68204bc9f5f779057ba8cc090bdc


[ROCm/amdsmi commit: 9f6614e83b]
2022-04-14 11:28:38 -04:00
Bill(Shuzhou) Liu 538dc09a8b Suppress "rsmi_init() failed" error message
When an application call the library in a system without amdgpu,
it may always print out "rsmi_init() failed". Suppress the error
message in the library.

Change-Id: Ice63dd3a764b221a6935536bff1bfa6aa3e51a46


[ROCm/amdsmi commit: 7860de5107]
2022-04-12 09:44:00 -04:00
Ori Messinger a21208fc4e ROCm SMI CLI: Fix formatCsv Bug
Fixes a bug in the 'formatCsv' function which mishandles json
data conversion for 'system' data types.

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


[ROCm/amdsmi commit: e800cbf161]
2022-04-07 19:33:46 -04:00
Bill(Shuzhou) Liu 4884de63fd Correct the __pycache__ folder
Remove the __pycache__ in the folder libexec/rocm_smi

Change-Id: I0ad505ff7e7368d5fe86e1eee12080039edc7111


[ROCm/amdsmi commit: 9f814e150e]
2022-03-24 09:44:33 -04:00
Bill(Shuzhou) Liu ee67414d43 Remove python pyc file when uninstall
Remove python pyc file when uninstall.

Change-Id: I383faf8fcfaeeb346c9ee38c1aad8577a460281e


[ROCm/amdsmi commit: c37d4bac8f]
2022-03-23 13:39:57 -04:00
Ranjith Ramakrishnan a2586d1044 Remove rocm_smi/bin folder and prefix name correction in pragma message
/opt/rocm/rocm_smi/bin folder was added by mistake as part of file reorg and removed the same.
File reorg commit :2a0ecb1e5689bfe5851bf91039b72df580fec372
Pragma message for oam header files was showing prefix as rocm_smi, Changed the same to oam

Change-Id: I74b3c1d2bd7e0ff0eee5738c1658063bc855066c


[ROCm/amdsmi commit: 869670866d]
2022-03-17 18:16:10 -07:00
Kent Russell da9b4c606e README: Remove restrictive licensing language
Also update copyright years

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


[ROCm/amdsmi commit: 85571318e2]
2022-03-16 13:52:25 -04:00
Sreekant Somasekharan 5bc962bf3d make string variable 'tpath' an empty string.
string variable not being empty can lead to incorrect compilation
and corrupted output.

Change-Id: Ie66756c28aef7417759c29387500970a8b53e44c


[ROCm/amdsmi commit: dbe3403bd3]
2022-03-11 21:22:28 -05:00
Bill(Shuzhou) Liu 26df407089 Upgrade GoogleTest to v1.11.0
The old GoogleTest has compile errors on Centos 9. Upgrade it
to latest version.

Change-Id: I6bbe6afdfad6422a210f258880ddc87a9f088d76


[ROCm/amdsmi commit: 8ce9289bc2]
2022-03-09 15:18:43 -05:00
Sreekant Somasekharan b3ba591ee6 Add blacklist filter 'virtualization' for rsmi tests failing in SRIOV
Change-Id: Ibbaef092482c0b78ecd86a29f0b9b4331b51abe2


[ROCm/amdsmi commit: e6ae697e9c]
2022-03-04 22:13:44 -05:00
Elena Sakhnovitch 26ef2abe05 [rocm_smi.py] resetPowerOverdrive fix
resetPowerOverdrive: improve output messages.

Signed-off-by: Elena Sakhnovitch
Change-Id: Ic5b9084f0637458c36e460231f2d3622b0a23aa6


[ROCm/amdsmi commit: a3317714cb]
2022-03-04 11:26:45 -05:00