Memory Queries#
Functions | |
| rsmi_status_t | rsmi_dev_memory_total_get (uint32_t dv_ind, rsmi_memory_type_t mem_type, uint64_t *total) |
| Get the total amount of memory that exists. More... | |
| rsmi_status_t | rsmi_dev_memory_usage_get (uint32_t dv_ind, rsmi_memory_type_t mem_type, uint64_t *used) |
| Get the current memory usage. More... | |
| rsmi_status_t | rsmi_dev_memory_busy_percent_get (uint32_t dv_ind, uint32_t *busy_percent) |
| Get percentage of time any device memory is being used. More... | |
| rsmi_status_t | rsmi_dev_memory_reserved_pages_get (uint32_t dv_ind, uint32_t *num_pages, rsmi_retired_page_record_t *records) |
| Get information about reserved ("retired") memory pages. More... | |
Detailed Description
These functions provide information about memory systems.
Function Documentation
◆ rsmi_dev_memory_total_get()
| rsmi_status_t rsmi_dev_memory_total_get | ( | uint32_t | dv_ind, |
| rsmi_memory_type_t | mem_type, | ||
| uint64_t * | total | ||
| ) |
Get the total amount of memory that exists.
Given a device index dv_ind, a type of memory mem_type, and a pointer to a uint64_t total, this function will write the total amount of mem_type memory that exists to the location pointed to by total.
- Parameters
-
[in] dv_ind a device index [in] mem_type The type of memory for which the total amount will be found [in,out] total a pointer to uint64_t to which the total amount of memory will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_memory_usage_get()
| rsmi_status_t rsmi_dev_memory_usage_get | ( | uint32_t | dv_ind, |
| rsmi_memory_type_t | mem_type, | ||
| uint64_t * | used | ||
| ) |
Get the current memory usage.
Given a device index dv_ind, a type of memory mem_type, and a pointer to a uint64_t usage, this function will write the amount of mem_type memory that that is currently being used to the location pointed to by used.
- Parameters
-
[in] dv_ind a device index [in] mem_type The type of memory for which the amount being used will be found [in,out] used a pointer to uint64_t to which the amount of memory currently being used will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_memory_busy_percent_get()
| rsmi_status_t rsmi_dev_memory_busy_percent_get | ( | uint32_t | dv_ind, |
| uint32_t * | busy_percent | ||
| ) |
Get percentage of time any device memory is being used.
Given a device index dv_ind, this function returns the percentage of time that any device memory is being used for the specified device.
- Parameters
-
[in] dv_ind a device index [in,out] busy_percent a pointer to the uint32_t to which the busy percent will be written If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
◆ rsmi_dev_memory_reserved_pages_get()
| rsmi_status_t rsmi_dev_memory_reserved_pages_get | ( | uint32_t | dv_ind, |
| uint32_t * | num_pages, | ||
| rsmi_retired_page_record_t * | records | ||
| ) |
Get information about reserved ("retired") memory pages.
Given a device index dv_ind, this function returns retired page information records corresponding to the device with the provided device index dv_ind. The number of retired page records is returned through num_pages. records may be NULL on input. In this case, the number of records available for retrieval will be returned through num_pages.
- Parameters
-
[in] dv_ind a device index [in,out] num_pages a pointer to a uint32. As input, the value passed through this parameter is the number of rsmi_retired_page_record_t's that may be safely written to the memory pointed to by records. This is the limit on how many records will be written torecords. On return,num_pageswill contain the number of records written torecords, or the number of records that could have been written if enough memory had been provided. If this parameter is nullptr, this function will return RSMI_STATUS_INVALID_ARGS if the function is supported with the provided, arguments and RSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.[in,out] records A pointer to a block of memory to which the rsmi_retired_page_record_t values will be written. This value may be NULL. In this case, this function can be used to query how many records are available to read.
- Return values
-
RSMI_STATUS_SUCCESS call was successful RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not support this function with the given arguments RSMI_STATUS_INVALID_ARGS the provided arguments are not valid RSMI_STATUS_INSUFFICIENT_SIZE is returned if more records were available than allowed by the provided, allocated memory.