-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2337 from branfosj/20210218110544_new_pr_HLAhDiQQgW
new easyblock for NCCL (built from source)
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## | ||
# Copyright 2021-2021 Ghent University | ||
# | ||
# This file is part of EasyBuild, | ||
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), | ||
# with support of Ghent University (http://ugent.be/hpc), | ||
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), | ||
# Flemish Research Foundation (FWO) (http://www.fwo.be/en) | ||
# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). | ||
# | ||
# https://github.com/easybuilders/easybuild | ||
# | ||
# EasyBuild is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation v2. | ||
# | ||
# EasyBuild is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. | ||
## | ||
""" | ||
EasyBuild support for building NCCL, implemented as an easyblock | ||
@author: Simon Branford (University of Birmingham) | ||
""" | ||
from easybuild.easyblocks.generic.configuremake import ConfigureMake | ||
from easybuild.tools.config import build_option | ||
|
||
|
||
class EB_NCCL(ConfigureMake): | ||
"""Support for building NCCL.""" | ||
|
||
def configure_step(self): | ||
"""NCCL has no configure step""" | ||
pass | ||
|
||
def build_step(self): | ||
"""Build NCCL""" | ||
# NCCL builds for all supported CUDA compute capabilities by default | ||
# If cuda_compute_capabilities is specified then we override this with the selected options | ||
|
||
# list of CUDA compute capabilities to use can be specifed in three ways (where 3 overrules 2 overrules 1): | ||
# (1) in the easyconfig file, via the custom cuda_compute_capabilities; | ||
# (2) via the EasyBuild environment variable EASYBUILD_CUDA_COMPUTE_CAPABILITIES; | ||
# (3) in the EasyBuild configuration, via --cuda-compute-capabilities configuration option; | ||
cuda_cc = build_option('cuda_compute_capabilities') or self.cfg['cuda_compute_capabilities'] | ||
|
||
nvcc_gencode = [] | ||
for cc in cuda_cc: | ||
add = cc.replace('.', '') | ||
nvcc_gencode.append('-gencode=arch=compute_%s,code=sm_%s' % (add, add)) | ||
|
||
if nvcc_gencode: | ||
self.cfg.update('buildopts', 'NVCC_GENCODE="%s"' % ' '.join(nvcc_gencode)) | ||
|
||
super(EB_NCCL, self).build_step() | ||
|
||
def install_step(self): | ||
"""Install NCCL""" | ||
self.cfg.update('installopts', "PREFIX=%s" % self.installdir) | ||
|
||
super(EB_NCCL, self).install_step() |