summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarjun-raj-kuppala <60718144+arjun-raj-kuppala@users.noreply.github.com>2020-10-18 21:01:25 -0700
committerGitHub <noreply@github.com>2020-10-18 23:01:25 -0500
commit761348a3af3d973a789f614ba4b433210f039229 (patch)
tree70a77bd58103d4c02d48882e7bd0060bc5488109
parent7d546a0145a6ebb0244ebedb3db5a75e0ee6df2c (diff)
downloadspack-761348a3af3d973a789f614ba4b433210f039229.tar.gz
spack-761348a3af3d973a789f614ba4b433210f039229.tar.bz2
spack-761348a3af3d973a789f614ba4b433210f039229.tar.xz
spack-761348a3af3d973a789f614ba4b433210f039229.zip
AMD ROCm rccl - numa.h issue fix (#19317)
-rw-r--r--var/spack/repos/builtin/packages/hip/package.py11
-rw-r--r--var/spack/repos/builtin/packages/rccl/0001-Fix-numactl-path-issue.patch13
-rw-r--r--var/spack/repos/builtin/packages/rccl/package.py13
3 files changed, 36 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py
index 7bb62f8cfd..e1893341bf 100644
--- a/var/spack/repos/builtin/packages/hip/package.py
+++ b/var/spack/repos/builtin/packages/hip/package.py
@@ -87,6 +87,17 @@ class Hip(CMakePackage):
]
filter_file(match, substitute, *files, **kwargs)
+ @run_before('install')
+ def filter_numactl(self):
+ if '@3.7.0:' in self.spec:
+ numactl = self.spec['numactl'].prefix.lib
+ kwargs = {'ignore_absent': False, 'backup': False, 'string': False}
+
+ with working_dir('bin'):
+ match = ' -lnuma'
+ substitute = " -L{numactl} -lnuma".format(numactl=numactl)
+ filter_file(match, substitute, 'hipcc', **kwargs)
+
def cmake_args(self):
args = [
'-DHIP_COMPILER=clang',
diff --git a/var/spack/repos/builtin/packages/rccl/0001-Fix-numactl-path-issue.patch b/var/spack/repos/builtin/packages/rccl/0001-Fix-numactl-path-issue.patch
new file mode 100644
index 0000000000..a984c79042
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rccl/0001-Fix-numactl-path-issue.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3bd1ce0..dc72b16 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -80,6 +80,8 @@ include_directories(src)
+ include_directories(src/include)
+ include_directories(src/collectives)
+ include_directories(src/collectives/device)
++include_directories(${NUMACTL_DIR}/include)
++link_directories(${NUMACTL_DIR}/lib)
+
+ set(CU_SOURCES
+ src/collectives/device/all_reduce.cu
diff --git a/var/spack/repos/builtin/packages/rccl/package.py b/var/spack/repos/builtin/packages/rccl/package.py
index 07825d3a2c..989723454d 100644
--- a/var/spack/repos/builtin/packages/rccl/package.py
+++ b/var/spack/repos/builtin/packages/rccl/package.py
@@ -21,13 +21,24 @@ class Rccl(CMakePackage):
version('3.7.0', sha256='8273878ff71aac2e7adf5cc8562d2933034c6c6b3652f88fbe3cd4f2691036e3')
version('3.5.0', sha256='290b57a66758dce47d0bfff3f5f8317df24764e858af67f60ddcdcadb9337253')
+ patch('0001-Fix-numactl-path-issue.patch', when='@3.7.0:')
+
depends_on('cmake@3:', type='build')
for ver in ['3.5.0', '3.7.0', '3.8.0']:
depends_on('rocm-cmake@' + ver, type='build', when='@' + ver)
- depends_on('hip@' + ver, type='build', when='@' + ver)
+ depends_on('hip@' + ver, type=('build', 'run'), when='@' + ver)
depends_on('rocm-device-libs@' + ver, type='build', when='@' + ver)
depends_on('comgr@' + ver, type='build', when='@' + ver)
depends_on('hsa-rocr-dev@' + ver, type='build', when='@' + ver)
+ if ver in ['3.7.0', '3.8.0']:
+ depends_on('numactl@2.0.12', type=('build', 'link'), when='@' + ver)
def setup_build_environment(self, env):
env.set('CXX', self.spec['hip'].hipcc)
+
+ def cmake_args(self):
+ args = []
+ if '@3.7.0:' in self.spec:
+ numactl_prefix = self.spec['numactl'].prefix
+ args.append('-DNUMACTL_DIR={0}'.format(numactl_prefix))
+ return args