From 968b6aaf41efc08288a95bcb76606d1750531cca Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Mon, 26 Feb 2024 14:10:49 -0600 Subject: [PATCH] Removed old Python API function documentation Signed-off-by: Maisam Arif Change-Id: Ib145fae98f1e99ab474b86ec4f6ddc2c8c44126e [ROCm/amdsmi commit: 57a43babad9ea378c5a77e3654d58c90bd812340] --- projects/amdsmi/py-interface/README.md | 1590 +----------------------- 1 file changed, 3 insertions(+), 1587 deletions(-) diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index b28c50ec4b..fbc5450c61 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -1097,7 +1097,7 @@ Can be used with `with` statement for automatic cleanup. Methods: -### Constructor +#### Constructor Description: Allocates a new event reader notifier to monitor different types of events for the given GPU @@ -1113,7 +1113,7 @@ Event Type | Description `GPU_PRE_RESET` | gpu pre reset `GPU_POST_RESET` | gpu post reset -### read +#### read Description: Reads events on the given device. When event is caught, device handle, message and event type are returned. Reading events stops when timestamp passes without event reading. @@ -1122,7 +1122,7 @@ Input parameters: * `timestamp` number of milliseconds to wait for an event to occur. If event does not happen monitoring is finished * `num_elem` number of events. This is optional parameter. Default value is 10. -### stop +#### stop Description: Any resources used by event notification for the the given device will be freed with this function. This can be used explicitly or automatically using `with` statement, like in the examples below. This should be called either manually or automatically for every created AmdSmiEventReader object. @@ -3515,1590 +3515,6 @@ except AmdSmiException as e: print(e) ``` -## GPU Metrics APIs - -### amdsmi_get_gpu_metrics_temp_hotspot - -Description: Get the hotspot temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: hotspot temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_hotspot` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - hotspot_temp = amdsmi_get_gpu_metrics_temp_hotspot(device) - print(hotspot_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_mem - -Description: Get the memory temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: memory temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_mem` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - mem_temp = amdsmi_get_gpu_metrics_temp_mem(device) - print(mem_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_vrsoc - -Description: Get the VRSOC temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: VRSOC temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_vrsoc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - vrsoc_temp = amdsmi_get_gpu_metrics_temp_vrsoc(device) - print(vrsoc_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_socket_power - -Description: Get the current socket power in Watts - -Input parameters: - -* `processor_handle` device which to query - -Output: current socket power in Watts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_socket_power` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_socket_power = amdsmi_get_gpu_metrics_curr_socket_power(device) - print(curr_socket_power) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_gfx_activity - -Description: Get the average GFX activity in percent - -Input parameters: - -* `processor_handle` device which to query - -Output: average GFX activity in percent - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_gfx_activity` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_gfx_activity = amdsmi_get_gpu_metrics_avg_gfx_activity(device) - print(avg_gfx_activity) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_umc_activity - -Description: Get the average UMC activity in percent - -Input parameters: - -* `processor_handle` device which to query - -Output: average UMC activity in percent - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_umc_activity` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_umc_activity = amdsmi_get_gpu_metrics_avg_umc_activity(device) - print(avg_umc_activity) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_energy_acc - -Description: Get the average energy accumulator in millijoules (check unit) - -Input parameters: - -* `processor_handle` device which to query - -Output: average energy accumulator in millijoules (check unit) - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_energy_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_energy_acc = amdsmi_get_gpu_metrics_avg_energy_acc(device) - print(avg_energy_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_system_clock_counter - -Description: Get the system clock counter - -Input parameters: - -* `processor_handle` device which to query - -Output: system clock counter - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_system_clock_counter` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - system_clock_counter = amdsmi_get_gpu_metrics_system_clock_counter(device) - print(system_clock_counter) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_firmware_timestamp - -Description: Get the firmware timestamp - -Input parameters: - -* `processor_handle` device which to query - -Output: firmware timestamp - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_firmware_timestamp` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - - firmware_timestamp = amdsmi_get_gpu_metrics_firmware_timestamp(device) - print(firmware_timestamp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_throttle_status - -Description: Get the throttle status - -Input parameters: - -* `processor_handle` device which to query - -Output: True if throttled, False if it's not throttled - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_throttle_status` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - throttle_status = amdsmi_get_gpu_metrics_throttle_status(device) - print(throttle_status) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_link_width - -Description: Get the pcie link width - -Input parameters: - -* `processor_handle` device which to query - -Output: pcie link width - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_link_width` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_link_width = amdsmi_get_gpu_metrics_pcie_link_width(device) - print(pcie_link_width) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_link_speed - -Description: Get the pcie link speed - -Input parameters: - -* `processor_handle` device which to query - -Output: pcie link speed - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_link_speed` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_link_speed = amdsmi_get_gpu_metrics_pcie_link_speed(device) - print(pcie_link_speed) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_xgmi_link_width - -Description: Get the xgmi link width - -Input parameters: - -* `processor_handle` device which to query - -Output: xgmi link width - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_xgmi_link_width` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - xgmi_link_width = amdsmi_get_gpu_metrics_xgmi_link_width(device) - print(xgmi_link_width) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_xgmi_link_speed - -Description: Get the xgmi link speed - -Input parameters: - -* `processor_handle` device which to query - -Output: xgmi link speed - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_xgmi_link_speed` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - xgmi_link_speed = amdsmi_get_gpu_metrics_xgmi_link_speed(device) - print(xgmi_link_speed) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_gfxclk_lock_status - -Description: Get the lock status of the gfx clock - -Input parameters: - -* `processor_handle` device which to query - -Output: True if gfx clock is locked, False if it's not locked, raise if not supported - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_gfxclk_lock_status` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - lock_status = amdsmi_get_gpu_metrics_gfxclk_lock_status(device) - print(lock_status) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_gfx_activity_acc - -Description: Get accumulated gfx activity - -Input parameters: - -* `processor_handle` device which to query - -Output: accumulated gfx activity - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_gfx_activity_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - gfx_activity_acc = amdsmi_get_gpu_metrics_gfx_activity_acc(device) - print(gfx_activity_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_mem_activity_acc - -Description: Get accumulated memory activity - -Input parameters: - -* `processor_handle` device which to query - -Output: accumulated mem activity - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_mem_activity_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - mem_activity_acc = amdsmi_get_gpu_metrics_mem_activity_acc(device) - print(mem_activity_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_bandwidth_acc - -Description: Get accumulated pcie bandwidth activity - -Input parameters: - -* `processor_handle` device which to query - -Output: accumulated pcie bandwidth activity - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_bandwidth_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_bandwidth_acc = amdsmi_get_gpu_metrics_pcie_bandwidth_acc(device) - print(pcie_bandwidth_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_bandwidth_inst - -Description: Get instantaneous pcie bandwidth activity - -Input parameters: - -* `processor_handle` device which to query - -Output: instantaneous pcie bandwidth activity - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_bandwidth_inst` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_bandwidth_inst = amdsmi_get_gpu_metrics_pcie_bandwidth_inst(device) - print(pcie_bandwidth_inst) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_l0_recov_count - -Description: Get count of pcie l0 recovery count errors - -Input parameters: - -* `processor_handle` device which to query - -Output: number of l0 recovery count errors - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_l0_recov_count` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_l0_recov_count = amdsmi_get_gpu_metrics_pcie_l0_recov_count(device) - print(pcie_l0_recov_count) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_replay_count_acc - -Description: Get accumulated pcie replay counts - -Input parameters: - -* `processor_handle` device which to query - -Output: accumulated pcie replay counts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_replay_count_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_replay_count_acc = amdsmi_get_gpu_metrics_pcie_replay_count_acc(device) - print(pcie_replay_count_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_pcie_replay_rover_count_acc - -Description: Get accumulated pcie replay rollover counts - -Input parameters: - -* `processor_handle` device which to query - -Output: accumulated pcie replay rollover counts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_pcie_replay_rover_count_acc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - pcie_replay_rover_count_acc = amdsmi_get_gpu_metrics_pcie_replay_rover_count_acc(device) - print(pcie_replay_rover_count_acc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_uclk - -Description: Get the current u clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current u clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_uclk` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_uclk = amdsmi_get_gpu_metrics_curr_uclk(device) - print(curr_uclk) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_hbm - -Description: Get the HBM temperatures in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: list of HBM temperatures in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_hbm` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - hbm_temp = amdsmi_get_gpu_metrics_temp_hbm(device) - print(hbm_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_vcn_activity - -Description: Get the activity for each vcn encoding engine - -Input parameters: - -* `processor_handle` device which to query - -Output: list of vcn activities - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_vcn_activity` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - vcn_activity = amdsmi_get_gpu_metrics_vcn_activity(device) - print(vcn_activity) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_xgmi_read_data - -Description: Get the accumulated read xgmi data for each xgmi link - -Input parameters: - -* `processor_handle` device which to query - -Output: list of accumulated read xgmi data - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_xgmi_read_data` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - xgmi_read_data = amdsmi_get_gpu_metrics_xgmi_read_data(device) - print(xgmi_read_data) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_xgmi_write_data - -Description: Get the accumulated written xgmi data for each xgmi link - -Input parameters: - -* `processor_handle` device which to query - -Output: list of accumulated written xgmi data - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_xgmi_write_data` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - xgmi_write_data = amdsmi_get_gpu_metrics_xgmi_write_data(device) - print(xgmi_write_data) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_gfxclk - -Description: Get the current gfx clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current gfx clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_gfxclk` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_gfxclk = amdsmi_get_gpu_metrics_curr_gfxclk(device) - print(curr_gfxclk) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_socclk - -Description: Get the current soc clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current soc clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_socclk` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_socclk = amdsmi_get_gpu_metrics_curr_socclk(device) - print(curr_socclk) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_vclk0 - -Description: Get the current v0 clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current v0 clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_vclk0` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_vclk0 = amdsmi_get_gpu_metrics_curr_vclk0(device) - print(curr_vclk0) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_dclk0 - -Description: Get the current d0 clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current d0 clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_dclk0` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_dclk0 = amdsmi_get_gpu_metrics_curr_dclk0(device) - print(curr_dclk0) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_edge - -Description: Get the edge temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: edge temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_edge` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - edge_temp = amdsmi_get_gpu_metrics_temp_edge(device) - print(edge_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_vr_gfx - -Description: Get the VR GFX temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: VR GFX temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_vr_gfx` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - vr_gfx_temp = amdsmi_get_gpu_metrics_temp_vr_gfx(device) - print(vr_gfx_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_temp_vr_mem - -Description: Get the VR MEM temperature in degrees Celsius - -Input parameters: - -* `processor_handle` device which to query - -Output: VR MEM temperature in degrees Celsius - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_temp_vr_mem` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - vr_mem_temp = amdsmi_get_gpu_metrics_temp_vr_mem(device) - print(vr_mem_temp) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_mm_activity - -Description: Get the average MM activity in percent - -Input parameters: - -* `processor_handle` device which to query - -Output: average MM activity in percent - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_mm_activity` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_mm_activity = amdsmi_get_gpu_metrics_avg_mm_activity(device) - print(avg_mm_activity) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_vclk1 - -Description: Get the current v1 clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current v1 clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_vclk1` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_vclk1 = amdsmi_get_gpu_metrics_curr_vclk1(device) - print(curr_vclk1) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_dclk1 - -Description: Get the current d1 clock frequency - -Input parameters: - -* `processor_handle` device which to query - -Output: Current d1 clock frequency - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_dclk1` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_dclk1 = amdsmi_get_gpu_metrics_curr_dclk1(device) - print(curr_dclk1) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_indep_throttle_status - -Description: Get the independent throttle status - -Input parameters: - -* `processor_handle` device which to query - -Output: True if throttled, False if it's not throttled - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_indep_throttle_status` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - throttle_status = amdsmi_get_gpu_metrics_indep_throttle_status(device) - print(throttle_status) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_socket_power - -Description: Get the average socket power in Watts - -Input parameters: - -* `processor_handle` device which to query - -Output: average socket power in Watts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_socket_power` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_socket_power = amdsmi_get_gpu_metrics_avg_socket_power(device) - print(avg_socket_power) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_curr_fan_speed - -Description: Get the current fan speed in percent - -Input parameters: - -* `processor_handle` device which to query - -Output: current fan speed in percent - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_curr_fan_speed` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - curr_fan_speed = amdsmi_get_gpu_metrics_curr_fan_speed(device) - print(curr_fan_speed) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_gfx_clock_frequency - -Description: Get the average gfx clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average gfx clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_gfx_clock_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_gfx_clock_frequency = amdsmi_get_gpu_metrics_avg_gfx_clock_frequency(device) - print(avg_gfx_clock_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_soc_clock_frequency - -Description: Get the average soc clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average soc clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_soc_clock_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_soc_clock_frequency = amdsmi_get_gpu_metrics_avg_soc_clock_frequency(device) - print(avg_soc_clock_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_uclock_frequency - -Description: Get the average u clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average u clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_uclock_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_uclock_frequency = amdsmi_get_gpu_metrics_avg_uclock_frequency(device) - print(avg_uclock_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_vclock0_frequency - -Description: Get the average v0 clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average v0 clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_vclock0_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_vclock0_frequency = amdsmi_get_gpu_metrics_avg_vclock0_frequency(device) - print(avg_vclock0_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_dclock0_frequency - -Description: Get the average d0 clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average d0 clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_dclock0_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_dclock0_frequency = amdsmi_get_gpu_metrics_avg_dclock0_frequency(device) - print(avg_dclock0_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_vclock1_frequency - -Description: Get the average v1 clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average v1 clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_vclock1_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_vclock1_frequency = amdsmi_get_gpu_metrics_avg_vclock1_frequency(device) - print(avg_vclock1_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_avg_dclock1_frequency - -Description: Get the average d1 clock frequency in MHz - -Input parameters: - -* `processor_handle` device which to query - -Output: average d1 clock frequency in MHz - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_avg_dclock1_frequency` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - avg_dclock1_frequency = amdsmi_get_gpu_metrics_avg_dclock1_frequency(device) - print(avg_dclock1_frequency) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_volt_soc - -Description: Get the soc voltage in millivolts - -Input parameters: - -* `processor_handle` device which to query - -Output: soc voltage in millivolts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_volt_soc` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - volt_soc = amdsmi_get_gpu_metrics_volt_soc(device) - print(volt_soc) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_volt_gfx - -Description: Get the gfx voltage in millivolts - -Input parameters: - -* `processor_handle` device which to query - -Output: gfx voltage in millivolts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_volt_gfx` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - volt_gfx = amdsmi_get_gpu_metrics_volt_gfx(device) - print(volt_gfx) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_volt_mem - -Description: Get the mem voltage in millivolts - -Input parameters: - -* `processor_handle` device which to query - -Output: mem voltage in millivolts - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_volt_mem` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - volt_mem = amdsmi_get_gpu_metrics_volt_mem(device) - print(volt_mem) -except AmdSmiException as e: - print(e) -``` - -### amdsmi_get_gpu_metrics_header_info - -Description: Get the gpu metrics structure header info - -Input parameters: - -* `processor_handle` device which to query - -Output: dictionary of gpu metrics header information - -Exceptions that can be thrown by `amdsmi_get_gpu_metrics_header_info` function: - -* `AmdSmiLibraryException` -* `AmdSmiRetryException` -* `AmdSmiParameterException` - -Example: - -```python -try: - devices = amdsmi_get_processor_handles() - if len(devices) == 0: - print("No GPUs on the machine") - else: - for device in devices: - header_info = amdsmi_get_gpu_metrics_header_info(device) - print(header_info) -except AmdSmiException as e: - print(e) -``` - ## CPU APIs ### amdsmi_get_processor_info