From 6ca8a9e346cd5b80624fb14eda5377247eee5459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Andr=C3=A9=20Reuter?= Date: Mon, 16 Sep 2024 16:00:51 +0200 Subject: [PATCH] GCC: Fix NVPTX mapping error when with no CC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When no compute capability is set but NVPTX is enabled, trying to figure out the NVPTX architecture fails with the error: ``` File "easybuild/easyblocks/g/gcc.py", line 431, in map_nvptx_capability return sorted_gcc_cc[0] IndexError: list index out of range ``` The error occurs because of an insufficient check for an unset CUDA compute capability. This commit changes the checked conditions, so that empty lists are also correctly handled. Signed-off-by: Jan André Reuter --- easybuild/easyblocks/g/gcc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/g/gcc.py b/easybuild/easyblocks/g/gcc.py index 1ec0f0e37b2..76562c40013 100644 --- a/easybuild/easyblocks/g/gcc.py +++ b/easybuild/easyblocks/g/gcc.py @@ -383,7 +383,7 @@ def map_nvptx_capability(self): architecture_mappings_replacement = "misa=," # Determine which compute capabilities are configured. If there are none, return immediately. - if cuda_cc_list is None: + if not cuda_cc_list: return None cuda_sm_list = [f"sm_{cc.replace('.', '')}" for cc in cuda_cc_list]