Collect compute partition devices under the same socket

The socket represents a physical device, and the partition devices
should belong to the socket. The partition devices are only
different in function id in BDF. Use the BD part of the BDF to
identify a socket.

Change-Id: I5d355a6f5db02faa7555b760a36c7351b8d8d835
Cette révision appartient à :
Bill(Shuzhou) Liu
2023-11-29 08:23:23 -06:00
Parent b54086a037
révision de7e74f7db
2 fichiers modifiés avec 13 ajouts et 6 suppressions
+6 -1
Voir le fichier
@@ -99,7 +99,12 @@ class AMDSmiSystem {
#endif
private:
AMDSmiSystem() : init_flag_(AMDSMI_INIT_AMD_GPUS) {}
amdsmi_status_t get_gpu_bdf_by_index(uint32_t index, std::string& bdf);
/* The GPU socket id is used to identify the socket, so that the XCDs
on the same physical device will be collected under the same socket.
The BD part of the BDF is used as GPU socket to represent a phyiscal device.
*/
amdsmi_status_t get_gpu_socket_id(uint32_t index, std::string& socketid);
amdsmi_status_t populate_amd_gpu_devices();
uint64_t init_flag_;
AMDSmiDrm drm_;