@@ -343,6 +343,8 @@ def override_options(self):
343343 'consider-archived-easyconfigs' : ("Also consider archived easyconfigs" , None , 'store_true' , False ),
344344 'containerize' : ("Generate container recipe/image" , None , 'store_true' , False , 'C' ),
345345 'copy-ec' : ("Copy specified easyconfig(s) to specified location" , None , 'store_true' , False ),
346+ 'cuda-compute-capabilities' : ("List of CUDA compute capabilities to use when building GPU software" ,
347+ 'strlist' , 'extend' , None ),
346348 'debug-lmod' : ("Run Lmod modules tool commands in debug module" , None , 'store_true' , False ),
347349 'default-opt-level' : ("Specify default optimisation level" , 'choice' , 'store' , DEFAULT_OPT_LEVEL ,
348350 Compiler .COMPILER_OPT_FLAGS ),
@@ -760,6 +762,15 @@ def validate(self):
760762 msg = "Selected module naming scheme '%s' is unknown: %s" % (self .options .module_naming_scheme , avail_mnss )
761763 error_msgs .append (msg )
762764
765+ # values passed to --cuda-compute-capabilities must be of form X.Y (with both X and Y integers),
766+ # see https://developer.nvidia.com/cuda-gpus
767+ if self .options .cuda_compute_capabilities :
768+ cuda_cc_regex = re .compile (r'^[0-9]+\.[0-9]+$' )
769+ faulty_cuda_ccs = [x for x in self .options .cuda_compute_capabilities if not cuda_cc_regex .match (x )]
770+ if faulty_cuda_ccs :
771+ error_msg = "Incorrect values in --cuda-compute-capabilities (expected pattern: '%s'): %s"
772+ error_msgs .append (error_msg % (cuda_cc_regex .pattern , ', ' .join (faulty_cuda_ccs )))
773+
763774 if error_msgs :
764775 raise EasyBuildError ("Found problems validating the options: %s" , '\n ' .join (error_msgs ))
765776
0 commit comments