diff --git a/CHANGELOG.md b/CHANGELOG.md index f3495035e1..4934ecfb79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr ### Changed +- N/A + +### Removed + +- **Removed `amdsmi_get_power_info_v2()` **. + - The amdsmi_get_power_info() has been unified and the v2 function is no longer needed/used. - **Updated `amdsmi_bdf_t` in `amdsmi.h`.** - The `amdsmi_bdf_t` union was changed to have an identical unnamed struct for backwards compatiblity - **The `amdsmi_get_gpu_vram_info` command gets the vendor name from the driver instead of using an emun to identify vendor.** diff --git a/include/amd_smi/amdsmi.h b/include/amd_smi/amdsmi.h index 650cdf1e94..9123f74afd 100644 --- a/include/amd_smi/amdsmi.h +++ b/include/amd_smi/amdsmi.h @@ -6215,27 +6215,6 @@ amdsmi_get_gpu_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios amdsmi_status_t amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info); -/** - * @brief Returns the current power and voltage of the GPU. - * - * @ingroup tagGPUMonitor - * - * @platform{gpu_bm_linux} @platform{guest_windows} - * - * @note amdsmi_power_info_t::socket_power metric can rarely spike above the socket power limit in some cases - * - * @param[in] processor_handle PF of a processor for which to query - * - * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. - * If a processor has more than one sensor, it could be greater than 0. - * Parameter @p sensor_ind is unused on @platform{host}. - * - * @param[out] info Reference to the gpu power structure. Must be allocated by user. - * - * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail - */ -amdsmi_status_t amdsmi_get_power_info_v2(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_info_t *info); - /** * @brief Returns the current power and voltage of the GPU. * diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index d8fbbcb2a4..12c39e7da0 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -2651,11 +2651,8 @@ def amdsmi_get_gpu_driver_info( return driver_info -# NOTE: this uses amdsmi_get_power_info_v2 under the hood because the C api -# needs to be backwards compatible def amdsmi_get_power_info( - processor_handle: amdsmi_wrapper.amdsmi_processor_handle, - sensor_ind: int = 0 + processor_handle: amdsmi_wrapper.amdsmi_processor_handle ) -> Dict[str, ctypes.c_uint32]: if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( @@ -2664,8 +2661,8 @@ def amdsmi_get_power_info( power_measure = amdsmi_wrapper.amdsmi_power_info_t() _check_res( - amdsmi_wrapper.amdsmi_get_power_info_v2( - processor_handle, sensor_ind, ctypes.byref(power_measure) + amdsmi_wrapper.amdsmi_get_power_info( + processor_handle, ctypes.byref(power_measure) ) ) diff --git a/py-interface/amdsmi_wrapper.py b/py-interface/amdsmi_wrapper.py index e610d2df93..5e449bd0de 100644 --- a/py-interface/amdsmi_wrapper.py +++ b/py-interface/amdsmi_wrapper.py @@ -2814,9 +2814,6 @@ amdsmi_get_gpu_vbios_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(st amdsmi_get_gpu_activity = _libraries['libamd_smi.so'].amdsmi_get_gpu_activity amdsmi_get_gpu_activity.restype = amdsmi_status_t amdsmi_get_gpu_activity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_engine_usage_t)] -amdsmi_get_power_info_v2 = _libraries['libamd_smi.so'].amdsmi_get_power_info_v2 -amdsmi_get_power_info_v2.restype = amdsmi_status_t -amdsmi_get_power_info_v2.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(struct_amdsmi_power_info_t)] amdsmi_get_power_info = _libraries['libamd_smi.so'].amdsmi_get_power_info amdsmi_get_power_info.restype = amdsmi_status_t amdsmi_get_power_info.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_amdsmi_power_info_t)] @@ -3287,7 +3284,7 @@ __all__ = \ 'amdsmi_get_link_metrics', 'amdsmi_get_link_topology_nearest', 'amdsmi_get_minmax_bandwidth_between_processors', 'amdsmi_get_pcie_info', 'amdsmi_get_power_cap_info', - 'amdsmi_get_power_info', 'amdsmi_get_power_info_v2', + 'amdsmi_get_power_info', 'amdsmi_get_processor_count_from_handles', 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', diff --git a/rust-interface/src/amdsmi.rs b/rust-interface/src/amdsmi.rs index a60f47de3b..a982268f1b 100644 --- a/rust-interface/src/amdsmi.rs +++ b/rust-interface/src/amdsmi.rs @@ -5747,60 +5747,6 @@ pub fn amdsmi_get_gpu_activity( Ok(info) } -/// Get the power information for the device with the specified processor handle. -/// -/// Given a processor handle `processor_handle`, this function retrieves the power information -/// for the specified processor. -/// -/// # Arguments -/// -/// * `processor_handle` - A handle to the processor for which the power information is being queried. -/// -/// # Returns -/// -/// * `AmdsmiResult` - Returns `Ok(AmdsmiPowerInfoT)` containing the [`AmdsmiPowerInfoT`] if successful, or an error if it fails. -/// -/// # Example -/// -/// ```rust -/// # use amdsmi::*; -/// # -/// # fn main() { -/// # // Initialize the AMD SMI library -/// # amdsmi_init(AmdsmiInitFlagsT::AmdsmiInitAmdGpus).expect("Failed to initialize AMD SMI"); -/// # -/// // Example processor_handle, assuming the number of processors is greater than zero -/// let processor_handle = amdsmi_get_processor_handles!()[0]; -/// let sensor_ind = 0 -/// -/// // Retrieve the power information -/// match amdsmi_get_power_info_v2(processor_handle, sensor_ind) { -/// Ok(info) => println!("Power information: {:?}", info), -/// Err(e) => panic!("Failed to get power information: {}", e), -/// } -/// # -/// # // Shut down the AMD SMI library -/// # amdsmi_shut_down().expect("Failed to shut down AMD SMI"); -/// # } -/// ``` -/// -/// # Errors -/// -/// This function will return the error in [`AmdsmiStatusT`] if the underlying `amdsmi_wrapper::amdsmi_get_power_info_v2` call fails. -pub fn amdsmi_get_power_info_v2( - processor_handle: AmdsmiProcessorHandle, - sensor_ind: u32, -) -> AmdsmiResult { - let mut info = MaybeUninit::::uninit(); - call_unsafe!(amdsmi_wrapper::amdsmi_get_power_info_v2( - processor_handle, - sensor_ind, - info.as_mut_ptr() - )); - let info = unsafe { info.assume_init() }; - Ok(info) -} - /// Get the power information for the device with the specified processor handle. /// /// Given a processor handle `processor_handle`, this function retrieves the power information diff --git a/rust-interface/src/amdsmi_wrapper.rs b/rust-interface/src/amdsmi_wrapper.rs index e2abcb21a5..095f76c950 100644 --- a/rust-interface/src/amdsmi_wrapper.rs +++ b/rust-interface/src/amdsmi_wrapper.rs @@ -3023,13 +3023,6 @@ extern "C" { info: *mut AmdsmiEngineUsageT, ) -> AmdsmiStatusT; } -extern "C" { - pub fn amdsmi_get_power_info_v2( - processor_handle: AmdsmiProcessorHandle, - sensor_ind: u32, - info: *mut AmdsmiPowerInfoT, - ) -> AmdsmiStatusT; -} extern "C" { pub fn amdsmi_get_power_info( processor_handle: AmdsmiProcessorHandle, diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index 3a400f2769..c25ac0c428 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -4038,10 +4038,8 @@ amdsmi_get_gpu_process_list(amdsmi_processor_handle processor_handle, uint32_t * return (max_processes_original_size >= static_cast(compute_process_list.size())) ? AMDSMI_STATUS_SUCCESS : amdsmi_status_t::AMDSMI_STATUS_OUT_OF_RESOURCES; } - amdsmi_status_t -amdsmi_get_power_info_v2(amdsmi_processor_handle processor_handle, __attribute__((unused)) uint32_t sensor_ind, amdsmi_power_info_t *info) { - +amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -4080,11 +4078,6 @@ amdsmi_get_power_info_v2(amdsmi_processor_handle processor_handle, __attribute__ return status; } -amdsmi_status_t -amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_info_t *info) { - return amdsmi_get_power_info_v2(processor_handle, 0, info); -} - amdsmi_status_t amdsmi_get_gpu_driver_info(amdsmi_processor_handle processor_handle, amdsmi_driver_info_t *info) { AMDSMI_CHECK_INIT();