NCCL: fix build on older Linux systems (#12415)
This commit is contained in:
parent
e620883a3c
commit
0f075b0cc8
@ -17,12 +17,14 @@ class Nccl(MakefilePackage):
|
||||
version('2.4.2-1', sha256='e3dd04b22eb541394bd818e5f78ac23a09cc549690d5d55d6fccc1a36155385a')
|
||||
version('2.3.7-1', sha256='e6eff80d9d2db13c61f8452e1400ca2f098d2dfe42857cb23413ce081c5b9e9b')
|
||||
version('2.3.5-5', sha256='bac9950b4d3980c25baa8e3e4541d2dfb4d21edf32ad3b89022d04920357142f')
|
||||
version('2.2', '5b9ce7fbdce0fde68e0f66318e6ff422')
|
||||
version('1.3.4-1', '5b9ce7fbdce0fde68e0f66318e6ff422')
|
||||
version('1.3.0-1', 'f6fb1d56913a7d212ca0c300e76f01fb')
|
||||
|
||||
depends_on('cuda')
|
||||
|
||||
# https://github.com/NVIDIA/nccl/issues/244
|
||||
patch('so_reuseport.patch', when='@2.3.7-1:2.4.8-1')
|
||||
|
||||
@property
|
||||
def build_targets(self):
|
||||
return ['CUDA_HOME={0}'.format(self.spec['cuda'].prefix)]
|
||||
|
16
var/spack/repos/builtin/packages/nccl/so_reuseport.patch
Normal file
16
var/spack/repos/builtin/packages/nccl/so_reuseport.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/src/include/socket.h b/src/include/socket.h
|
||||
index 68ce235..b4f09b9 100644
|
||||
--- a/src/include/socket.h
|
||||
+++ b/src/include/socket.h
|
||||
@@ -327,7 +327,11 @@ static ncclResult_t createListenSocket(int *fd, union socketAddress *localAddr)
|
||||
if (socketToPort(&localAddr->sa)) {
|
||||
// Port is forced by env. Make sure we get the port.
|
||||
int opt = 1;
|
||||
+#if defined(SO_REUSEPORT)
|
||||
SYSCHECK(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR | SO_REUSEPORT, &opt, sizeof(opt)), "setsockopt");
|
||||
+#else
|
||||
+ SYSCHECK(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)), "setsockopt");
|
||||
+#endif
|
||||
}
|
||||
|
||||
// localAddr port should be 0 (Any port)
|
Loading…
Reference in New Issue
Block a user