Merge amd-dev into amd-master 20240405

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I7bc20ca726cb5bcd8ac166d2263074562e6e752c


[ROCm/amdsmi commit: 1171c233cf]
Этот коммит содержится в:
Maisam Arif
2024-04-05 02:32:00 -05:00
родитель b1d422d729 552a34f7d5
Коммит 024e22b185
7 изменённых файлов: 55 добавлений и 30 удалений
-2
Просмотреть файл
@@ -219,7 +219,6 @@ $ amd-smi topology --json
"link_type": "SELF",
"num_hops": 0,
"bandwidth": "N/A",
"fb_sharing": "ENABLED"
},
{
"gpu": 1,
@@ -229,7 +228,6 @@ $ amd-smi topology --json
"link_type": "XGMI",
"num_hops": 1,
"bandwidth": "50000-100000",
"fb_sharing": "ENABLED"
},
...
]
+1 -1
Просмотреть файл
@@ -28,7 +28,7 @@ find_program(GIT NAMES git)
## Setup the package version based on git tags.
set(PKG_VERSION_GIT_TAG_PREFIX "amdsmi_pkg_ver")
get_package_version_number("24.5.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
get_package_version_number("24.5.1" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
message("Package version: ${PKG_VERSION_STR}")
set(${AMD_SMI_LIBS_TARGET}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}")
set(${AMD_SMI_LIBS_TARGET}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}")
+1 -1
Просмотреть файл
@@ -79,7 +79,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: 24.5.0.0 | ROCm version: 6.1.1 | Platform: Linux Baremetal
AMD System Management Interface | Version: 24.5.1.0 | ROCm version: 6.1.1 | Platform: Linux Baremetal
options:
-h, --help show this help message and exit
+5 -10
Просмотреть файл
@@ -2782,13 +2782,11 @@ class AMDSMICommands():
# "gpu": GPU #
# "bdf": BDF identification
# "weight": 0 - self (current node); weight >= 0 correlated with hops (GPU-CPU, GPU-GPU, GPU-CPU-CPU-GPU, etc..)
# "link_status": "ENABLED" - devices linked; "DISABLED" - devices not linked
# "link_status": "ENABLED" - devices linked; "DISABLED" - devices not linked; Correlated to access
# "link_type": "SELF" - current node, "PCIE", "XGMI", "N/A" - no link,"UNKNOWN" - unidentified link type
# "num_hops": num_hops - # of hops between devices
# "bandwidth": numa_bw - The NUMA "minimum bandwidth-maximum bandwidth" beween src and dest nodes
# "N/A" - self node or not connected devices
# "fb_sharing": "ENABLED/DISABLED" - same output as defined in link_status. Devices in a hive setup should
# all have sharing enabled.
# }
for dest_gpu_index, dest_gpu in enumerate(args.gpu):
@@ -2818,7 +2816,7 @@ class AMDSMICommands():
weight = 0
num_hops = 0
if src_gpu != dest_gpu:
if src_gpu != dest_gpu:
weight = amdsmi_interface.amdsmi_topo_get_link_weight(src_gpu, dest_gpu)
num_hops = amdsmi_interface.amdsmi_topo_get_link_type(src_gpu, dest_gpu)['hops']
link_status = amdsmi_interface.amdsmi_is_P2P_accessible(src_gpu, dest_gpu)
@@ -2827,7 +2825,6 @@ class AMDSMICommands():
else:
link_status = "DISABLED"
# fb_sharing in BM - in a hive configuration, this is
# link_status = amdsmi_is_P2P_accessible(src,dest)
dest_gpu_links = {
"gpu": self.helpers.get_gpu_id_from_device_handle(dest_gpu),
@@ -2837,11 +2834,9 @@ class AMDSMICommands():
"link_type": link_type,
"num_hops": num_hops,
"bandwidth": numa_bw,
"fb_sharing": link_status
}
if not args.access: # currently includes fb_sharing
if not args.access:
del dest_gpu_links['link_status']
del dest_gpu_links['fb_sharing']
if not args.weight:
del dest_gpu_links['weight']
if not args.link_type:
@@ -2851,9 +2846,9 @@ class AMDSMICommands():
if not args.numa_bw:
del dest_gpu_links['bandwidth']
links.append(dest_gpu_links)
isEndOfDest = dest_gpu_index+1 == len(args.gpu)
dest_end = dest_gpu_index+1 == len(args.gpu)
isEndOfSrc = src_gpu_index+1 == len(args.gpu)
if isEndOfDest:
if dest_end:
topo_values[src_gpu_index]['links'] = links
continue
if isEndOfSrc:
+1 -1
Просмотреть файл
@@ -48,7 +48,7 @@ PROJECT_NAME = AMD SMI
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "24.5.0.0"
PROJECT_NUMBER = "24.5.1.0"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
+1 -1
Просмотреть файл
@@ -154,7 +154,7 @@ typedef enum {
#define AMDSMI_LIB_VERSION_MAJOR 5
//! Minor version should be updated for each API change, but without changing headers
#define AMDSMI_LIB_VERSION_MINOR 0
#define AMDSMI_LIB_VERSION_MINOR 1
//! Release version should be set to 0 as default and can be updated by the PMs for each CSP point release
#define AMDSMI_LIB_VERSION_RELEASE 0
+46 -14
Просмотреть файл
@@ -882,24 +882,13 @@ except AmdSmiException as e:
### amdsmi_get_gpu_process_list
Description: Returns the list of processes for the given GPU.
The list is of type `amdsmi_proc_info_t` and holds information about the running process.
Description: Returns the list of processes running on the target GPU.
Input parameters:
* `processor_handle` device which to query
Output: List of process processes with fields
Output: Dictionary with fields
Field | Description
---|---
`name` | Name of process
`pid` | Process ID
`mem` | Process memory usage
`engine_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gfx`</td><td>GFX engine usage in ns</td></tr><tr><td>`enc`</td><td>Encode engine usage in ns</td></tr></tbody></table>
`memory_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gtt_mem`</td><td>GTT memory usage</td></tr><tr><td>`cpu_mem`</td><td>CPU memory usage</td></tr><tr><td>`vram_mem`</td><td>VRAM memory usage</td></tr> </tbody></table>
Output: List of `amdsmi_proc_info_t` process objects running on the target GPU; can be empty
Exceptions that can be thrown by `amdsmi_get_gpu_process_list` function:
@@ -921,7 +910,50 @@ try:
print("No processes running on this GPU")
else:
for process in processes:
print(process)
print(amdsmi_get_gpu_process_info(device, process))
except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_process_info
Description: Returns info about process given the target GPU and the corresponding `amdsmi_proc_info_t` object
Input parameters:
* `processor_handle` device which to query
Output: Dictionary with fields
Field | Description
---|---
`name` | Name of process
`pid` | Process ID
`mem` | Process memory usage
`engine_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gfx`</td><td>GFX engine usage in ns</td></tr><tr><td>`enc`</td><td>Encode engine usage in ns</td></tr></tbody></table>
`memory_usage` | <table><thead><tr> <th> Subfield </th> <th> Description</th> </tr></thead><tbody><tr><td>`gtt_mem`</td><td>GTT memory usage</td></tr><tr><td>`cpu_mem`</td><td>CPU memory usage</td></tr><tr><td>`vram_mem`</td><td>VRAM memory usage</td></tr> </tbody></table
Exceptions that can be thrown by `amdsmi_get_gpu_process_info` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
Example:
```python
try:
devices = amdsmi_get_processor_handles()
if len(devices) == 0:
print("No GPUs on machine")
else:
for device in devices:
processes = amdsmi_get_gpu_process_list(device)
if len(processes) == 0:
print("No processes running on this GPU")
else:
for process in processes:
print(amdsmi_get_gpu_process_info(device, process))
except AmdSmiException as e:
print(e)
```