Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/nccl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Badger <eric@badgerio.us>2020-08-03 22:38:07 +0300
committerEric Badger <eric@badgerio.us>2020-08-05 22:46:29 +0300
commit700c0e0f243b5c819d7e8f3b7983d9f0f523d011 (patch)
tree2b2a80cb040c070a6804a69ef986c9be01e852ff
parent033d799524fb97629af5ac2f609de367472b2696 (diff)
Don't require NIC devices to have specific PCI class
If a PCI node is the parent of a NIC, treat it as such, regardless of the PCI class code for the device. This allows non-traditional devices to act as NICs via the net plugin mechanism. For consistency, treat GPUs similarly.
-rw-r--r--src/graph/topo.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/graph/topo.cc b/src/graph/topo.cc
index ed79e09..a917340 100644
--- a/src/graph/topo.cc
+++ b/src/graph/topo.cc
@@ -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;
- NCCLCHECK(xmlGetSub(xmlPci, "gpu", &xmlGpu));
- if (xmlGpu == NULL) return ncclSuccess;
+ struct ncclXmlNode* xmlGpu = NULL;
+ NCCLCHECK(xmlGetSub(xmlPci, "gpu", &xmlGpu));
+ 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;
- NCCLCHECK(xmlGetSub(xmlPci, "nic", &xmlNic));
- if (xmlNic == NULL) return ncclSuccess;
-
+ struct ncclXmlNode* xmlNic = NULL;
+ NCCLCHECK(xmlGetSub(xmlPci, "nic", &xmlNic));
+ if (xmlNic != NULL) {
+ type = NIC;
// Ignore sub device ID and merge multi-port NICs into one PCI device.
busId &= 0xfffffffffffffff0;
struct ncclTopoNode* nicNode = NULL;