From 761348a3af3d973a789f614ba4b433210f039229 Mon Sep 17 00:00:00 2001 From: arjun-raj-kuppala <60718144+arjun-raj-kuppala@users.noreply.github.com> Date: Sun, 18 Oct 2020 21:01:25 -0700 Subject: AMD ROCm rccl - numa.h issue fix (#19317) --- var/spack/repos/builtin/packages/hip/package.py | 11 +++++++++++ .../builtin/packages/rccl/0001-Fix-numactl-path-issue.patch | 13 +++++++++++++ var/spack/repos/builtin/packages/rccl/package.py | 13 ++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/rccl/0001-Fix-numactl-path-issue.patch (limited to 'var') 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 -- cgit v1.2.3-70-g09d2