Merge amd-dev into amd-master 20230529
Change-Id: I2ace47d1151e30358098f5b1704395b2fab43e49 Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Tá an tiomantas seo le fáil i:
+16
-19
@@ -93,37 +93,37 @@ A simple "Hello World" type program that displays the temperature of detected de
|
||||
|
||||
int main() {
|
||||
amdsmi_status_t ret;
|
||||
|
||||
|
||||
// Init amdsmi for sockets and devices. Here we are only interested in AMD_GPUS.
|
||||
ret = amdsmi_init(AMD_SMI_INIT_AMD_GPUS);
|
||||
|
||||
|
||||
// Get the socket count available in the system.
|
||||
ret = amdsmi_get_socket_handles(&socket_count, nullptr);
|
||||
|
||||
|
||||
// Allocate the memory for the sockets
|
||||
std::vector<amdsmi_socket_handle> sockets(socket_count);
|
||||
// Get the socket handles in the system
|
||||
ret = amdsmi_get_socket_handles(&socket_count, &sockets[0]);
|
||||
|
||||
|
||||
std::cout << "Total Socket: " << socket_count << std::endl;
|
||||
|
||||
|
||||
// For each socket, get identifier and devices
|
||||
for (uint32_t i=0; i < socket_count; i++) {
|
||||
// Get Socket info
|
||||
char socket_info[128];
|
||||
ret = amdsmi_get_socket_info(sockets[i], socket_info, 128);
|
||||
std::cout << "Socket " << socket_info<< std::endl;
|
||||
|
||||
|
||||
// Get the device count for the socket.
|
||||
uint32_t device_count = 0;
|
||||
ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr);
|
||||
|
||||
|
||||
// Allocate the memory for the device handlers on the socket
|
||||
std::vector<amdsmi_processor_handle> processor_handles(device_count);
|
||||
// Get all devices of the socket
|
||||
ret = amdsmi_get_processor_handles(sockets[i],
|
||||
&device_count, &processor_handles[0]);
|
||||
|
||||
|
||||
// For each device of the socket, get name and temperature.
|
||||
for (uint32_t j=0; j < device_count; j++) {
|
||||
// Get device type. Since the amdsmi is initialized with
|
||||
@@ -134,13 +134,13 @@ int main() {
|
||||
std::cout << "Expect AMD_GPU device type!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Get device name
|
||||
amdsmi_board_info_t board_info;
|
||||
ret = amdsmi_get_gpu_board_info(processor_handles[j], &board_info);
|
||||
std::cout << "\tdevice "
|
||||
<< j <<"\n\t\tName:" << board_info.product_name << std::endl;
|
||||
|
||||
|
||||
// Get temperature
|
||||
int64_t val_i64 = 0;
|
||||
ret = amdsmi_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE,
|
||||
@@ -148,11 +148,11 @@ int main() {
|
||||
std::cout << "\t\tTemperature: " << val_i64 << "C" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Clean up resources allocated at amdsmi_init. It will invalidate sockets
|
||||
// and devices pointers
|
||||
ret = amdsmi_shut_down();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
@@ -169,18 +169,15 @@ int main() {
|
||||
- Install amdgpu driver
|
||||
- Install amd-smi-lib package through package manager
|
||||
- cd /opt/<rocm_instance>/share/amd_smi
|
||||
- pip install .
|
||||
|
||||
or
|
||||
|
||||
- pip3 install .
|
||||
- python3 -m pip install --upgrade pip
|
||||
- python3 -m pip install --user .
|
||||
- /opt/<rocm_instance>/bin/amd-smi --help
|
||||
|
||||
Add /opt/<rocm_instance>/bin to your shell's path to call amd-smi from the cmdline
|
||||
Add /opt/rocm/bin to your shell's path to access amd-smi via the cmdline
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for AMDSMI-CLI is available post install in /opt/<rocm_instance>/libexec/amdsmi_cli/README.md
|
||||
Documentation for AMDSMI-CLI is available in /opt/<rocm_instance>/libexec/amdsmi_cli/README.md
|
||||
|
||||
## Rebuilding Python wrapper
|
||||
The python wrapper (binding) is an auto-generated file `py-interface/amdsmi_wrapper.py`
|
||||
|
||||
@@ -16,13 +16,12 @@ Recommended: At least one AMD GPU with AMD driver installed
|
||||
- Install amdgpu driver
|
||||
- Install amd-smi-lib package through package manager
|
||||
- cd /opt/<rocm_instance>/share/amd_smi
|
||||
- pip install .
|
||||
|
||||
or
|
||||
|
||||
- pip3 install .
|
||||
- python3 -m pip install --upgrade pip
|
||||
- python3 -m pip install --user .
|
||||
- /opt/<rocm_instance>/bin/amd-smi --help
|
||||
|
||||
Add /opt/rocm/bin to your shell's path to access amd-smi via the cmdline
|
||||
|
||||
### RHEL 8
|
||||
|
||||
The default python version in RHEL 8 is python 3.6.8
|
||||
@@ -31,14 +30,15 @@ To install the python library you need to upgrade to python 3.7+
|
||||
|
||||
The package's dependency manager will attempt to install python 3.8+
|
||||
|
||||
Verify that your pip version is 3.7+ and if not you can use pip3.8 instead
|
||||
Verify that your python version is 3.7+ and if not you can use python3.8 instead of python3
|
||||
|
||||
### Example of Ubuntu 22.04 post amdgpu driver install
|
||||
|
||||
``` shell
|
||||
apt install amd-smi-lib
|
||||
cd /opt/rocm/share/amd_smi
|
||||
pip install .
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install --user .
|
||||
/opt/rocm/bin/amd-smi
|
||||
```
|
||||
|
||||
@@ -52,7 +52,7 @@ amd-smi will report the version and current platform detected when running the c
|
||||
amd-smi
|
||||
usage: amd-smi [-h] ...
|
||||
|
||||
AMD System Management Interface | Version: 0.0.4 | Platform: Linux Baremetal
|
||||
AMD System Management Interface | Version: 23.0.1.0 | Platform: Linux Baremetal
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
@@ -4,7 +4,14 @@
|
||||
|
||||
Documentation for AMDSMI-CLI is available post install in /opt/<rocm_instance>/libexec/amdsmi_cli/README.md
|
||||
|
||||
## AMDSMI-CLI 0.0.4
|
||||
## AMDSMI-CLI 23.0.1.0
|
||||
|
||||
### Known Issues
|
||||
|
||||
- not all ecc fields are currently supported
|
||||
- RHEL 8 has extra install steps
|
||||
|
||||
## AMDSMI-CLI 23.0.0.4
|
||||
|
||||
### Added
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.1.0"
|
||||
__version__ = "23.0.1.0"
|
||||
|
||||
@@ -899,7 +899,7 @@ class AMDSMICommands():
|
||||
if args.ecc_block:
|
||||
ecc_dict = {}
|
||||
try:
|
||||
ras_states = amdsmi_interface.amdsmi_get_ras_block_features_enabled(args.gpu)
|
||||
ras_states = amdsmi_interface.amdsmi_get_gpu_ras_block_features_enabled(args.gpu)
|
||||
for state in ras_states:
|
||||
if state['status'] == amdsmi_interface.AmdSmiRasErrState.ENABLED.name:
|
||||
gpu_block = amdsmi_interface.AmdSmiGpuBlock[state['block']]
|
||||
|
||||
@@ -10,7 +10,7 @@ name = "amdsmi"
|
||||
authors = [
|
||||
{name = "AMD", email = "amd-smi.support@amd.com"},
|
||||
]
|
||||
version = '1.0'
|
||||
version = '23.0.1.0'
|
||||
license = {file = "amdsmi/LICENSE"}
|
||||
readme = {file = "amdsmi/README.md", content-type = "text/markdown"}
|
||||
description = "SMI LIB - AMD GPU Monitoring Library"
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir