Skip to content

Commit

Permalink
Add option for ignoring individual files in the CUDA sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Feb 20, 2025
1 parent 0e97868 commit 6b6d2c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
16 changes: 13 additions & 3 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3322,6 +3322,10 @@ def sanity_check_cuda(self, cuda_dirs=None, check_cuobjdump=True):
fails = []
cfg_ccs = build_option('cuda_compute_capabilities') or self.cfg.get('cuda_compute_capabilities', None)

# Construct the list of files to ignore as full paths (cuda_sanity_ignore_files contains the paths
# to ignore, relative to the installation prefix)
ignore_file_list = [os.path.join(self.installdir, d) for d in self.cfg['cuda_sanity_ignore_files']]

# If there are no CUDA compute capabilities defined, return
if cfg_ccs is None or len(cfg_ccs) == 0:
self.log.info("Skipping CUDA sanity check, as no CUDA compute capabilities where configured")
Expand Down Expand Up @@ -3364,9 +3368,15 @@ def sanity_check_cuda(self, cuda_dirs=None, check_cuobjdump=True):
if additional_ccs:
fail_msg += "Surplus compute capabilities: %s. " % ', '.join(sorted(additional_ccs))
if missing_ccs:
fail_msg += "Missing compute capabilities: %s." % ', '.join(sorted(missing_ccs))
self.log.warning(fail_msg)
fails.append(fail_msg)
fail_msg += "Missing compute capabilities: %s. " % ', '.join(sorted(missing_ccs))
# We still log the result, but don't fail:
if path in ignore_file_list:
fail_msg += f"This failure will be ignored as {path} is listed in "
fail_msg += "'ignore_cuda_sanity_failures'."
self.log.warning(fail_msg)
else:
self.log.warning(fail_msg)
fails.append(fail_msg)
else:
msg = (f"Output of 'cuobjdump' checked for {path}; device code architecures match "
"those in cuda_compute_capabilities")
Expand Down
5 changes: 5 additions & 0 deletions easybuild/framework/easyconfig/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
'after make (for e.g.,"test" for make test)'), BUILD],
'bin_lib_subdirs': [[], "List of subdirectories for binaries and libraries, which is used during sanity check "
"to check RPATH linking and banned/required libraries", BUILD],
'cuda_sanity_ignore_files': [[], "List of files (relative to the installation prefix) for which failurs in "
"the CUDA sanity check step are ignored. Typically used for files where you "
"know the CUDA architectures in those files don't match the "
"--cuda-compute-capabitilities configured for EasyBuild AND where you know "
"that this is ok / reasonable (e.g. binary installations)", BUILD],
'sanity_check_commands': [[], ("format: [(name, options)] e.g. [('gzip','-h')]. "
"Using a non-tuple is equivalent to (name, '-h')"), BUILD],
'sanity_check_paths': [{}, ("List of files and directories to check "
Expand Down

0 comments on commit 6b6d2c8

Please sign in to comment.