The Memory Partition Functions

The Memory Partition Functions#

ROCmSMI: The Memory Partition Functions
The Memory Partition Functions

Functions

rsmi_status_t rsmi_dev_memory_partition_get (uint32_t dv_ind, char *memory_partition, uint32_t len)
 Retrieves the current memory partition for a desired device. More...
 
rsmi_status_t rsmi_dev_memory_partition_capabilities_get (uint32_t dv_ind, char *memory_partition_caps, uint32_t len)
 Retrieves the available memory partition capabilities for a desired device. More...
 
rsmi_status_t rsmi_dev_memory_partition_set (uint32_t dv_ind, rsmi_memory_partition_type_t memory_partition)
 Modifies a selected device's current memory partition setting. More...
 

Detailed Description

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

Function Documentation

◆ rsmi_dev_memory_partition_get()

rsmi_status_t rsmi_dev_memory_partition_get ( uint32_t  dv_ind,
char *  memory_partition,
uint32_t  len 
)

Retrieves the current memory partition for a desired device.

Given a device index dv_ind 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]dv_inda device index
[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
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_UNEXPECTED_DATAdata provided to function is not valid
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function
RSMI_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.

◆ rsmi_dev_memory_partition_capabilities_get()

rsmi_status_t rsmi_dev_memory_partition_capabilities_get ( uint32_t  dv_ind,
char *  memory_partition_caps,
uint32_t  len 
)

Retrieves the available memory partition capabilities for a desired device.

Given a device index dv_ind and a string memory_partition_caps , and uint32 len , this function will attempt to obtain the device's available memory partition capabilities string. Upon successful retreival, the obtained device's available memory partition capablilities string shall be stored in the passed memory_partition_caps char string variable.

Parameters
[in]dv_inda device index
[in,out]memory_partition_capsa pointer to a char string variable, which the device's available memory partition capabilities will be written to.
[in]lenthe length of the caller provided buffer len , suggested length is 30 or greater.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_UNEXPECTED_DATAdata provided to function is not valid
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function
RSMI_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.

◆ rsmi_dev_memory_partition_set()

rsmi_status_t rsmi_dev_memory_partition_set ( uint32_t  dv_ind,
rsmi_memory_partition_type_t  memory_partition 
)

Modifies a selected device's current memory partition setting.

Given a device index dv_ind and a type of memory partition memory_partition, this function will attempt to update the selected device's memory partition setting.

Parameters
[in]dv_inda device index
[in]memory_partitionusing enum rsmi_memory_partition_type_t, define what the selected device's current mode setting should be updated to.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_PERMISSIONfunction requires root access
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function
RSMI_STATUS_AMDGPU_RESTART_ERRcould not successfully restart the amdgpu driver
RSMI_STATUS_BUSYA resource or mutex could not be acquired because it is already being used - device is busy