Skip to content

Commit 512142f

Browse files
author
Caspar van Leeuwen
committed
Make sure to change the 12.0f to 12.0 CUDA compute capability if CUDA 12.8.0 is used, since sm_120f is not supported there yet
1 parent 47bc30f commit 512142f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

eb_hooks.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ def pre_prepare_hook(self, *args, **kwargs):
449449
# Always trigger this, regardless of ec.name
450450
pre_prepare_hook_unsupported_modules(self, *args, **kwargs)
451451

452+
# Always trigger this, regardless of ec.name
453+
pre_prepare_hook_cuda_dependant(self, *args, **kwargs)
454+
452455

453456
def post_prepare_hook_gcc_prefixed_ld_rpath_wrapper(self, *args, **kwargs):
454457
"""
@@ -910,6 +913,20 @@ def post_easyblock_hook_copy_easybuild_subdir(self, *args, **kwargs):
910913
copy_dir(app_easybuild_dir, app_reprod_dir)
911914

912915

916+
def pre_prepare_hook_cuda_dependant(self, *args, **kwargs):
917+
"""
918+
CUDA 12.8.0 doesn't support the 12.0f target, only 12.0. This hook converts any CC 12.0f into 12.0
919+
if the current package depends on CUDA.
920+
"""
921+
922+
cudaver = get_dependency_software_version("CUDA", ec=self.cfg, check_deps=True, check_builddeps=True)
923+
if cudaver:
924+
cuda_cc = build_option('cuda_compute_capabilities')
925+
if cuda_cc and '12.0f' in cuda_cc:
926+
updated_cuda_cc = [v.replace('12.0f', '12.0') for v in cuda_cc]
927+
update_build_option('cuda_compute_capabilities', updated_cuda_cc)
928+
929+
913930
def pre_prepare_hook_cudnn(self, *args, **kwargs):
914931
"""
915932
cuDNN is a binary install, that doesn't always have the device code for the suffixed CUDA

0 commit comments

Comments
 (0)