Skip to content

Commit 8814af9

Browse files
authored
Merge pull request #5067 from bedroge/cuda_cc_regex_allow_f
allow `f` suffix in CUDA compute capabilities
2 parents 633cc4b + 95525be commit 8814af9

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

easybuild/tools/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ def validate(self):
990990
# values passed to --cuda-compute-capabilities must be of form X.Y (with both X and Y integers),
991991
# see https://developer.nvidia.com/cuda-gpus
992992
if self.options.cuda_compute_capabilities:
993-
cuda_cc_regex = re.compile(r'^[0-9]+\.[0-9]+a?$')
993+
cuda_cc_regex = re.compile(r'^[0-9]+\.[0-9]+[af]?$')
994994
faulty_cuda_ccs = [x for x in self.options.cuda_compute_capabilities if not cuda_cc_regex.match(x)]
995995
if faulty_cuda_ccs:
996996
error_msg = "Incorrect values in --cuda-compute-capabilities (expected pattern: '%s'): %s"

easybuild/tools/systemtools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ def get_cuda_architectures(path, section_type):
10781078
# compile_size = 64bit
10791079

10801080
# Pattern to extract elf code architectures and ptx code architectures respectively
1081-
code_regex = re.compile(f'Fatbin {section_type} code:\n=+\narch = sm_([0-9]+)([0-9]a?)')
1081+
code_regex = re.compile(f'Fatbin {section_type} code:\n=+\narch = sm_([0-9]+)([0-9][af]?)')
10821082

10831083
# resolve symlinks
10841084
if os.path.islink(path) and os.path.exists(path):

test/framework/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6816,10 +6816,10 @@ def test_installdir(self):
68166816

68176817
def test_cuda_compute_capabilities(self):
68186818
"""Test --cuda-compute-capabilities configuration option."""
6819-
args = ['--cuda-compute-capabilities=3.5,6.2,7.0', '--show-config']
6819+
args = ['--cuda-compute-capabilities=3.5,6.2,7.0,9.0a,10.0f', '--show-config']
68206820
txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False, strip=True)
68216821

6822-
regex = re.compile(r"^cuda-compute-capabilities\s*\(C\)\s*=\s*3\.5, 6\.2, 7\.0$", re.M)
6822+
regex = re.compile(r"^cuda-compute-capabilities\s*\(C\)\s*=\s*3\.5, 6\.2, 7\.0, 9\.0a, 10\.0f$", re.M)
68236823
self.assertRegex(txt, regex)
68246824

68256825
def test_create_index(self):

test/framework/systemtools.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,22 @@
428428
CUOBJDUMP_DEVICE_CODE_ONLY = """
429429
Fatbin elf code:
430430
================
431-
arch = sm_90
432-
code version = [1,7]
431+
arch = sm_100f
432+
code version = [1,8]
433433
host = linux
434434
compile_size = 64bit
435-
compressed
436435
437436
Fatbin elf code:
438437
================
439-
arch = sm_90a
440-
code version = [1,7]
438+
arch = sm_100
439+
code version = [1,8]
440+
host = linux
441+
compile_size = 64bit
442+
443+
Fatbin elf code:
444+
================
445+
arch = sm_100a
446+
code version = [1,8]
441447
host = linux
442448
compile_size = 64bit"""
443449

@@ -1425,7 +1431,7 @@ def test_get_cuda_architectures(self):
14251431
self.assertIsNone(res_ptx)
14261432
fail_msg = "Pattern '%s' should be found in: %s" % (warning_regex_ptx.pattern, logtxt)
14271433
self.assertTrue(warning_regex_ptx.search(logtxt), fail_msg)
1428-
self.assertEqual(res_elf, ['9.0', '9.0a'])
1434+
self.assertEqual(res_elf, ['10.0', '10.0a', '10.0f'])
14291435

14301436
# Test case 6: call on CUDA shared lib which lacks an arch = sm_XX entry (should never happen)
14311437
warning_regex_elf = re.compile(r"WARNING Found Fatbin elf code section\(s\) in cuobjdump output for "

0 commit comments

Comments
 (0)