diff --git a/eb_hooks.py b/eb_hooks.py index b730493e..1b517fdf 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -125,6 +125,19 @@ def print_warning(*args, **kwargs): orig_print_warning(*args, **kwargs) +def get_cuda_cc_string(self): + # required keyword was introduce in 5.1.1 + if EASYBUILD_VERSION >= '5.1.1': + cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False) + # mimic the 'required=False' behavior pre-EB 5.1.1 + else: + try: + cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities') + except: + cuda_ccs_string = '' + return cuda_ccs_string + + def is_gcccore_1220_based(**kwargs): # ecname, ecversion, tcname, tcversion): """ @@ -760,7 +773,7 @@ def is_unsupported_module(self): cudnn_ver = get_dependency_software_version("cuDNN", ec=self.cfg, check_deps=True, check_builddeps=True) if cudnn_ver: # cuda_ccs_string is e.g. "8.0,9.0" - cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False) + cuda_ccs_string = get_cuda_cc_string(self) # cuda_ccs is empty if none are defined if cuda_ccs_string: # cuda_ccs is a comma-seperated string. Convert to list for easier handling @@ -788,7 +801,7 @@ def is_unsupported_module(self): cudaver = get_dependency_software_version("CUDA", ec=self.cfg, check_deps=True, check_builddeps=True) if cudaver: # cuda_ccs_string is e.g. "8.0,9.0" - cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False) + cuda_ccs_string = get_cuda_cc_string(self) # cuda_ccs is empty if none are defined if cuda_ccs_string: # cuda_ccs is a comma-seperated string. Convert to list for easier handling diff --git a/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh b/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh index d575f505..3421d686 100755 --- a/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh +++ b/scripts/gpu_support/nvidia/install_cuda_and_libraries.sh @@ -107,6 +107,8 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do echo_yellow ">> No EasyBuild/${eb_version} module found: skipping step to install easystack file ${easystack_file} (see output in ${module_avail_out})" continue fi + # Safer to unload EESSI-extend before loading an EasyBuild version, in case unload behavior ever becomes dependent on EasyBuild version + module unload EESSI-extend module load EasyBuild/${eb_version} # Make sure EESSI-extend does a site install here @@ -115,7 +117,6 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do unset EESSI_PROJECT_INSTALL unset EESSI_USER_INSTALL export EESSI_SITE_INSTALL=1 - module unload EESSI-extend ml_av_eessi_extend_out=${tmpdir}/ml_av_eessi_extend.out # need to use --ignore_cache to avoid the case that the module was removed (to be # rebuilt) but it is still in the cache and the rebuild failed