From 81859fa73c2838c2098dcf0580e18aba9d5a1975 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Tue, 23 Sep 2025 15:29:57 +0200 Subject: [PATCH 01/19] Upadate LAMMPS pre-configure hook to disable SIMD for ARM + CUDA Signed-off-by: laraPPr --- eb_hooks.py | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index adcafc72..050a93a1 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -929,22 +929,46 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") -def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs): +def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): """ pre-configure hook for LAMMPS: - set kokkos_arch on x86_64/amd/zen4 + - Disable SIMD for Aarch64 + cuda builds """ - + + # Get cpu_target for zen4 hook cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') + + # Get the dependencies to check CUDA + deps = self.cfg.dependencies() + cuda_versions = ('12.1.1') + if self.name == 'LAMMPS': - if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): - if get_cpu_architecture() == X86_64: - if cpu_target == CPU_TARGET_ZEN4: - # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 - self.cfg['kokkos_arch'] = 'ZEN3' - else: - raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") + # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 + if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): + if get_cpu_architecture() == X86_64: + if cpu_target == CPU_TARGET_ZEN4: + # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 + self.cfg['kokkos_arch'] = 'ZEN3' + + # Disable SIMD for specific CUDA versions + if self.version == '2Aug2023_update2': + if get_cpu_architecture() == AARCH64: + if ('CUDA' in [dep['name'] for dep in deps]): + for dep in deps: + if 'CUDA' == dep['name']: + if dep['version'] in cuda_version: + cxxflags = os.getenv('CXXFLAGS', '') + cxxflags = cxxflags.replace('-mcpu=native', '') + # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. + # This is not the case for newer versions. + cxxflags += ' -march=armv8-a+nosimd' + self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) + env.setvar('CXXFLAGS', cxxflags) + + else: + raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") def pre_configure_hook_cmake_system(self, *args, **kwargs): """ @@ -1502,7 +1526,7 @@ def post_easyblock_hook(self, *args, **kwargs): 'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep, 'OpenBLAS': pre_configure_hook_openblas_optarch_generic, 'WRF': pre_configure_hook_wrf_aarch64, - 'LAMMPS': pre_configure_hook_LAMMPS_zen4, + 'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda, 'Score-P': pre_configure_hook_score_p, 'VSEARCH': pre_configure_hook_vsearch, 'CMake': pre_configure_hook_cmake_system, From fa18458405130f358213053d56022fa11a65ebf3 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Tue, 23 Sep 2025 15:41:43 +0200 Subject: [PATCH 02/19] remove trailing whitespaces --- eb_hooks.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 050a93a1..7c0e42b7 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -933,25 +933,25 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): """ pre-configure hook for LAMMPS: - set kokkos_arch on x86_64/amd/zen4 - - Disable SIMD for Aarch64 + cuda builds + - Disable SIMD for Aarch64 + cuda builds """ - + # Get cpu_target for zen4 hook cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - + # Get the dependencies to check CUDA deps = self.cfg.dependencies() cuda_versions = ('12.1.1') - + if self.name == 'LAMMPS': - # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 + # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): if get_cpu_architecture() == X86_64: if cpu_target == CPU_TARGET_ZEN4: # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 self.cfg['kokkos_arch'] = 'ZEN3' - + # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': if get_cpu_architecture() == AARCH64: @@ -961,12 +961,12 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): if dep['version'] in cuda_version: cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') - # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. + # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. # This is not the case for newer versions. cxxflags += ' -march=armv8-a+nosimd' self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) env.setvar('CXXFLAGS', cxxflags) - + else: raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") From 22db16bc625848f8aec36463ed0df60f8d3d078b Mon Sep 17 00:00:00 2001 From: laraPPr Date: Tue, 23 Sep 2025 15:48:57 +0200 Subject: [PATCH 03/19] fix python syntax Signed-off-by: laraPPr --- eb_hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 7c0e42b7..0a194cec 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -967,8 +967,8 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) env.setvar('CXXFLAGS', cxxflags) - else: - raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") + else: + raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") def pre_configure_hook_cmake_system(self, *args, **kwargs): """ From 821a181ec4661f14ef2a5f9ca8e4812e77e7613e Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 09:52:11 +0200 Subject: [PATCH 04/19] fix variable in eb_hooks Signed-off-by: laraPPr --- eb_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 0a194cec..38e063c8 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -958,7 +958,7 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): if ('CUDA' in [dep['name'] for dep in deps]): for dep in deps: if 'CUDA' == dep['name']: - if dep['version'] in cuda_version: + if dep['version'] in cuda_versions: cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. From ba2b4c1f93bd2f9cec4151ee18ffa7fb7145938b Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 10:41:11 +0200 Subject: [PATCH 05/19] newer archspec is used so need to set kokkos_arch for nvidia grace Signed-off-by: laraPPr --- eb_hooks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index bde66c35..0d971b47 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1025,6 +1025,9 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): if cpu_target == CPU_TARGET_ZEN4: # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 self.cfg['kokkos_arch'] = 'ZEN3' + elif cpu_target == CPU_TARGET_NVIDIA_GRACE: + # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 + self.cfg['kokkos_arch'] 'ARMV81' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From a6452f804fe8e97ce5bc61b7288ad7b790d2c6dd Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 10:50:42 +0200 Subject: [PATCH 06/19] fix LAMMPS pre-configure hook Signed-off-by: laraPPr --- eb_hooks.py | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 0d971b47..0aa4e69b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1006,7 +1006,7 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): """ pre-configure hook for LAMMPS: - - set kokkos_arch on x86_64/amd/zen4 + - set kokkos_arch on x86_64/amd/zen4 and aarch64/nvidia/grace - Disable SIMD for Aarch64 + cuda builds """ @@ -1019,30 +1019,31 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): if self.name == 'LAMMPS': - # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 - if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): - if get_cpu_architecture() == X86_64: - if cpu_target == CPU_TARGET_ZEN4: - # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 - self.cfg['kokkos_arch'] = 'ZEN3' - elif cpu_target == CPU_TARGET_NVIDIA_GRACE: - # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 - self.cfg['kokkos_arch'] 'ARMV81' - - # Disable SIMD for specific CUDA versions - if self.version == '2Aug2023_update2': - if get_cpu_architecture() == AARCH64: - if ('CUDA' in [dep['name'] for dep in deps]): - for dep in deps: - if 'CUDA' == dep['name']: - if dep['version'] in cuda_versions: - cxxflags = os.getenv('CXXFLAGS', '') - cxxflags = cxxflags.replace('-mcpu=native', '') - # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. - # This is not the case for newer versions. - cxxflags += ' -march=armv8-a+nosimd' - self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) - env.setvar('CXXFLAGS', cxxflags) + # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 + if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): + if get_cpu_architecture() == X86_64: + if cpu_target == CPU_TARGET_ZEN4: + # There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3 + self.cfg['kokkos_arch'] = 'ZEN3' + elif get_cpu_architecture() == AARCH64: + if cpu_target == CPU_TARGET_NVIDIA_GRACE: + # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 + self.cfg['kokkos_arch'] = 'ARMV81' + + # Disable SIMD for specific CUDA versions + if self.version == '2Aug2023_update2': + if get_cpu_architecture() == AARCH64: + if ('CUDA' in [dep['name'] for dep in deps]): + for dep in deps: + if 'CUDA' == dep['name']: + if dep['version'] in cuda_versions: + cxxflags = os.getenv('CXXFLAGS', '') + cxxflags = cxxflags.replace('-mcpu=native', '') + # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. + # This is not the case for newer versions. + cxxflags += ' -march=armv8-a+nosimd' + self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) + env.setvar('CXXFLAGS', cxxflags) else: raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") From 9bd9e9a14345f197bfec5806e6552bb1dd37a314 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 10:52:43 +0200 Subject: [PATCH 07/19] fix style Signed-off-by: laraPPr --- eb_hooks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eb_hooks.py b/eb_hooks.py index 0aa4e69b..2ab8195c 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1048,6 +1048,7 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): else: raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!") + def pre_configure_hook_cmake_system(self, *args, **kwargs): """ pre-configure hook for CMake built with SYSTEM toolchain: From d935d9c1a5a7c6a176d4aa82ae0fb1a69ca54479 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 12:22:56 +0200 Subject: [PATCH 08/19] fall back to ARMV7 for LAMMPS build with CUDA Signed-off-by: laraPPr --- eb_hooks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 2ab8195c..37e227d1 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1027,8 +1027,13 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ZEN3' elif get_cpu_architecture() == AARCH64: if cpu_target == CPU_TARGET_NVIDIA_GRACE: - # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 - self.cfg['kokkos_arch'] = 'ARMV81' + # There is no support for NVIDA grace in LAMMPS yet so falling back to older kokkos_arch + if self.cuda: + # Need to fall back to ARMV7 for CUDA builds because of problem with cuda + self.cfg['kokkos_arch'] = 'ARMV7' + else: + # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 + self.cfg['kokkos_arch'] = 'ARMV81' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From 65636691614819a0adbd6068177a623fa7ce688e Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 13:47:16 +0200 Subject: [PATCH 09/19] fall back to ARMV7 for all LAMMPS build with CUDA on ARM Signed-off-by: laraPPr --- eb_hooks.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 37e227d1..45cd29c4 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1027,13 +1027,11 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ZEN3' elif get_cpu_architecture() == AARCH64: if cpu_target == CPU_TARGET_NVIDIA_GRACE: - # There is no support for NVIDA grace in LAMMPS yet so falling back to older kokkos_arch - if self.cuda: - # Need to fall back to ARMV7 for CUDA builds because of problem with cuda - self.cfg['kokkos_arch'] = 'ARMV7' - else: - # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 - self.cfg['kokkos_arch'] = 'ARMV81' + # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 + self.cfg['kokkos_arch'] = 'ARMV81' + # To disable simd kokkos_arch need to be set to ARMV7 + if self.cuda: + self.cfg['kokkos_arch'] = 'ARMV7' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From 838f363cb45fce8eeee69735ec2d0b6011f72db5 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 14:45:30 +0200 Subject: [PATCH 10/19] Try to set NATIVE instead of ARMV7 Signed-off-by: laraPPr --- eb_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 45cd29c4..3bcc0f12 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1031,7 +1031,7 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ARMV81' # To disable simd kokkos_arch need to be set to ARMV7 if self.cuda: - self.cfg['kokkos_arch'] = 'ARMV7' + self.cfg['kokkos_arch'] = 'NATIVE' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From a31d4aaae2a6b4380d8537b5ce0c755af6f99f90 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 15:21:23 +0200 Subject: [PATCH 11/19] use older instructions of generic to turn of simd Signed-off-by: laraPPr --- eb_hooks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 3bcc0f12..7cbb9524 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1042,9 +1042,12 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): if dep['version'] in cuda_versions: cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') - # All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81. - # This is not the case for newer versions. - cxxflags += ' -march=armv8-a+nosimd' + if cpu_target == CPU_TARGET_AARCH64_GENERIC: + # For targets build with ARMV80 + cxxflags += ' -march=armv7-a+nosimd' + else: + # In 2Aug2023 all other targets are build with ARMV81 + cxxflags += ' -march=armv8-a+nosimd' self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) env.setvar('CXXFLAGS', cxxflags) From a119733fc1e334037d55eb9fbd34b0c392f8260a Mon Sep 17 00:00:00 2001 From: laraPPr Date: Wed, 24 Sep 2025 15:33:07 +0200 Subject: [PATCH 12/19] resolve failed configuration generic Signed-off-by: laraPPr --- eb_hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 7cbb9524..144222cc 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1003,7 +1003,7 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs): raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") -def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): +def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): """ pre-configure hook for LAMMPS: - set kokkos_arch on x86_64/amd/zen4 and aarch64/nvidia/grace @@ -1031,7 +1031,7 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ARMV81' # To disable simd kokkos_arch need to be set to ARMV7 if self.cuda: - self.cfg['kokkos_arch'] = 'NATIVE' + self.cfg['kokkos_arch'] = 'ARMV7' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': @@ -1614,7 +1614,7 @@ def post_easyblock_hook(self, *args, **kwargs): 'PMIx': pre_configure_hook_pmix_ipv6, 'PRRTE': pre_configure_hook_prrte_ipv6, 'WRF': pre_configure_hook_wrf_aarch64, - 'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda, + 'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda, 'Score-P': pre_configure_hook_score_p, 'VSEARCH': pre_configure_hook_vsearch, 'CMake': pre_configure_hook_cmake_system, From 6d145764a1a2c8f68823d38f1eb029ebbb720145 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Thu, 25 Sep 2025 11:26:59 +0200 Subject: [PATCH 13/19] Try native instead of ARMV70 Signed-off-by: laraPPr --- eb_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 144222cc..339e5de6 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1031,7 +1031,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ARMV81' # To disable simd kokkos_arch need to be set to ARMV7 if self.cuda: - self.cfg['kokkos_arch'] = 'ARMV7' + self.cfg['kokkos_arch'] = 'NATIVE' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From c2911b85e4d374f183d0a76d0e040d4152786c2a Mon Sep 17 00:00:00 2001 From: laraPPr Date: Thu, 25 Sep 2025 11:53:34 +0200 Subject: [PATCH 14/19] go back to ARMV70 Signed-off-by: laraPPr --- eb_hooks.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 339e5de6..1de99628 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1031,7 +1031,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): self.cfg['kokkos_arch'] = 'ARMV81' # To disable simd kokkos_arch need to be set to ARMV7 if self.cuda: - self.cfg['kokkos_arch'] = 'NATIVE' + self.cfg['kokkos_arch'] = 'ARMV70' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': @@ -1042,12 +1042,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): if dep['version'] in cuda_versions: cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') - if cpu_target == CPU_TARGET_AARCH64_GENERIC: - # For targets build with ARMV80 - cxxflags += ' -march=armv7-a+nosimd' - else: - # In 2Aug2023 all other targets are build with ARMV81 - cxxflags += ' -march=armv8-a+nosimd' + cxxflags += ' -march=armv8-a+nosimd' self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags) env.setvar('CXXFLAGS', cxxflags) From a6b7cfd1f61dca7292c217abe5f687302c05d767 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Thu, 25 Sep 2025 13:38:39 +0200 Subject: [PATCH 15/19] restrict the use of setting ARMV70 Signed-off-by: laraPPr --- eb_hooks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 1de99628..d2883c16 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1019,7 +1019,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): if self.name == 'LAMMPS': - # Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4 + # Set kokkos_arch for LAMMPS version which do not have support for the target architecture if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): if get_cpu_architecture() == X86_64: if cpu_target == CPU_TARGET_ZEN4: @@ -1030,8 +1030,11 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 self.cfg['kokkos_arch'] = 'ARMV81' # To disable simd kokkos_arch need to be set to ARMV7 - if self.cuda: - self.cfg['kokkos_arch'] = 'ARMV70' + if ('CUDA' in [dep['name'] for dep in deps]): + for dep in deps: + if 'CUDA' == dep['name']: + if dep['version'] in cuda_versions: + self.cfg['kokkos_arch'] = 'ARMV70' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': From 9c6129da352a1cad4efc6b5d848a4cd33b213bd2 Mon Sep 17 00:00:00 2001 From: laraPPr Date: Thu, 25 Sep 2025 13:50:12 +0200 Subject: [PATCH 16/19] move setting kokkos_arch=ARMV70 Signed-off-by: laraPPr --- eb_hooks.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index d2883c16..179c1801 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1020,6 +1020,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): if self.name == 'LAMMPS': # Set kokkos_arch for LAMMPS version which do not have support for the target architecture + # This is no longer required with easybuild 5.1.2 if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'): if get_cpu_architecture() == X86_64: if cpu_target == CPU_TARGET_ZEN4: @@ -1029,12 +1030,6 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): if cpu_target == CPU_TARGET_NVIDIA_GRACE: # There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81 self.cfg['kokkos_arch'] = 'ARMV81' - # To disable simd kokkos_arch need to be set to ARMV7 - if ('CUDA' in [dep['name'] for dep in deps]): - for dep in deps: - if 'CUDA' == dep['name']: - if dep['version'] in cuda_versions: - self.cfg['kokkos_arch'] = 'ARMV70' # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': @@ -1043,6 +1038,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): for dep in deps: if 'CUDA' == dep['name']: if dep['version'] in cuda_versions: + self.cfg['kokkos_arch'] = 'ARMV70' cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') cxxflags += ' -march=armv8-a+nosimd' From 0a4832924f0636d33a2c94a453803520d1f3ebab Mon Sep 17 00:00:00 2001 From: laraPPr Date: Thu, 25 Sep 2025 14:03:41 +0200 Subject: [PATCH 17/19] implement fix for all CUDA versions older than 13.1 Signed-off-by: laraPPr --- eb_hooks.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 179c1801..32b45a58 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1013,10 +1013,6 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): # Get cpu_target for zen4 hook cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - # Get the dependencies to check CUDA - deps = self.cfg.dependencies() - cuda_versions = ('12.1.1') - if self.name == 'LAMMPS': # Set kokkos_arch for LAMMPS version which do not have support for the target architecture @@ -1034,10 +1030,11 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): # Disable SIMD for specific CUDA versions if self.version == '2Aug2023_update2': if get_cpu_architecture() == AARCH64: - if ('CUDA' in [dep['name'] for dep in deps]): - for dep in deps: + if self.cuda: + for dep in deps = self.cfg.dependencies(): if 'CUDA' == dep['name']: - if dep['version'] in cuda_versions: + # This was broken until CUDA 13.1 + if dep['version'] < LooseVersion('13.1'): self.cfg['kokkos_arch'] = 'ARMV70' cxxflags = os.getenv('CXXFLAGS', '') cxxflags = cxxflags.replace('-mcpu=native', '') From df4a56ae31d6a03b7db84c966b43a93d81a55a41 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Fri, 26 Sep 2025 10:36:28 +0200 Subject: [PATCH 18/19] Apply suggestion from @ocaisa --- eb_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 32b45a58..24db0f99 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1031,7 +1031,7 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): if self.version == '2Aug2023_update2': if get_cpu_architecture() == AARCH64: if self.cuda: - for dep in deps = self.cfg.dependencies(): + for dep in self.cfg.dependencies(): if 'CUDA' == dep['name']: # This was broken until CUDA 13.1 if dep['version'] < LooseVersion('13.1'): From 3e5e8db3146e179d1eb7deab10305a0a69fd1b44 Mon Sep 17 00:00:00 2001 From: ocaisa Date: Fri, 26 Sep 2025 10:38:45 +0200 Subject: [PATCH 19/19] Update eb_hooks.py --- eb_hooks.py | 1 - 1 file changed, 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 24db0f99..b2d55b83 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1014,7 +1014,6 @@ def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs): cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') if self.name == 'LAMMPS': - # Set kokkos_arch for LAMMPS version which do not have support for the target architecture # This is no longer required with easybuild 5.1.2 if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'):