Check fine grained memory on peer GPU before enabling P2P (#337)

This commit is contained in:
Wenkai Du
2021-03-30 09:06:39 -07:00
committato da GitHub
parent d87dc7c2e8
commit 0c78553ee0
+11
Vedi File
@@ -92,6 +92,17 @@ ncclResult_t p2pCanConnect(int* ret, struct ncclTopoSystem* topo, struct ncclTop
#endif
}
#if defined(__HIP_PLATFORM_HCC__) || defined(__HCC__) || defined(__HIPCC__)
int dev;
CUDACHECK(hipGetDevice(&dev));
CUDACHECK(hipSetDevice(cudaDev2));
if (!hasFineGrainVramPcie()) {
*ret = 0;
CUDACHECK(hipSetDevice(dev));
return ncclSuccess;
}
CUDACHECK(hipSetDevice(dev));
#endif
// Check that CUDA can do P2P
int p2p;
if (hipDeviceCanAccessPeer(&p2p, cudaDev1, cudaDev2) != hipSuccess) {