Enable RDC topology feature

1.Add topology APIs
2.Add topology example for topology API usage

Change-Id: Ib79c06d0bac85119672f194ba685ebf25029979c
Cette révision appartient à :
stali
2024-09-27 10:48:32 +08:00
révisé par Li, Star
Parent 2c61dfe2ce
révision 8bcb5f7068
19 fichiers modifiés avec 798 ajouts et 7 suppressions
+36
Voir le fichier
@@ -202,6 +202,11 @@ service RdcAPI {
// rdc_status_t rdc_health_clear(rdc_gpu_group_t group_id);
rpc ClearHealth(ClearHealthRequest) returns (ClearHealthResponse) {}
// rdc_status_t rdc_device_topology_get(
// rdc_handle_t p_rdc_handle,
// rdc_gpu_group_t group_id,
// rdc_policy_condition_t condition);
rpc GetTopology(GetTopologyRequest) returns (GetTopologyResponse) {}
}
message Empty {
@@ -684,3 +689,34 @@ message ClearHealthRequest {
message ClearHealthResponse {
uint32 status = 1;
}
message TopologyLinkInfo{
uint32 gpu_index = 1;
uint64 weight = 2;
uint64 min_bandwidth = 3;
uint64 max_bandwidth = 4;
uint64 hops = 5;
enum LinkType {
RDC_IOLINK_TYPE_UNDEFINED = 0;
RDC_IOLINK_TYPE_PCIEXPRESS = 1;
RDC_IOLINK_TYPE_XGMI = 2;
RDCI_IOLINK_TYPE_NUMIOLINKTYPES = 3;
};
LinkType link_type = 6;
bool p2p_accessible = 7;
}
message Topology{
uint32 num_of_gpus = 1;
repeated TopologyLinkInfo link_infos = 2;
uint32 numa_node = 3;
}
message GetTopologyResult {
uint32 status = 1;
}
message GetTopologyRequest {
uint32 gpu_index = 1;
}
message GetTopologyResponse {
uint32 status = 1;
Topology toppology = 2;
}