Skip to content

Commit d4b9721

Browse files
author
Caspar van Leeuwen
committed
Simply load the module as part of the hook. Not tested yet, currently running
1 parent 4cb2c03 commit d4b9721

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

eb_hooks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,9 @@ def pre_sanitycheck_hook_cuda(self, *args, **kwargs):
984984
if dep['name'] == 'CUDA':
985985
# Store the dependency for removal in post hook
986986
setattr(self, EESSI_SANITYCHECK_CUDA_ATTR, dep)
987-
# Add to runtime dependencies so fake module includes CUDA
988-
self.cfg['dependencies'].append(dep)
989-
print_msg(f"CUDA (dep) is a build-only dependency; temporarily making available for sanity check")
987+
# Load CUDA module
988+
self.modules_tool.load([dep['full_mod_name']])
989+
print_msg(f"Loading CUDA module '{dep['full_mod_name']}', temporarily making available for the (CUDA) sanity check")
990990
break
991991

992992

@@ -999,7 +999,8 @@ def post_sanitycheck_hook_cuda(self, *args, **kwargs):
999999
# Remove from runtime dependencies
10001000
for dep in self.cfg['dependencies']:
10011001
if dep['name'] == 'CUDA':
1002-
self.cfg['dependencies'].remove(dep)
1002+
self.modules_tool.unload([dep['full_mod_name']])
1003+
print_msg(f"Unloading CUDA module '{dep['full_mod_name']}', temporarily making available for the (CUDA) sanity check")
10031004
break
10041005
delattr(self, EESSI_SANITYCHECK_CUDA_ATTR)
10051006

0 commit comments

Comments
 (0)