Merge amd-dev into amd-master 20241022

Change-Id: I76f797f267679882d02106a4177359bd31e0b0d5
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: 148b015cab]
Этот коммит содержится в:
Charis Poag
2024-10-22 18:16:36 -05:00
родитель 1f8e2e9cd1 072e67c9c3
Коммит b2cf801ba5
16 изменённых файлов: 168 добавлений и 287 удалений
+31
Просмотреть файл
@@ -568,6 +568,10 @@ GPU: 0
### Removals
- **Removed `amd-smi reset --compute-partition` and `... --memory-partition` and associated APIs**.
- This change is part of the partition redesign. Reset functionality will be reintroduced in a later update.
- associated APIs include `amdsmi_reset_gpu_compute_partition()` and `amdsmi_reset_gpu_memory_partition()`
- **Removed usage of _validate_positive in Parser and replaced with _positive_int and _not_negative_int as appropriate**.
- This will allow 0 to be a valid input for several options in setting CPUs where appropriate (for example, as a mode or NBIOID)
@@ -649,6 +653,33 @@ GPU POWER GPU_TEMP MEM_TEMP VRAM_USED VRAM_TOTAL
- **Python API for `amdsmi_get_energy_count()` will deprecate the `power` field in ROCm 6.4 and use `energy_accumulator` field instead**.
- **New memory and compute partition APIs incoming for ROCm 6.4**.
- These APIs will be updated to fully populate the CLI and allowing compute (accelerator) partitions to be set by profile ID.
- One API will be provided, to reset both memory and compute (accelerator).
- There are dependencies regarding available compute partitions when in other memory modes.
- Driver will be providing these default modes
- Memory partition resets (for BM) require driver reloads - this will allow us to notify users before taking this action, then change to the default compute partition modes.
- The following APIs will remain:
```C
amdsmi_status_t
amdsmi_set_gpu_compute_partition(amdsmi_processor_handle processor_handle,
amdsmi_compute_partition_type_t compute_partition);
amdsmi_status_t
amdsmi_get_gpu_compute_partition(amdsmi_processor_handle processor_handle,
char *compute_partition, uint32_t len);
amdsmi_status_t
amdsmi_get_gpu_memory_partition(amdsmi_processor_handle processor_handle,
char *memory_partition, uint32_t len);
amdsmi_status_t
amdsmi_set_gpu_memory_partition(amdsmi_processor_handle processor_handle,
amdsmi_memory_partition_type_t memory_partition);
```
- **amd-smi set --compute-partition "SPX/DPX/CPX..." will no longer be supported for ROCm 6.4**.
- This is due to aligning with Host setups and providing more robust partition information through the APIs outlined above. Furthermore, new APIs which will be available on both BM/Host can set by profile ID. (functionality coming soon!)
- **Added preliminary `amd-smi partition` command**.
- The new partition command can be used to display GPU information, including memory and accelerator partition information.
- The command will be at full functionality once additional partition information from `amdsmi_get_gpu_accelerator_partition_profile()` has been implemented.
+29 -6
Просмотреть файл
@@ -134,10 +134,10 @@ do_install_amdsmi_python_lib() {
export PIP_BREAK_SYSTEM_PACKAGES=1
# Remove old python library
local pip_list_output
pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
local amdsmi_pip_list_output
amdsmi_pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
# check pip list output for amdsmi
if [[ $pip_list_output == *"amdsmi"* ]]; then
if [[ $amdsmi_pip_list_output == *"amdsmi"* ]]; then
echo "Detected old AMD-SMI python library (amdsmi)..."
python3 -m pip uninstall amdsmi --yes --quiet --disable-pip-version-check
echo "Removed old AMD-SMI python library (amdsmi)..."
@@ -148,9 +148,32 @@ do_install_amdsmi_python_lib() {
return
fi
# install python library at @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi
local python_lib_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@
python3 -m pip install "$python_lib_path" --quiet --disable-pip-version-check --no-build-isolation --no-index
check_and_install_amdsmi() {
local setuptools_version
setuptools_version=$(python3 -c 'import setuptools; print(setuptools.__version__)')
if [ $? -ne 0 ]; then
echo "[WARNING] Could not determine setuptools version. "\
"AMD-SMI python library will not be installed."
return
fi
local amdsmi_python_lib_path="/opt/rocm/share/amd_smi"
local amdsmi_setup_py_path="/opt/rocm/share/amd_smi/setup.py"
# Decide installation method based on setuptools version
if [[ "$(printf '%s\n' "$setuptools_version" "28.5" | sort -V | head -n1)" == "$setuptools_version" ]]; then
echo "[WARNING] Setuptools version is less than 28.5. AMD-SMI will not be installed."
elif [[ "$(printf '%s\n' "$setuptools_version" "41.0.1" | sort -V | head -n1)" != "41.0.1" ]]; then
echo "Using setup.py for installation due to setuptools version $setuptools_version"
python3 "$amdsmi_setup_py_path" install
else
echo "Using pyproject.toml for installation due to setuptools version $setuptools_version"
python3 -m pip install "$amdsmi_python_lib_path" --quiet --disable-pip-version-check --no-build-isolation --no-index
fi
}
# Call the function
check_and_install_amdsmi
export PIP_ROOT_USER_ACTION="$PREVIOUS_PIP_ROOT_USER_ACTION"
export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES"
+30 -6
Просмотреть файл
@@ -134,10 +134,10 @@ do_install_amdsmi_python_lib() {
# Remove old python library
local pip_list_output
pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
local amdsmi_pip_list_output
amdsmi_pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
# check pip list output for amdsmi
if [[ $pip_list_output == *"amdsmi"* ]]; then
if [[ $amdsmi_pip_list_output == *"amdsmi"* ]]; then
echo "Detected old AMD-SMI python library (amdsmi)..."
python3 -m pip uninstall amdsmi --yes --quiet --disable-pip-version-check
echo "Removed old AMD-SMI python library (amdsmi)..."
@@ -148,9 +148,33 @@ do_install_amdsmi_python_lib() {
return
fi
# install python library at @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi
local python_lib_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@
python3 -m pip install "$python_lib_path" --quiet --disable-pip-version-check --no-build-isolation --no-index
check_and_install_amdsmi() {
local setuptools_version
setuptools_version=$(python3 -c 'import setuptools; print(setuptools.__version__)')
if [ $? -ne 0 ]; then
echo "[WARNING] Could not determine setuptools version. "\
"AMD-SMI python library will not be installed."
return
fi
local amdsmi_python_lib_path="/opt/rocm/share/amd_smi"
local amdsmi_setup_py_path="/opt/rocm/share/amd_smi/setup.py"
# Decide installation method based on setuptools version
if [[ "$(printf '%s\n' "$setuptools_version" "28.5" | sort -V | head -n1)" == "$setuptools_version" ]]; then
echo "[WARNING] Setuptools version is less than 28.5. AMD-SMI will not be installed."
elif [[ "$(printf '%s\n' "$setuptools_version" "41.0.1" | sort -V | head -n1)" != "41.0.1" ]]; then
echo "Using setup.py for installation due to setuptools version $setuptools_version"
python3 "$amdsmi_setup_py_path" install
else
echo "Using pyproject.toml for installation due to setuptools version $setuptools_version"
python3 -m pip install "$amdsmi_python_lib_path" --quiet --disable-pip-version-check --no-build-isolation --no-index
fi
}
# Call the function
check_and_install_amdsmi
export PIP_ROOT_USER_ACTION="$PREVIOUS_PIP_ROOT_USER_ACTION"
export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES"
+43 -68
Просмотреть файл
@@ -4210,7 +4210,7 @@ class AMDSMICommands():
def reset(self, args, multiple_devices=False, gpu=None, gpureset=None,
clocks=None, fans=None, profile=None, xgmierr=None, perf_determinism=None,
compute_partition=None, memory_partition=None, power_cap=None, clean_local_data=None):
power_cap=None, clean_local_data=None):
"""Issue reset commands to target gpu(s)
Args:
@@ -4223,8 +4223,6 @@ class AMDSMICommands():
profile (bool, optional): Value override for args.profile. Defaults to None.
xgmierr (bool, optional): Value override for args.xgmierr. Defaults to None.
perf_determinism (bool, optional): Value override for args.perf_determinism. Defaults to None.
compute_partition (bool, optional): Value override for args.compute_partition. Defaults to None.
memory_partition (bool, optional): Value override for args.memory_partition. Defaults to None.
power_cap (bool, optional): Value override for args.power_cap. Defaults to None.
clean_local_data (bool, optional): Value override for args.run_cleaner_shader. Defaults to None.
@@ -4250,10 +4248,6 @@ class AMDSMICommands():
args.xgmierr = xgmierr
if perf_determinism:
args.perf_determinism = perf_determinism
if compute_partition:
args.compute_partition = compute_partition
if memory_partition:
args.memory_partition = memory_partition
if power_cap:
args.power_cap = power_cap
if clean_local_data:
@@ -4355,67 +4349,48 @@ class AMDSMICommands():
reset_profile_results['power_profile'] = "N/A"
logging.debug("Failed to reset power profile on gpu %s | %s", gpu_id, e.get_error_info())
try:
level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO
amdsmi_interface.amdsmi_set_gpu_perf_level(args.gpu, level_auto)
reset_profile_results['performance_level'] = 'Successfully reset Performance Level'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
reset_profile_results['performance_level'] = "N/A"
logging.debug("Failed to reset perf level on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_profile', reset_profile_results)
if args.xgmierr:
try:
amdsmi_interface.amdsmi_reset_gpu_xgmi_error(args.gpu)
result = 'Successfully reset XGMI Error count'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to reset xgmi error count on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_xgmi_err', result)
if args.perf_determinism:
try:
level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO
amdsmi_interface.amdsmi_set_gpu_perf_level(args.gpu, level_auto)
result = 'Successfully disabled performance determinism'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to set perf level on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_perf_determinism', result)
if args.compute_partition:
try:
amdsmi_interface.amdsmi_reset_gpu_compute_partition(args.gpu)
result = 'Successfully reset compute partition'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to reset compute partition on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_compute_partition', result)
if args.memory_partition:
try:
amdsmi_interface.amdsmi_reset_gpu_memory_partition(args.gpu)
result = 'Successfully reset memory partition'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to reset memory partition on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_memory_partition', result)
if args.power_cap:
try:
power_cap_info = amdsmi_interface.amdsmi_get_power_cap_info(args.gpu)
logging.debug(f"Power cap info for gpu {gpu_id} | {power_cap_info}")
default_power_cap_in_w = power_cap_info["default_power_cap"]
default_power_cap_in_w = self.helpers.convert_SI_unit(default_power_cap_in_w, AMDSMIHelpers.SI_Unit.MICRO)
current_power_cap_in_w = power_cap_info["power_cap"]
current_power_cap_in_w = self.helpers.convert_SI_unit(current_power_cap_in_w, AMDSMIHelpers.SI_Unit.MICRO)
except amdsmi_exception.AmdSmiLibraryException as e:
raise ValueError(f"Unable to get power cap info from {gpu_id}") from e
try:
level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO
amdsmi_interface.amdsmi_set_gpu_perf_level(args.gpu, level_auto)
reset_profile_results['performance_level'] = 'Successfully reset Performance Level'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
reset_profile_results['performance_level'] = "N/A"
logging.debug("Failed to reset perf level on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_profile', reset_profile_results)
if args.xgmierr:
try:
amdsmi_interface.amdsmi_reset_gpu_xgmi_error(args.gpu)
result = 'Successfully reset XGMI Error count'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to reset xgmi error count on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_xgmi_err', result)
if args.perf_determinism:
try:
level_auto = amdsmi_interface.AmdSmiDevPerfLevel.AUTO
amdsmi_interface.amdsmi_set_gpu_perf_level(args.gpu, level_auto)
result = 'Successfully disabled performance determinism'
except amdsmi_exception.AmdSmiLibraryException as e:
if e.get_error_code() == amdsmi_interface.amdsmi_wrapper.AMDSMI_STATUS_NO_PERM:
raise PermissionError('Command requires elevation') from e
result = "N/A"
logging.debug("Failed to set perf level on gpu %s | %s", gpu_id, e.get_error_info())
self.logger.store_output(args.gpu, 'reset_perf_determinism', result)
if args.power_cap:
try:
power_cap_info = amdsmi_interface.amdsmi_get_power_cap_info(args.gpu)
logging.debug(f"Power cap info for gpu {gpu_id} | {power_cap_info}")
default_power_cap_in_w = power_cap_info["default_power_cap"]
default_power_cap_in_w = self.helpers.convert_SI_unit(default_power_cap_in_w, AMDSMIHelpers.SI_Unit.MICRO)
current_power_cap_in_w = power_cap_info["power_cap"]
current_power_cap_in_w = self.helpers.convert_SI_unit(current_power_cap_in_w, AMDSMIHelpers.SI_Unit.MICRO)
except amdsmi_exception.AmdSmiLibraryException as e:
raise ValueError(f"Unable to get power cap info from {gpu_id}") from e
if current_power_cap_in_w == default_power_cap_in_w:
self.logger.store_output(args.gpu, 'powercap', f"Power cap is already set to {default_power_cap_in_w}")
-4
Просмотреть файл
@@ -1128,8 +1128,6 @@ class AMDSMIParser(argparse.ArgumentParser):
reset_profile_help = "Reset power profile back to default"
reset_xgmierr_help = "Reset XGMI error counts"
reset_perf_det_help = "Disable performance determinism"
reset_compute_help = "Reset compute partitions on the specified GPU"
reset_memory_help = "Reset memory partitions on the specified GPU"
reset_power_cap_help = "Reset power capacity limit to max capable"
reset_gpu_clean_local_data_help = "Clean up local data in LDS/GPRs on a per partition basis"
@@ -1152,8 +1150,6 @@ class AMDSMIParser(argparse.ArgumentParser):
reset_parser.add_argument('-p', '--profile', action='store_true', required=False, help=reset_profile_help)
reset_parser.add_argument('-x', '--xgmierr', action='store_true', required=False, help=reset_xgmierr_help)
reset_parser.add_argument('-d', '--perf-determinism', action='store_true', required=False, help=reset_perf_det_help)
reset_parser.add_argument('-C', '--compute-partition', action='store_true', required=False, help=reset_compute_help)
reset_parser.add_argument('-M', '--memory-partition', action='store_true', required=False, help=reset_memory_help)
reset_parser.add_argument('-o', '--power-cap', action='store_true', required=False, help=reset_power_cap_help)
# Add Baremetal and Virtual OS reset arguments
-59
Просмотреть файл
@@ -3703,35 +3703,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_reset_gpu_compute_partition
Description: Reset the compute partitioning on the given GPU
Input parameters:
* `processor_handle` the device handle
Output: String of the partition type
Exceptions that can be thrown by `amdsmi_reset_gpu_compute_partition` 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:
amdsmi_reset_gpu_compute_partition(device)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_memory_partition
@@ -3796,36 +3767,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_reset_gpu_memory_partition
Description: Reset the memory partitioning on the given GPU
Input parameters:
* `processor_handle` the device handle
Output: String of the partition type
Exceptions that can be thrown by `amdsmi_reset_gpu_memory_partition` 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:
amdsmi_reset_gpu_memory_partition(device)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_xgmi_info
Description: Returns XGMI information for the GPU.
-40
Просмотреть файл
@@ -4578,25 +4578,6 @@ amdsmi_status_t
amdsmi_set_gpu_compute_partition(amdsmi_processor_handle processor_handle,
amdsmi_compute_partition_type_t compute_partition);
/**
* @brief Reverts a selected device's compute partition setting back to its
* boot state.
*
* @platform{gpu_bm_linux}
*
* @details Given a processor handle @p processor_handle, this function will attempt to
* revert its compute partition setting back to its boot state.
*
* @param[in] processor_handle Device which to query
*
* @retval ::AMDSMI_STATUS_SUCCESS call was successful
* @retval ::AMDSMI_STATUS_PERMISSION function requires root access
* @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function
*
*/
amdsmi_status_t amdsmi_reset_gpu_compute_partition(amdsmi_processor_handle processor_handle);
/** @} */ // end of compute_partition
/*****************************************************************************/
@@ -4667,27 +4648,6 @@ amdsmi_status_t
amdsmi_set_gpu_memory_partition(amdsmi_processor_handle processor_handle,
amdsmi_memory_partition_type_t memory_partition);
/**
* @brief Reverts a selected device's memory partition setting back to its
* boot state.
*
* @platform{gpu_bm_linux}
*
* @details Given a processor handle @p processor_handle, this function will attempt to
* revert its current memory partition setting back to its boot state.
*
* @param[in] processor_handle Device which to query
*
* @retval ::AMDSMI_STATUS_SUCCESS call was successful
* @retval ::AMDSMI_STATUS_PERMISSION function requires root access
* @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function
* @retval ::AMDSMI_STATUS_AMDGPU_RESTART_ERR could not successfully restart
* the amdgpu driver
*
*/
amdsmi_status_t amdsmi_reset_gpu_memory_partition(amdsmi_processor_handle processor_handle);
/** @} */ // end of memory_partition
/*****************************************************************************/
+3
Просмотреть файл
@@ -70,6 +70,7 @@ endif()
configure_file(pyproject.toml.in ${PY_BUILD_DIR}/pyproject.toml @ONLY)
configure_file(setup.cfg.in ${PY_BUILD_DIR}/setup.cfg @ONLY)
configure_file(_version.py.in ${PY_PACKAGE_DIR}/_version.py @ONLY)
configure_file(setup.py.in ${PY_BUILD_DIR}/setup.py @ONLY)
add_custom_target(
python_wrapper
@@ -103,6 +104,7 @@ add_custom_target(
python_package ALL
DEPENDS ${PY_BUILD_DIR}/pyproject.toml
${PY_BUILD_DIR}/setup.cfg
${PY_BUILD_DIR}/setup.py
${PY_PACKAGE_DIR}/_version.py
${PY_PACKAGE_DIR}/__init__.py
${PY_PACKAGE_DIR}/amdsmi_exception.py
@@ -116,6 +118,7 @@ install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PY_BUILD_DIR}/pyproject.toml
${CMAKE_CURRENT_BINARY_DIR}/${PY_BUILD_DIR}/setup.cfg
${CMAKE_CURRENT_BINARY_DIR}/${PY_BUILD_DIR}/setup.py
${CMAKE_CURRENT_BINARY_DIR}/${PY_PACKAGE_DIR}/_version.py
DESTINATION ${PY_WRAPPER_INSTALL_DIR}
COMPONENT dev)
-59
Просмотреть файл
@@ -3704,36 +3704,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_reset_gpu_compute_partition
Description: Reset the compute partitioning on the given GPU
Input parameters:
* `processor_handle` the device handle
Output: String of the partition type
Exceptions that can be thrown by `amdsmi_reset_gpu_compute_partition` 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:
amdsmi_reset_gpu_compute_partition(device)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_memory_partition
Description: Get the memory partition from the given GPU
@@ -3797,35 +3767,6 @@ except AmdSmiException as e:
print(e)
```
### amdsmi_reset_gpu_memory_partition
Description: Reset the memory partitioning on the given GPU
Input parameters:
* `processor_handle` the device handle
Output: String of the partition type
Exceptions that can be thrown by `amdsmi_reset_gpu_memory_partition` 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:
amdsmi_reset_gpu_memory_partition(device)
except AmdSmiException as e:
print(e)
```
### amdsmi_get_gpu_accelerator_partition_profile
-2
Просмотреть файл
@@ -222,10 +222,8 @@ from .amdsmi_interface import amdsmi_get_link_topology_nearest
# # Partition Functions
from .amdsmi_interface import amdsmi_get_gpu_compute_partition
from .amdsmi_interface import amdsmi_set_gpu_compute_partition
from .amdsmi_interface import amdsmi_reset_gpu_compute_partition
from .amdsmi_interface import amdsmi_get_gpu_memory_partition
from .amdsmi_interface import amdsmi_set_gpu_memory_partition
from .amdsmi_interface import amdsmi_reset_gpu_memory_partition
from .amdsmi_interface import amdsmi_get_gpu_accelerator_partition_profile
# # Individual GPU Metrics Functions
-18
Просмотреть файл
@@ -2691,15 +2691,6 @@ def amdsmi_set_gpu_compute_partition(processor_handle: amdsmi_wrapper.amdsmi_pro
)
def amdsmi_reset_gpu_compute_partition(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
)
_check_res(amdsmi_wrapper.amdsmi_reset_gpu_compute_partition(processor_handle))
def amdsmi_get_gpu_memory_partition(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
@@ -2737,15 +2728,6 @@ def amdsmi_set_gpu_memory_partition(processor_handle: amdsmi_wrapper.amdsmi_proc
)
def amdsmi_reset_gpu_memory_partition(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
)
_check_res(amdsmi_wrapper.amdsmi_reset_gpu_memory_partition(processor_handle))
def amdsmi_get_gpu_accelerator_partition_profile(
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
) -> Dict[str, Any]:
+5 -11
Просмотреть файл
@@ -2349,18 +2349,12 @@ amdsmi_get_gpu_compute_partition.argtypes = [amdsmi_processor_handle, ctypes.POI
amdsmi_set_gpu_compute_partition = _libraries['libamd_smi.so'].amdsmi_set_gpu_compute_partition
amdsmi_set_gpu_compute_partition.restype = amdsmi_status_t
amdsmi_set_gpu_compute_partition.argtypes = [amdsmi_processor_handle, amdsmi_compute_partition_type_t]
amdsmi_reset_gpu_compute_partition = _libraries['libamd_smi.so'].amdsmi_reset_gpu_compute_partition
amdsmi_reset_gpu_compute_partition.restype = amdsmi_status_t
amdsmi_reset_gpu_compute_partition.argtypes = [amdsmi_processor_handle]
amdsmi_get_gpu_memory_partition = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_partition
amdsmi_get_gpu_memory_partition.restype = amdsmi_status_t
amdsmi_get_gpu_memory_partition.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t]
amdsmi_set_gpu_memory_partition = _libraries['libamd_smi.so'].amdsmi_set_gpu_memory_partition
amdsmi_set_gpu_memory_partition.restype = amdsmi_status_t
amdsmi_set_gpu_memory_partition.argtypes = [amdsmi_processor_handle, amdsmi_memory_partition_type_t]
amdsmi_reset_gpu_memory_partition = _libraries['libamd_smi.so'].amdsmi_reset_gpu_memory_partition
amdsmi_reset_gpu_memory_partition.restype = amdsmi_status_t
amdsmi_reset_gpu_memory_partition.argtypes = [amdsmi_processor_handle]
amdsmi_get_gpu_accelerator_partition_profile = _libraries['libamd_smi.so'].amdsmi_get_gpu_accelerator_partition_profile
amdsmi_get_gpu_accelerator_partition_profile.restype = amdsmi_status_t
amdsmi_get_gpu_accelerator_partition_profile.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_accelerator_partition_profile_t), ctypes.POINTER(ctypes.c_uint32)]
@@ -2899,10 +2893,9 @@ __all__ = \
'amdsmi_process_info_t', 'amdsmi_processor_handle',
'amdsmi_range_t', 'amdsmi_ras_err_state_t',
'amdsmi_ras_feature_t', 'amdsmi_reg_type_t', 'amdsmi_reset_gpu',
'amdsmi_reset_gpu_compute_partition', 'amdsmi_reset_gpu_fan',
'amdsmi_reset_gpu_memory_partition',
'amdsmi_reset_gpu_xgmi_error', 'amdsmi_retired_page_record_t',
'amdsmi_set_clk_freq', 'amdsmi_set_cpu_core_boostlimit',
'amdsmi_reset_gpu_fan', 'amdsmi_reset_gpu_xgmi_error',
'amdsmi_retired_page_record_t', 'amdsmi_set_clk_freq',
'amdsmi_set_cpu_core_boostlimit',
'amdsmi_set_cpu_df_pstate_range',
'amdsmi_set_cpu_gmi3_link_width_range',
'amdsmi_set_cpu_pcie_link_rate',
@@ -2970,5 +2963,6 @@ __all__ = \
'struct_cache_', 'struct_engine_usage_', 'struct_fw_info_list_',
'struct_memory_usage_', 'struct_nps_flags_',
'struct_pcie_metric_', 'struct_pcie_static_',
'struct_amdsmi_bdf_t','uint32_t', 'uint64_t', 'uint8_t',
'struct_amdsmi_bdf_t', 'uint32_t', 'uint64_t', 'uint8_t',
'union_amdsmi_bdf_t', 'union_amdsmi_nps_caps_t']
+1 -1
Просмотреть файл
@@ -16,7 +16,7 @@ readme = {file = "amdsmi/README.md", content-type = "text/markdown"}
description = "AMDSMI Python LIB - AMD GPU Monitoring Library"
requires-python = ">=3.6"
dependencies = [
"PyYAML >= 3.12",
"PyYAML >= 3.0",
]
[project.urls]
+1 -1
Просмотреть файл
@@ -18,7 +18,7 @@ include_package_data = True
packages = find:
python_requires = >=3.6
install_requires=
PyYAML >= 3.12
PyYAML >= 3.0
[options.package_data]
* = *.so
+25
Просмотреть файл
@@ -0,0 +1,25 @@
from setuptools import setup, find_packages
import os
setup(
name="amdsmi",
version="@amd_smi_libraries_VERSION_STRING@",
author="AMD",
author_email="amd-smi.support@amd.com",
description="AMDSMI Python LIB - AMD GPU Monitoring Library",
url="https://github.com/ROCm/amdsmi",
packages=find_packages(),
install_requires=[
"PyYAML>=3.0",
],
classifiers=[
"Programming Language :: Python :: 3",
],
python_requires=">=3.6",
include_package_data=True,
package_data={
'': ['*.so'],
},
zip_safe=False,
license='amdsmi/LICENSE',
)
-12
Просмотреть файл
@@ -1431,12 +1431,6 @@ amdsmi_set_gpu_compute_partition(amdsmi_processor_handle processor_handle,
static_cast<rsmi_compute_partition_type_t>(compute_partition));
}
amdsmi_status_t
amdsmi_reset_gpu_compute_partition(amdsmi_processor_handle processor_handle) {
AMDSMI_CHECK_INIT();
return rsmi_wrapper(rsmi_dev_compute_partition_reset, processor_handle);
}
// Memory Partition functions
amdsmi_status_t
amdsmi_get_gpu_memory_partition(amdsmi_processor_handle processor_handle,
@@ -1454,12 +1448,6 @@ amdsmi_set_gpu_memory_partition(amdsmi_processor_handle processor_handle,
static_cast<rsmi_memory_partition_type_t>(memory_partition));
}
amdsmi_status_t
amdsmi_reset_gpu_memory_partition(amdsmi_processor_handle processor_handle) {
AMDSMI_CHECK_INIT();
return rsmi_wrapper(rsmi_dev_memory_partition_reset, processor_handle);
}
amdsmi_status_t
amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_handle,
amdsmi_accelerator_partition_profile_t *profile,