Identifier Queries

Identifier Queries#

AMD SMI: Identifier Queries
Identifier Queries

Functions

amdsmi_status_t amdsmi_dev_get_id (amdsmi_device_handle device_handle, uint16_t *id)
 Get the device id associated with the device with provided device handler. More...
 
amdsmi_status_t amdsmi_dev_get_vendor_name (amdsmi_device_handle device_handle, char *name, size_t len)
 Get the name string for a give vendor ID. More...
 
amdsmi_status_t amdsmi_dev_get_vram_vendor (amdsmi_device_handle device_handle, char *brand, uint32_t len)
 Get the vram vendor string of a device. More...
 
amdsmi_status_t amdsmi_dev_get_subsystem_id (amdsmi_device_handle device_handle, uint16_t *id)
 Get the subsystem device id associated with the device with provided device handle. More...
 
amdsmi_status_t amdsmi_dev_get_subsystem_name (amdsmi_device_handle device_handle, char *name, size_t len)
 Get the name string for the device subsytem. More...
 
amdsmi_status_t amdsmi_dev_get_drm_render_minor (amdsmi_device_handle device_handle, uint32_t *minor)
 Get the drm minor number associated with this device. More...
 

Detailed Description

These functions provide identification information.

Function Documentation

◆ amdsmi_dev_get_id()

amdsmi_status_t amdsmi_dev_get_id ( amdsmi_device_handle  device_handle,
uint16_t *  id 
)

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

Given a device handle device_handle 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. amdsmi_dev_get_pci_id() should be used to get a unique identifier.

Parameters
[in]device_handlea device handle
[in,out]ida pointer to uint64_t to which the device id 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_dev_get_vendor_name()

amdsmi_status_t amdsmi_dev_get_vendor_name ( amdsmi_device_handle  device_handle,
char *  name,
size_t  len 
)

Get the name string for a give vendor ID.

Given a device handle device_handle, 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]device_handlea device handle
[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 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]lenthe length of the caller provided buffer name.
Note
AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_vram_vendor()

amdsmi_status_t amdsmi_dev_get_vram_vendor ( amdsmi_device_handle  device_handle,
char *  brand,
uint32_t  len 
)

Get the vram vendor string of a device.

This function retrieves the vram vendor name given a device handle device_handle, 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 amdsmi_dev_get_vram_vendor, then this function will return the string 'unknown' instead of the vram vendor.

Parameters
[in]device_handlea device handle
[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.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_subsystem_id()

amdsmi_status_t amdsmi_dev_get_subsystem_id ( amdsmi_device_handle  device_handle,
uint16_t *  id 
)

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

Given a device handle device_handle 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]device_handlea device handle
[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 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_dev_get_subsystem_name()

amdsmi_status_t amdsmi_dev_get_subsystem_name ( amdsmi_device_handle  device_handle,
char *  name,
size_t  len 
)

Get the name string for the device subsytem.

Given a device handle device_handle, 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]device_handlea device handle
[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 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]lenthe length of the caller provided buffer name.
Note
AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if len bytes is not large enough to hold the entire name. In this case, only len bytes will be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_dev_get_drm_render_minor()

amdsmi_status_t amdsmi_dev_get_drm_render_minor ( amdsmi_device_handle  device_handle,
uint32_t *  minor 
)

Get the drm minor number associated with this device.

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

Parameters
[in]device_handlea device handle
[in,out]minora pointer to a uint32_t into which minor number will be copied
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail