Skip to content

Added logic to add cuda compute cap. 10.0 when toolchain is 12.9.1 or greater#82

Open
ccoulombe wants to merge 4 commits intomainfrom
update/ccc10-12.9
Open

Added logic to add cuda compute cap. 10.0 when toolchain is 12.9.1 or greater#82
ccoulombe wants to merge 4 commits intomainfrom
update/ccc10-12.9

Conversation

@ccoulombe
Copy link
Copy Markdown
Contributor

When cuda 12.9.1 is used, add cuda compute capabiliy 10.0 to --cuda-compute-capabilities build option.

@ccoulombe ccoulombe requested review from bartoldeman and removed request for bartoldeman January 9, 2026 20:56
@ccoulombe ccoulombe marked this pull request as ready for review March 26, 2026 19:12
2023/cc_hooks.py Outdated

ccc = build_option('cuda_compute_capabilities')
# For CUDA and CUDAcore, 12.9 or higher, add cuda compute 10.0
if (ec['toolchain'].get('name', '').startswith('CUDA') and ec['toolchain'].get('version', '').startswith(('12.9', '13.'))) or \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faudrait pas aussi inclure les toolchains cuda+mpi ?

Copy link
Copy Markdown
Contributor Author

@ccoulombe ccoulombe Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ils sont automatiquement inclus, puisqu'ils ont une dépendence sur cuda, non ?

Pour la forme, je peux les ajouters explicitement

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ben, dans ma tête en tout cas, ec['toolchain'].get('name', '') ne débute pas avec CUDAsi la toolchain est gompic ou gcccuda

Copy link
Copy Markdown
Contributor Author

@ccoulombe ccoulombe Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUDA ou CUDAcore fera alors partie des builddeps je crois, donc la 2e condition sera vraie.
Je vais le vérifier.

ie

    elif ec['toolchain']['name'] == 'gcccorecuda':
        builddeps.append(('CUDAcore', '%(cudaver)s'))

@ccoulombe
Copy link
Copy Markdown
Contributor Author

Tested

eb cuDSS-0.7.1-CUDAcore-12.9.1.eb --try-toolchain=CUDAcore,12.9.1 --hooks=$HOME/easybuild-computecanada-config/2023/cc_hooks.py --rebuild

eb cuDSS-0.7.1-CUDAcore-12.9.1.eb --try-toolchain=CUDAcore,12.6.3 --hooks=$HOME/easybuild-computecanada-config/2023/cc_hooks.py --rebuild

eb cuDSS-0.6.0-CUDAcore-12.6.2.eb --hooks=$HOME/easybuild-computecanada-config/2023/cc_hooks.py --rebuild

eb cuDSS-0.6.0-CUDAcore-12.6.2.eb --hooks=$HOME/easybuild-computecanada-config/2023/cc_hooks.py --rebuild --try-toolchain=CUDAcore,12.9.1

@mboisson
Copy link
Copy Markdown
Member

à la place d'y aller avec les versions de cuda et de toolchain, on ne pourrait pas faire un appel à nvcc avec la toolchain loadée pour trouver quelles sont les versions supportées et filtrer/ajouter en conséquence ?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds hook logic in the 2023 EasyBuild configuration to automatically extend --cuda-compute-capabilities with compute capability 10.0 when building with CUDA toolchains/dependencies matching CUDA 12.9.x / 13.x.

Changes:

  • Import update_build_option from easybuild.tools.config.
  • In parse_hook, detect CUDA 12.9/13 toolchains or CUDA builddeps and append 10.0 to cuda_compute_capabilities.
  • Attempt to remove 10.0 from cuda_compute_capabilities when the current easyconfig is not using CUDA 12.9/13.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

2023/cc_hooks.py Outdated
Comment on lines +948 to +949
if (ec['toolchain'].get('name', '').startswith('CUDA') and ec['toolchain'].get('version', '').startswith(('12.9', '13.'))) or \
any(dep[0].startswith('CUDA') and dep[1].startswith(('12.9', '13.')) for dep in builddeps):
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builddeps is sometimes populated in this hook with a literal placeholder version '%(cudaver)s' (see the builddeps.append(('CUDAcore', '%(cudaver)s')) branches above). In those cases, dep[1].startswith(('12.9', '13.')) will never match, so the 10.0 capability won’t be added even when the underlying CUDA version is 12.9.1+. Consider resolving the template value for cudaver (or inspecting the selected CUDA/CUDAcore module version from the toolchain) before making this decision.

Suggested change
if (ec['toolchain'].get('name', '').startswith('CUDA') and ec['toolchain'].get('version', '').startswith(('12.9', '13.'))) or \
any(dep[0].startswith('CUDA') and dep[1].startswith(('12.9', '13.')) for dep in builddeps):
cudaver_resolved = ec.get('cudaver') or EASYCONFIG_CONSTANTS.get('cudaver')
cuda_tc_name = ec['toolchain'].get('name', '')
cuda_tc_ver = ec['toolchain'].get('version', '')
if cuda_tc_ver == '%(cudaver)s' and cudaver_resolved:
cuda_tc_ver = str(cudaver_resolved)
def _cuda_dep_is_129_or_newer(dep):
name, ver = dep
if ver == '%(cudaver)s' and cudaver_resolved:
ver = str(cudaver_resolved)
return name.startswith('CUDA') and ver.startswith(('12.9', '13.'))
if (cuda_tc_name.startswith('CUDA') and cuda_tc_ver.startswith(('12.9', '13.'))) or \
any(_cuda_dep_is_129_or_newer(dep) for dep in (builddeps or [])):

Copilot uses AI. Check for mistakes.
@ccoulombe ccoulombe changed the title [WIP] Added logic to add cuda compute cap. 10.0 when toolchain is 12.9.1 Added logic to add cuda compute cap. 10.0 when toolchain is 12.9.1 or greater Mar 26, 2026
@ccoulombe
Copy link
Copy Markdown
Contributor Author

à la place d'y aller avec les versions de cuda et de toolchain, on ne pourrait pas faire un appel à nvcc avec la toolchain loadée pour trouver quelles sont les versions supportées et filtrer/ajouter en conséquence ?

ça impliquerais de charger le module à ce moment dans le hook, je ne sais pas si c'est possible à cette étape

@bartoldeman
Copy link
Copy Markdown
Contributor

For 13.2 we'll have to remove cc 7.0 as well.

@ccoulombe
Copy link
Copy Markdown
Contributor Author

For 13.2 we'll have to remove cc 7.0 as well.

We should remove it in general, here:

cuda-compute-capabilities = 7.0,8.0,9.0

@ccoulombe
Copy link
Copy Markdown
Contributor Author

xref: #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants