Skip to content

Commit c481bc1

Browse files
authored
Merge pull request #179 from casparvl/fix_hooks_bug
Make the use of the required keyword conditional on the EB version
2 parents 2eb7da3 + dc8f387 commit c481bc1

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

eb_hooks.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,19 @@ def print_warning(*args, **kwargs):
125125
orig_print_warning(*args, **kwargs)
126126

127127

128+
def get_cuda_cc_string(self):
129+
# required keyword was introduce in 5.1.1
130+
if EASYBUILD_VERSION >= '5.1.1':
131+
cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False)
132+
# mimic the 'required=False' behavior pre-EB 5.1.1
133+
else:
134+
try:
135+
cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities')
136+
except:
137+
cuda_ccs_string = ''
138+
return cuda_ccs_string
139+
140+
128141
def is_gcccore_1220_based(**kwargs):
129142
# ecname, ecversion, tcname, tcversion):
130143
"""
@@ -760,7 +773,7 @@ def is_unsupported_module(self):
760773
cudnn_ver = get_dependency_software_version("cuDNN", ec=self.cfg, check_deps=True, check_builddeps=True)
761774
if cudnn_ver:
762775
# cuda_ccs_string is e.g. "8.0,9.0"
763-
cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False)
776+
cuda_ccs_string = get_cuda_cc_string(self)
764777
# cuda_ccs is empty if none are defined
765778
if cuda_ccs_string:
766779
# cuda_ccs is a comma-seperated string. Convert to list for easier handling
@@ -788,7 +801,7 @@ def is_unsupported_module(self):
788801
cudaver = get_dependency_software_version("CUDA", ec=self.cfg, check_deps=True, check_builddeps=True)
789802
if cudaver:
790803
# cuda_ccs_string is e.g. "8.0,9.0"
791-
cuda_ccs_string = self.cfg.get_cuda_cc_template_value('cuda_compute_capabilities', required=False)
804+
cuda_ccs_string = get_cuda_cc_string(self)
792805
# cuda_ccs is empty if none are defined
793806
if cuda_ccs_string:
794807
# cuda_ccs is a comma-seperated string. Convert to list for easier handling

scripts/gpu_support/nvidia/install_cuda_and_libraries.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do
107107
echo_yellow ">> No EasyBuild/${eb_version} module found: skipping step to install easystack file ${easystack_file} (see output in ${module_avail_out})"
108108
continue
109109
fi
110+
# Safer to unload EESSI-extend before loading an EasyBuild version, in case unload behavior ever becomes dependent on EasyBuild version
111+
module unload EESSI-extend
110112
module load EasyBuild/${eb_version}
111113

112114
# Make sure EESSI-extend does a site install here
@@ -115,7 +117,6 @@ for EASYSTACK_FILE in ${TOPDIR}/easystacks/eessi-*CUDA*.yml; do
115117
unset EESSI_PROJECT_INSTALL
116118
unset EESSI_USER_INSTALL
117119
export EESSI_SITE_INSTALL=1
118-
module unload EESSI-extend
119120
ml_av_eessi_extend_out=${tmpdir}/ml_av_eessi_extend.out
120121
# need to use --ignore_cache to avoid the case that the module was removed (to be
121122
# rebuilt) but it is still in the cache and the rebuild failed

0 commit comments

Comments
 (0)