2022-10-11 16:06:32 +02:00
|
|
|
#
|
2023-03-06 06:20:21 -06:00
|
|
|
# Copyright (C) 2023 Advanced Micro Devices. All rights reserved.
|
2022-10-11 16:06:32 +02:00
|
|
|
#
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
|
# this software and associated documentation files (the "Software"), to deal in
|
|
|
|
|
# the Software without restriction, including without limitation the rights to
|
|
|
|
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
|
# the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
|
# subject to the following conditions:
|
|
|
|
|
#
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in all
|
|
|
|
|
# copies or substantial portions of the Software.
|
|
|
|
|
#
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
|
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
|
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
|
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# Library Initialization
|
|
|
|
|
from .amdsmi_interface import amdsmi_init
|
2022-11-09 16:17:43 +01:00
|
|
|
from .amdsmi_interface import amdsmi_shut_down
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# Device Descovery
|
2023-02-25 05:30:19 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_processor_type
|
2023-02-25 05:28:40 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_processor_handles
|
2022-11-14 12:49:13 +01:00
|
|
|
from .amdsmi_interface import amdsmi_get_socket_handles
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_socket_info
|
|
|
|
|
|
2023-02-25 06:38:47 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_device_bdf
|
2023-02-25 06:52:56 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_device_uuid
|
2023-02-25 05:28:40 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # SW Version Information
|
2023-07-21 08:26:59 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_driver_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # ASIC and Bus Static Information
|
2023-02-25 07:22:16 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_asic_info
|
2022-11-09 16:17:43 +01:00
|
|
|
from .amdsmi_interface import amdsmi_get_power_cap_info
|
2023-09-22 05:10:45 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_vram_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # Microcode and VBIOS Information
|
2023-02-25 07:45:11 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_vbios_info
|
2022-10-11 16:06:32 +02:00
|
|
|
from .amdsmi_interface import amdsmi_get_fw_info
|
|
|
|
|
|
|
|
|
|
# # GPU Monitoring
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_activity
|
2023-02-25 07:47:11 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_vram_usage
|
2023-05-16 12:31:52 +02:00
|
|
|
from .amdsmi_interface import amdsmi_get_power_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_clock_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_pcie_link_status
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_pcie_link_caps
|
2023-02-27 01:18:07 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_bad_page_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # Process Information
|
2023-02-27 01:33:11 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_process_list
|
2023-02-27 01:34:28 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_process_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # ECC Error Information
|
2023-05-31 10:30:59 +02:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_total_ecc_count
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # Board Information
|
2023-02-25 07:26:18 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_board_info
|
2022-10-11 16:06:32 +02:00
|
|
|
|
|
|
|
|
# # Ras Information
|
2023-02-27 01:14:03 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_ras_block_features_enabled
|
2022-10-11 16:06:32 +02:00
|
|
|
|
2022-11-09 15:21:42 +01:00
|
|
|
# # Unsupported Functions In Virtual Environment
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_pci_bandwidth
|
|
|
|
|
from .amdsmi_interface import amdsmi_set_power_cap
|
|
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_power_profile
|
2023-02-26 20:57:22 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_clk_range
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_od_clk_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_od_volt_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_perf_level
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets
|
2023-02-27 00:56:31 -05:00
|
|
|
from .amdsmi_interface import amdsmi_reset_gpu
|
2023-02-25 08:43:44 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode
|
2023-02-25 08:29:08 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_fan_speed
|
2023-02-25 08:27:40 -05:00
|
|
|
from .amdsmi_interface import amdsmi_reset_gpu_fan
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_clk_freq
|
|
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_overdrive_level
|
2022-11-09 15:21:42 +01:00
|
|
|
|
2022-11-09 17:32:55 +01:00
|
|
|
# # Physical State Queries
|
2023-02-25 08:13:46 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_fan_rpms
|
2023-02-25 08:15:36 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_fan_speed
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_temp_metric
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_volt_metric
|
2022-11-09 17:32:55 +01:00
|
|
|
|
|
|
|
|
# # Clock, Power and Performance Query
|
2022-12-15 08:17:34 -06:00
|
|
|
from .amdsmi_interface import amdsmi_get_utilization_count
|
2023-02-25 08:41:13 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_perf_level
|
2023-02-25 08:43:44 -05:00
|
|
|
from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode
|
2023-02-27 04:05:11 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_overdrive_level
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_clk_freq
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_od_volt_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_metrics_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_od_volt_curve_regions
|
2023-09-20 14:02:45 -05:00
|
|
|
from .amdsmi_interface import amdsmi_is_gpu_power_management_enabled
|
2022-11-10 10:30:10 +01:00
|
|
|
|
2022-11-10 10:11:59 +01:00
|
|
|
# # Performance Counters
|
2023-02-27 02:00:14 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_counter_group_supported
|
2023-02-27 02:01:35 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_create_counter
|
2023-02-27 02:03:20 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_destroy_counter
|
2023-02-27 02:04:54 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_control_counter
|
2023-02-27 02:06:14 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_read_counter
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_available_counters
|
2022-11-09 15:21:42 +01:00
|
|
|
|
2022-11-10 10:30:10 +01:00
|
|
|
# # Error Query
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_ecc_count
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_ecc_enabled
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_ecc_status
|
2023-05-31 10:30:59 +02:00
|
|
|
from .amdsmi_interface import amdsmi_status_code_to_string
|
2022-11-10 10:30:10 +01:00
|
|
|
|
|
|
|
|
# # System Information Query
|
2023-02-27 01:35:46 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_compute_process_info
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_compute_process_info_by_pid
|
2023-02-27 01:44:06 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_compute_process_gpus
|
2023-02-27 02:10:20 -05:00
|
|
|
from .amdsmi_interface import amdsmi_gpu_xgmi_error_status
|
2023-02-28 01:59:12 -05:00
|
|
|
from .amdsmi_interface import amdsmi_reset_gpu_xgmi_error
|
2022-11-10 10:30:10 +01:00
|
|
|
|
2022-11-10 16:18:27 +01:00
|
|
|
# # PCIE information
|
2023-06-02 01:19:26 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_bdf_id
|
2023-02-25 07:24:40 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth
|
2023-02-25 07:39:10 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_pci_throughput
|
2023-05-21 11:38:00 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter
|
2023-02-25 07:36:54 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity
|
2022-11-10 16:18:27 +01:00
|
|
|
|
|
|
|
|
# # Power information
|
2023-02-25 07:59:27 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_energy_count
|
2022-11-10 16:18:27 +01:00
|
|
|
|
|
|
|
|
# # Memory information
|
2023-02-25 08:06:58 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_memory_total
|
2023-02-25 08:08:29 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_memory_usage
|
2023-02-25 08:11:53 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_memory_reserved_pages
|
2022-11-10 16:18:27 +01:00
|
|
|
|
2022-10-11 16:06:32 +02:00
|
|
|
# # Events
|
2022-11-09 15:38:30 +01:00
|
|
|
from .amdsmi_interface import AmdSmiEventReader
|
2022-10-11 16:06:32 +02:00
|
|
|
|
2022-11-10 15:29:32 +01:00
|
|
|
# # Device Identification information
|
2023-02-25 07:00:50 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_vendor_name
|
2023-02-25 06:58:22 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_id
|
2023-02-25 07:06:13 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_vram_vendor
|
2023-02-25 07:08:28 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_subsystem_id
|
2023-02-25 07:11:22 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_gpu_subsystem_name
|
2022-11-10 15:29:32 +01:00
|
|
|
|
|
|
|
|
# # Version information
|
2023-05-31 10:30:59 +02:00
|
|
|
from .amdsmi_interface import amdsmi_get_lib_version
|
2022-11-10 15:29:32 +01:00
|
|
|
|
|
|
|
|
# # Hardware topology query
|
|
|
|
|
from .amdsmi_interface import amdsmi_topo_get_numa_node_number
|
|
|
|
|
from .amdsmi_interface import amdsmi_topo_get_link_weight
|
2023-09-13 16:16:33 -05:00
|
|
|
from .amdsmi_interface import amdsmi_get_minmax_bandwidth_between_processors
|
2022-11-10 15:29:32 +01:00
|
|
|
from .amdsmi_interface import amdsmi_topo_get_link_type
|
|
|
|
|
from .amdsmi_interface import amdsmi_is_P2P_accessible
|
|
|
|
|
from .amdsmi_interface import amdsmi_get_xgmi_info
|
|
|
|
|
|
2022-10-11 16:06:32 +02:00
|
|
|
# # Enums
|
|
|
|
|
from .amdsmi_interface import AmdSmiInitFlags
|
|
|
|
|
from .amdsmi_interface import AmdSmiContainerTypes
|
|
|
|
|
from .amdsmi_interface import AmdSmiDeviceType
|
|
|
|
|
from .amdsmi_interface import AmdSmiMmIp
|
2022-12-28 16:11:10 +01:00
|
|
|
from .amdsmi_interface import AmdSmiFwBlock
|
2022-12-28 12:55:15 +01:00
|
|
|
from .amdsmi_interface import AmdSmiClkType
|
2022-10-11 16:06:32 +02:00
|
|
|
from .amdsmi_interface import AmdSmiTemperatureType
|
|
|
|
|
from .amdsmi_interface import AmdSmiDevPerfLevel
|
|
|
|
|
from .amdsmi_interface import AmdSmiEventGroup
|
|
|
|
|
from .amdsmi_interface import AmdSmiEventType
|
|
|
|
|
from .amdsmi_interface import AmdSmiCounterCommand
|
|
|
|
|
from .amdsmi_interface import AmdSmiEvtNotificationType
|
|
|
|
|
from .amdsmi_interface import AmdSmiTemperatureMetric
|
|
|
|
|
from .amdsmi_interface import AmdSmiVoltageMetric
|
|
|
|
|
from .amdsmi_interface import AmdSmiVoltageType
|
|
|
|
|
from .amdsmi_interface import AmdSmiPowerProfilePresetMasks
|
|
|
|
|
from .amdsmi_interface import AmdSmiGpuBlock
|
|
|
|
|
from .amdsmi_interface import AmdSmiRasErrState
|
|
|
|
|
from .amdsmi_interface import AmdSmiMemoryType
|
|
|
|
|
from .amdsmi_interface import AmdSmiFreqInd
|
|
|
|
|
from .amdsmi_interface import AmdSmiXgmiStatus
|
|
|
|
|
from .amdsmi_interface import AmdSmiMemoryPageStatus
|
|
|
|
|
from .amdsmi_interface import AmdSmiIoLinkType
|
|
|
|
|
from .amdsmi_interface import AmdSmiUtilizationCounterType
|
2023-06-01 14:46:21 +02:00
|
|
|
from .amdsmi_interface import AmdSmiProcessorType
|
2023-01-19 15:33:01 +01:00
|
|
|
|
2023-03-06 06:20:21 -06:00
|
|
|
# Exceptions
|
2022-10-11 16:06:32 +02:00
|
|
|
from .amdsmi_exception import AmdSmiLibraryException
|
|
|
|
|
from .amdsmi_exception import AmdSmiRetryException
|
|
|
|
|
from .amdsmi_exception import AmdSmiParameterException
|
|
|
|
|
from .amdsmi_exception import AmdSmiKeyException
|
|
|
|
|
from .amdsmi_exception import AmdSmiBdfFormatException
|
|
|
|
|
from .amdsmi_exception import AmdSmiTimeoutException
|
|
|
|
|
from .amdsmi_exception import AmdSmiException
|
|
|
|
|
from .amdsmi_exception import AmdSmiRetCode
|