Memory Partition Functions

Memory Partition Functions#

AMD SMI: Memory Partition Functions
Memory Partition Functions

Functions

amdsmi_status_t amdsmi_get_gpu_memory_partition (amdsmi_processor_handle processor_handle, char *memory_partition, uint32_t len)
 Retrieves the current memory partition for a desired device.
 
amdsmi_status_t amdsmi_set_gpu_memory_partition (amdsmi_processor_handle processor_handle, amdsmi_memory_partition_type_t memory_partition)
 Modifies a selected device's current memory partition setting.
 
amdsmi_status_t amdsmi_get_gpu_memory_partition_config (amdsmi_processor_handle processor_handle, amdsmi_memory_partition_config_t *config)
 Returns current gpu memory partition capabilities.
 
amdsmi_status_t amdsmi_set_gpu_memory_partition_mode (amdsmi_processor_handle processor_handle, amdsmi_memory_partition_type_t mode)
 Sets memory partition mode Set accelerator partition setting based on profile_index from amdsmi_get_gpu_accelerator_partition_profile_config.
 

Detailed Description

These functions are used to query and set the device's current memory partition.

Function Documentation

◆ amdsmi_get_gpu_memory_partition()

amdsmi_status_t amdsmi_get_gpu_memory_partition ( amdsmi_processor_handle  processor_handle,
char *  memory_partition,
uint32_t  len 
)

Retrieves the current memory partition for a desired device.

Platform:
gpu_bm_linux

Given a processor handle processor_handle and a string memory_partition , and uint32 len , this function will attempt to obtain the device's memory partition string. Upon successful retreival, the obtained device's memory partition string shall be stored in the passed memory_partition char string variable.

Parameters
[in]processor_handleDevice which to query
[in,out]memory_partitiona pointer to a char string variable, which the device's memory partition will be written to.
[in]lenthe length of the caller provided buffer memory_partition , suggested length is 5 or greater.
Return values
AMDSMI_STATUS_SUCCESScall was successful
AMDSMI_STATUS_INVALthe provided arguments are not valid
AMDSMI_STATUS_UNEXPECTED_DATAdata provided to function is not valid
AMDSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function
AMDSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire memory partition value. In this case, only len bytes will be written.
Returns
amdsmi_status_t

◆ amdsmi_set_gpu_memory_partition()

amdsmi_status_t amdsmi_set_gpu_memory_partition ( amdsmi_processor_handle  processor_handle,
amdsmi_memory_partition_type_t  memory_partition 
)

Modifies a selected device's current memory partition setting.

Platform:
gpu_bm_linux

Given a processor handle processor_handle and a type of memory partition memory_partition, this function will attempt to update the selected device's memory partition setting. This function does not allow any concurrent operations. Device must be idle and have no workloads when performing set partition operations.

On

Platform:
gpu_bm_linux AMDGPU driver restart is REQUIRED to complete updating to the new memory partition setting. Refer to amdsmi_gpu_driver_reload() for more details.
Parameters
[in]processor_handleDevice which to query
[in]memory_partitionusing enum amdsmi_memory_partition_type_t, define what the selected device's current mode setting should be updated to.
Return values
AMDSMI_STATUS_SUCCESScall was successful
::AMDSMI_STATUS_PERMISSIONfunction requires root access
AMDSMI_STATUS_INVALthe provided arguments are not valid
AMDSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function
AMDSMI_STATUS_AMDGPU_RESTART_ERRcould not successfully restart the amdgpu driver
Returns
amdsmi_status_t

◆ amdsmi_get_gpu_memory_partition_config()

amdsmi_status_t amdsmi_get_gpu_memory_partition_config ( amdsmi_processor_handle  processor_handle,
amdsmi_memory_partition_config_t config 
)

Returns current gpu memory partition capabilities.

Platform:

gpu_bm_linux

host

guest_1vf

guest_mvf

Parameters
[in]processor_handlea processor handle
[out]configreference to the memory partition config. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_gpu_memory_partition_mode()

amdsmi_status_t amdsmi_set_gpu_memory_partition_mode ( amdsmi_processor_handle  processor_handle,
amdsmi_memory_partition_type_t  mode 
)

Sets memory partition mode Set accelerator partition setting based on profile_index from amdsmi_get_gpu_accelerator_partition_profile_config.

Platform:

gpu_bm_linux

host

Given a processor handle processor_handle and a type of memory partition mode, this function will attempt to update the selected device's memory partition setting. This function does not allow any concurrent operations. Device must be idle and have no workloads when performing set partition operations.

On

Platform:
gpu_bm_linux AMDGPU driver restart is REQUIRED to complete updating to the new memory partition setting. Refer to amdsmi_gpu_driver_reload() for more details.
Parameters
[in]processor_handleA processor handle
[in]modeEnum representing memory partitioning mode to set
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail