Memory Queries

Memory Queries#

AMD SMI: Memory Queries
Memory Queries

Functions

amdsmi_status_t amdsmi_get_gpu_memory_total (amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total)
 Get the total amount of memory that exists. More...
 
amdsmi_status_t amdsmi_get_gpu_memory_usage (amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used)
 Get the current memory usage. More...
 
amdsmi_status_t amdsmi_get_gpu_bad_page_info (amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info)
 Get the bad pages of a processor. It is not supported on virtual machine guest. More...
 
amdsmi_status_t amdsmi_get_gpu_ras_feature_info (amdsmi_processor_handle processor_handle, amdsmi_ras_feature_t *ras_feature)
 Returns RAS features info. More...
 
amdsmi_status_t amdsmi_get_gpu_ras_block_features_enabled (amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state)
 Returns if RAS features are enabled or disabled for given block. It is not supported on virtual machine guest. More...
 
amdsmi_status_t amdsmi_get_gpu_memory_reserved_pages (amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records)
 Get information about reserved ("retired") memory pages. It is not supported on virtual machine guest. More...
 

Detailed Description

These functions provide information about memory systems.

Function Documentation

◆ amdsmi_get_gpu_memory_total()

amdsmi_status_t amdsmi_get_gpu_memory_total ( amdsmi_processor_handle  processor_handle,
amdsmi_memory_type_t  mem_type,
uint64_t *  total 
)

Get the total amount of memory that exists.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_handle, 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]processor_handlea processor handle
[in]mem_typeThe type of memory for which the total amount will be found
[in,out]totala pointer to uint64_t to which the total amount of memory will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_memory_usage()

amdsmi_status_t amdsmi_get_gpu_memory_usage ( amdsmi_processor_handle  processor_handle,
amdsmi_memory_type_t  mem_type,
uint64_t *  used 
)

Get the current memory usage.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

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]processor_handlea processor handle
[in]mem_typeThe type of memory for which the amount being used will be found
[in,out]useda 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 AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_bad_page_info()

amdsmi_status_t amdsmi_get_gpu_bad_page_info ( amdsmi_processor_handle  processor_handle,
uint32_t *  num_pages,
amdsmi_retired_page_record_t info 
)

Get the bad pages of a processor. It is not supported on virtual machine guest.

Platform:

gpu_bm_linux

host

This call will query the device processor_handle for the number of bad pages (written to num_pages address). The results are written to address held by the info pointer. The first call to this API returns the number of bad pages which should be used to allocate the buffer that should contain the bad page records.

Parameters
[in]processor_handlea processor handle
[out]num_pagesNumber of bad page records.
[out]infoThe results will be written to the amdsmi_retired_page_record_t pointer.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_ras_feature_info()

amdsmi_status_t amdsmi_get_gpu_ras_feature_info ( amdsmi_processor_handle  processor_handle,
amdsmi_ras_feature_t ras_feature 
)

Returns RAS features info.

Platform:

gpu_bm_linux

host

Parameters
[in]processor_handleDevice handle which to query
[out]ras_featureRAS features that are currently enabled and supported on the processor. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_ras_block_features_enabled()

amdsmi_status_t amdsmi_get_gpu_ras_block_features_enabled ( amdsmi_processor_handle  processor_handle,
amdsmi_gpu_block_t  block,
amdsmi_ras_err_state_t state 
)

Returns if RAS features are enabled or disabled for given block. It is not supported on virtual machine guest.

Platform:
gpu_bm_linux

Given a processor handle processor_handle, this function queries the state of RAS features for a specific block block. Result will be written to address held by pointer state.

Parameters
[in]processor_handleDevice handle which to query
[in]blockBlock which to query
[in,out]stateA pointer to amdsmi_ras_err_state_t to which the state of block will be written. If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_memory_reserved_pages()

amdsmi_status_t amdsmi_get_gpu_memory_reserved_pages ( amdsmi_processor_handle  processor_handle,
uint32_t *  num_pages,
amdsmi_retired_page_record_t records 
)

Get information about reserved ("retired") memory pages. It is not supported on virtual machine guest.

Platform:
gpu_bm_linux

Given a processor handle processor_handle, this function returns retired page information records corresponding to the device with the provided processor handle processor_handle. 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]processor_handlea processor handle
[in,out]num_pagesa pointer to a uint32. As input, the value passed through this parameter is the number of amdsmi_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 to records. On return, num_pages will contain the number of records written to records, 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 AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
[in,out]recordsA pointer to a block of memory to which the amdsmi_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.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail