Merge pull request #364 from badgerious/net-class
Add GPUs and NICs based on XML sub tags instead of PCI class.
This commit is contained in:
commit
3d63f89068
@ -317,21 +317,19 @@ ncclResult_t ncclTopoAddPci(struct ncclXmlNode* xmlPci, struct ncclTopoSystem* s
|
||||
NCCLCHECK(busIdToInt64(str, &busId));
|
||||
|
||||
struct ncclTopoNode* node = NULL;
|
||||
if (type == GPU) {
|
||||
struct ncclXmlNode* xmlGpu;
|
||||
struct ncclXmlNode* xmlGpu = NULL;
|
||||
NCCLCHECK(xmlGetSub(xmlPci, "gpu", &xmlGpu));
|
||||
if (xmlGpu == NULL) return ncclSuccess;
|
||||
if (xmlGpu != NULL) {
|
||||
int index;
|
||||
NCCLCHECK(xmlGetAttrIndex(xmlGpu, "rank", &index));
|
||||
if (index == -1) return ncclSuccess;
|
||||
NCCLCHECK(ncclTopoCreateNode(system, &node, type, busId));
|
||||
NCCLCHECK(ncclTopoAddGpu(xmlGpu, system, node));
|
||||
}
|
||||
if (type == NIC) {
|
||||
struct ncclXmlNode* xmlNic;
|
||||
struct ncclXmlNode* xmlNic = NULL;
|
||||
NCCLCHECK(xmlGetSub(xmlPci, "nic", &xmlNic));
|
||||
if (xmlNic == NULL) return ncclSuccess;
|
||||
|
||||
if (xmlNic != NULL) {
|
||||
type = NIC;
|
||||
// Ignore sub device ID and merge multi-port NICs into one PCI device.
|
||||
busId &= 0xfffffffffffffff0;
|
||||
struct ncclTopoNode* nicNode = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user