Identifier Queries

Identifier Queries#

AMD SMI: Identifier Queries
Identifier Queries

Functions

amdsmi_status_t amdsmi_get_gpu_id (amdsmi_processor_handle processor_handle, uint16_t *id)
 Get the device id associated with the device with provided device handler. More...
 
amdsmi_status_t amdsmi_get_gpu_revision (amdsmi_processor_handle processor_handle, uint16_t *revision)
 Get the device revision associated with the device. More...
 
amdsmi_status_t amdsmi_get_gpu_vendor_name (amdsmi_processor_handle processor_handle, char *name, size_t len)
 Get the name string for a give vendor ID. More...
 
amdsmi_status_t amdsmi_get_gpu_vram_vendor (amdsmi_processor_handle processor_handle, char *brand, uint32_t len)
 Get the vram vendor string of a device. More...
 
amdsmi_status_t amdsmi_get_gpu_subsystem_id (amdsmi_processor_handle processor_handle, uint16_t *id)
 Get the subsystem device id associated with the device with provided processor handle. More...
 
amdsmi_status_t amdsmi_get_gpu_subsystem_name (amdsmi_processor_handle processor_handle, char *name, size_t len)
 Get the name string for the device subsytem. More...
 

Detailed Description

These functions provide identification information.

Function Documentation

◆ amdsmi_get_gpu_id()

amdsmi_status_t amdsmi_get_gpu_id ( amdsmi_processor_handle  processor_handle,
uint16_t *  id 
)

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

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_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_get_gpu_bdf_id() should be used to get a unique identifier.

Parameters
[in]processor_handlea processor 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_get_gpu_revision()

amdsmi_status_t amdsmi_get_gpu_revision ( amdsmi_processor_handle  processor_handle,
uint16_t *  revision 
)

Get the device revision associated with the device.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_handle and a pointer to a uint16_t revision to which the revision id will be written

Parameters
[in]processor_handlea processor handle
[out]revisiona pointer to uint16_t to which the device revision will be written
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_gpu_vendor_name()

amdsmi_status_t amdsmi_get_gpu_vendor_name ( amdsmi_processor_handle  processor_handle,
char *  name,
size_t  len 
)

Get the name string for a give vendor ID.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_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]processor_handlea processor 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_get_gpu_vram_vendor()

amdsmi_status_t amdsmi_get_gpu_vram_vendor ( amdsmi_processor_handle  processor_handle,
char *  brand,
uint32_t  len 
)

Get the vram vendor string of a device.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

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

Parameters
[in]processor_handlea processor 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_get_gpu_subsystem_id()

amdsmi_status_t amdsmi_get_gpu_subsystem_id ( amdsmi_processor_handle  processor_handle,
uint16_t *  id 
)

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

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_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]processor_handlea processor 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_get_gpu_subsystem_name()

amdsmi_status_t amdsmi_get_gpu_subsystem_name ( amdsmi_processor_handle  processor_handle,
char *  name,
size_t  len 
)

Get the name string for the device subsytem.

Platform:

gpu_bm_linux

guest_1vf

guest_mvf

Given a processor handle processor_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]processor_handlea processor 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