Identifier Queries

Identifier Queries#

ROCmSMI: Identifier Queries
Identifier Queries

Functions

rsmi_status_t rsmi_num_monitor_devices (uint32_t *num_devices)
 Get the number of devices that have monitor information. More...
 
rsmi_status_t rsmi_dev_id_get (uint32_t dv_ind, uint16_t *id)
 Get the device id associated with the device with provided device index. More...
 
rsmi_status_t rsmi_dev_revision_get (uint32_t dv_ind, uint16_t *revision)
 Get the device revision associated with the device. More...
 
rsmi_status_t rsmi_dev_sku_get (uint32_t dv_ind, char *sku)
 Get the SKU for a desired device associated with the device with provided device index. More...
 
rsmi_status_t rsmi_dev_vendor_id_get (uint32_t dv_ind, uint16_t *id)
 Get the device vendor id associated with the device with provided device index. More...
 
rsmi_status_t rsmi_dev_name_get (uint32_t dv_ind, char *name, size_t len)
 Get the name string of a gpu device. More...
 
rsmi_status_t rsmi_dev_brand_get (uint32_t dv_ind, char *brand, uint32_t len)
 Get the brand string of a gpu device. More...
 
rsmi_status_t rsmi_dev_vendor_name_get (uint32_t dv_ind, char *name, size_t len)
 Get the name string for a give vendor ID. More...
 
rsmi_status_t rsmi_dev_vram_vendor_get (uint32_t dv_ind, char *brand, uint32_t len)
 Get the vram vendor string of a gpu device. More...
 
rsmi_status_t rsmi_dev_serial_number_get (uint32_t dv_ind, char *serial_num, uint32_t len)
 Get the serial number string for a device. More...
 
rsmi_status_t rsmi_dev_subsystem_id_get (uint32_t dv_ind, uint16_t *id)
 Get the subsystem device id associated with the device with provided device index. More...
 
rsmi_status_t rsmi_dev_subsystem_name_get (uint32_t dv_ind, char *name, size_t len)
 Get the name string for the device subsytem. More...
 
rsmi_status_t rsmi_dev_drm_render_minor_get (uint32_t dv_ind, uint32_t *minor)
 Get the drm minor number associated with this device. More...
 
rsmi_status_t rsmi_dev_subsystem_vendor_id_get (uint32_t dv_ind, uint16_t *id)
 Get the device subsystem vendor id associated with the device with provided device index. More...
 
rsmi_status_t rsmi_dev_unique_id_get (uint32_t dv_ind, uint64_t *id)
 Get Unique ID. More...
 
rsmi_status_t rsmi_dev_xgmi_physical_id_get (uint32_t dv_ind, uint16_t *id)
 Get the XGMI physical id associated with the device. More...
 

Detailed Description

These functions provide identification information.

Function Documentation

◆ rsmi_num_monitor_devices()

rsmi_status_t rsmi_num_monitor_devices ( uint32_t *  num_devices)

Get the number of devices that have monitor information.

The number of devices which have monitors is returned. Monitors are referenced by the index which can be between 0 and num_devices - 1.

Parameters
[in,out]num_devicesCaller provided pointer to uint32_t. Upon successful call, the value num_devices will contain the number of monitor devices.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call.

◆ rsmi_dev_id_get()

rsmi_status_t rsmi_dev_id_get ( uint32_t  dv_ind,
uint16_t *  id 
)

Get the device id associated with the device with provided device index.

Given a device index dv_ind and a pointer to a uint32_t id, this function will write the device id value to the uint64_t pointed to by id. This ID is an identification of the type of device, so calling this function for different devices will give the same value if they are kind of device. Consequently, this function should not be used to distinguish one device from another. rsmi_dev_pci_id_get() should be used to get a unique identifier.

Parameters
[in]dv_inda device index
[in,out]ida pointer to uint64_t to which the device id 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_revision_get()

rsmi_status_t rsmi_dev_revision_get ( uint32_t  dv_ind,
uint16_t *  revision 
)

Get the device revision associated with the device.

Given a device index dv_ind and a pointer to a uint32_t to which the revision will be written

Parameters
[in]dv_inda device index
[in,out]revisiona pointer to uint32_t to which the device revision will be written
Return values
RSMI_STATUS_SUCCESSis returned upon successful call.

◆ rsmi_dev_sku_get()

rsmi_status_t rsmi_dev_sku_get ( uint32_t  dv_ind,
char *  sku 
)

Get the SKU for a desired device associated with the device with provided device index.

Given a device index dv_ind and a pointer to a char sku, this function will attempt to obtain the SKU from the Product Information FRU chip, present on server ASICs. It will write the sku value to the char array pointed to by sku.

Parameters
[in]dv_inda device index
[in,out]skua pointer to char to which the sku 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_vendor_id_get()

rsmi_status_t rsmi_dev_vendor_id_get ( uint32_t  dv_ind,
uint16_t *  id 
)

Get the device vendor id associated with the device with provided device index.

Given a device index dv_ind and a pointer to a uint32_t id, this function will write the device vendor id value to the uint64_t pointed to by id.

Parameters
[in]dv_inda device index
[in,out]ida pointer to uint64_t to which the device vendor id 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_name_get()

rsmi_status_t rsmi_dev_name_get ( uint32_t  dv_ind,
char *  name,
size_t  len 
)

Get the name string of a gpu device.

Given a device index dv_ind, a pointer to a caller provided char buffer name, and a length of this buffer len, this function will write the name of the device (up to len characters) to the buffer name.

If the integer ID associated with the device is not found in one of the system files containing device name information (e.g. /usr/share/misc/pci.ids), then this function will return the hex device ID as a string. Updating the system name files can be accompplished with "sudo update-pciids".

Parameters
[in]dv_inda device index
[in,out]namea pointer to a caller provided char buffer to which the name 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.
[in]lenthe length of the caller provided buffer name.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.

◆ rsmi_dev_brand_get()

rsmi_status_t rsmi_dev_brand_get ( uint32_t  dv_ind,
char *  brand,
uint32_t  len 
)

Get the brand string of a gpu device.

Given a device index dv_ind, a pointer to a caller provided char buffer brand, and a length of this buffer len, this function will write the brand of the device (up to len characters) to the buffer brand.

If the sku associated with the device is not found as one of the values contained within rsmi_dev_brand_get, then this function will return the device marketing name as a string instead of the brand name.

Parameters
[in]dv_inda device index
[in,out]branda pointer to a caller provided char buffer to which the brand 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.
[in]lenthe length of the caller provided buffer brand.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.

◆ rsmi_dev_vendor_name_get()

rsmi_status_t rsmi_dev_vendor_name_get ( uint32_t  dv_ind,
char *  name,
size_t  len 
)

Get the name string for a give vendor ID.

Given a device index dv_ind, a pointer to a caller provided char buffer name, and a length of this buffer len, this function will write the name of the vendor (up to len characters) buffer name. The id may be a device vendor or subsystem vendor ID.

If the integer ID associated with the vendor is not found in one of the system files containing device name information (e.g. /usr/share/misc/pci.ids), then this function will return the hex vendor ID as a string. Updating the system name files can be accompplished with "sudo update-pciids".

Parameters
[in]dv_inda device index
[in,out]namea pointer to a caller provided char buffer to which the name 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.
[in]lenthe length of the caller provided buffer name.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.

◆ rsmi_dev_vram_vendor_get()

rsmi_status_t rsmi_dev_vram_vendor_get ( uint32_t  dv_ind,
char *  brand,
uint32_t  len 
)

Get the vram vendor string of a gpu device.

Given a device index dv_ind, a pointer to a caller provided char buffer brand, and a length of this buffer len, this function will write the vram vendor of the device (up to len characters) to the buffer brand.

If the vram vendor for the device is not found as one of the values contained within rsmi_dev_vram_vendor_get, then this function will return the string 'unknown' instead of the vram vendor.

Parameters
[in]dv_inda device index
[in,out]branda pointer to a caller provided char buffer to which the vram vendor will be written
[in]lenthe length of the caller provided buffer brand.
Return values
RSMI_STATUS_SUCCESSis returned upon successful call.

◆ rsmi_dev_serial_number_get()

rsmi_status_t rsmi_dev_serial_number_get ( uint32_t  dv_ind,
char *  serial_num,
uint32_t  len 
)

Get the serial number string for a device.

Given a device index dv_ind, a pointer to a buffer of chars serial_num, and the length of the provided buffer len, this function will write the serial number string (up to len characters) to the buffer pointed to by serial_num.

Parameters
[in]dv_inda device index
[in,out]serial_numa pointer to caller-provided memory to which the serial number 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.
[in]lenthe length of the caller provided buffer serial_num.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.

◆ rsmi_dev_subsystem_id_get()

rsmi_status_t rsmi_dev_subsystem_id_get ( uint32_t  dv_ind,
uint16_t *  id 
)

Get the subsystem device id associated with the device with provided device index.

Given a device index dv_ind and a pointer to a uint32_t id, this function will write the subsystem device id value to the uint64_t pointed to by id.

Parameters
[in]dv_inda device index
[in,out]ida pointer to uint64_t to which the subsystem device id 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_subsystem_name_get()

rsmi_status_t rsmi_dev_subsystem_name_get ( uint32_t  dv_ind,
char *  name,
size_t  len 
)

Get the name string for the device subsytem.

Given a device index dv_ind, a pointer to a caller provided char buffer name, and a length of this buffer len, this function will write the name of the device subsystem (up to len characters) to the buffer name.

If the integer ID associated with the sub-system is not found in one of the system files containing device name information (e.g. /usr/share/misc/pci.ids), then this function will return the hex sub-system ID as a string. Updating the system name files can be accompplished with "sudo update-pciids".

Parameters
[in]dv_inda device index
[in,out]namea pointer to a caller provided char buffer to which the name 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.
[in]lenthe length of the caller provided buffer name.
Return values
RSMI_STATUS_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid
RSMI_STATUS_INSUFFICIENT_SIZEis returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.

◆ rsmi_dev_drm_render_minor_get()

rsmi_status_t rsmi_dev_drm_render_minor_get ( uint32_t  dv_ind,
uint32_t *  minor 
)

Get the drm minor number associated with this device.

Given a device index dv_ind, find its render device file /dev/dri/renderDN where N corresponds to its minor number.

Parameters
[in]dv_inda device index
[in,out]minora pointer to a uint32_t into which minor number will be copied
Return values
RSMI_STATUS_SUCCESSis returned upon successful call.
RSMI_STATUS_INIT_ERRORif failed to get minor number during initialization.
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_subsystem_vendor_id_get()

rsmi_status_t rsmi_dev_subsystem_vendor_id_get ( uint32_t  dv_ind,
uint16_t *  id 
)

Get the device subsystem vendor id associated with the device with provided device index.

Given a device index dv_ind and a pointer to a uint32_t id, this function will write the device subsystem vendor id value to the uint64_t pointed to by id.

Parameters
[in]dv_inda device index
[in,out]ida pointer to uint64_t to which the device subsystem vendor id 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_unique_id_get()

rsmi_status_t rsmi_dev_unique_id_get ( uint32_t  dv_ind,
uint64_t *  id 
)

Get Unique ID.

Given a device index dv_ind and a pointer to a uint64_t id, this function will write the unique ID of the GPU pointed to id.

Parameters
[in]dv_inda device index
[in,out]ida pointer to uint64_t to which the unique ID of the GPU is 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_SUCCESScall was successful
RSMI_STATUS_NOT_SUPPORTEDinstalled software or hardware does not support this function with the given arguments
RSMI_STATUS_INVALID_ARGSthe provided arguments are not valid

◆ rsmi_dev_xgmi_physical_id_get()

rsmi_status_t rsmi_dev_xgmi_physical_id_get ( uint32_t  dv_ind,
uint16_t *  id 
)

Get the XGMI physical id associated with the device.

Given a device index dv_ind and a pointer to a uint32_t to which the XGMI physical id will be written

Parameters
[in]dv_inda device index
[in,out]revisiona pointer to uint32_t to which the XGMI physical id will be written
Return values
RSMI_STATUS_SUCCESSis returned upon successful call.