Collect gcnArch and hipDeviceArch_t in XML (#252)

[ROCm/rccl commit: 7e3d8a31cc]
This commit is contained in:
Wenkai Du
2020-08-12 15:48:38 -07:00
committed by GitHub
parent f309fb5b29
commit f242a2f0b0
24 changed files with 201 additions and 169 deletions
+20
View File
@@ -599,6 +599,26 @@ ncclResult_t ncclTopoGetXmlFromGpu(struct ncclXmlNode* pciNode, nvmlDevice_t nvm
int sm;
NCCLCHECK(xmlGetAttrInt(gpuNode, "sm", &sm));
int gcn;
NCCLCHECK(xmlGetAttrIndex(gpuNode, "gcn", &index));
if (index == -1) {
hipDeviceProp_t devProp;
CUDACHECK(hipGetDeviceProperties(&devProp, dev));
gcn = devProp.gcnArch;
NCCLCHECK(xmlSetAttrInt(gpuNode, "gcn", gcn));
}
NCCLCHECK(xmlGetAttrInt(gpuNode, "gcn", &gcn));
rcclHipDeviceArch_t arch;
NCCLCHECK(xmlGetAttrIndex(gpuNode, "arch", &index));
if (index == -1) {
hipDeviceProp_t devProp;
CUDACHECK(hipGetDeviceProperties(&devProp, dev));
memcpy(&arch.arch, &devProp.arch, sizeof(hipDeviceArch_t));
NCCLCHECK(xmlSetAttrInt(gpuNode, "arch", arch.value));
}
NCCLCHECK(xmlGetAttrInt(gpuNode, "arch", &arch.value));
struct ncclXmlNode* nvlNode = NULL;
NCCLCHECK(xmlGetSub(pciNode, "nvlink", &nvlNode));
if (nvlNode == NULL) {