Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions easybuild/easyblocks/l/lammps.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from easybuild.tools.filetools import copy_dir, copy_file, mkdir, read_file, which
from easybuild.tools.modules import get_software_root, get_software_version
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.systemtools import AARCH64, get_cpu_architecture, get_shared_lib_ext, get_avail_core_count
from easybuild.tools.systemtools import AARCH64, get_cpu_architecture, get_shared_lib_ext, get_avail_core_count, get_gpu_info
from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC

from easybuild.easyblocks.generic.cmakemake import CMakeMake
Expand Down Expand Up @@ -509,6 +509,15 @@ def configure_step(self, **kwargs):
else:
self.cfg['runtest'] = False

if self.cuda:
gpus = get_gpu_info()
if 'NVIDIA' not in gpus:
ld_preload = os.getenv('LD_PRELOAD', '')
cuda_root = get_software_root('CUDA')
libcuda = cuda_root + '/stubs/lib/libcuda.so' + ':' + cuda_root + '/stubs/lib/libcuda.so.1'
ld_preload = libcuda + ":" + ld_preload
env.setvar('LD_PRELOAD', ld_preload)

return super().configure_step()

def install_step(self):
Expand Down Expand Up @@ -563,7 +572,13 @@ def test_step(self):
test_cmd = 'ctest'
if LooseVersion(self.cmake_version) >= '3.17.0':
test_cmd += ' --no-tests=error'
test_cmd += ' -LE unstable -E "TestMliapPyUnified|AtomicPairStyle:meam_spline|KSpaceStyle:scafacos.*"'
skipped_tests = "TestMliapPyUnified|AtomicPairStyle:meam_spline|KSpaceStyle:scafacos.*"
if self.cuda:
gpus = get_gpu_info()
if 'NVIDIA' not in gpus:
# These tests require libcuda.so that is not a stub
skipped_tests += "|LibraryOpen|LibraryProperties|LammpsClass|NeighborClass"
test_cmd += ' -LE unstable -E "%s"' % skipped_tests
self.log.debug(f"Running tests using test_cmd = '{test_cmd}' as test_cmd")
self.cfg['test_cmd'] = test_cmd

Expand Down
Loading