Skip to content

UES standards (CUDA, Python, ...) for EB recipes

lucamar edited this page Dec 23, 2020 · 11 revisions

UES standard ways to refer to certain dependencies in build recipes

CUDA dependencies

The standard way to address CUDA builds is to add the module cudatoolkit in builddependencies as below:

    version = ...
    versionsuffix = '-cuda'

    ...
    builddependencies=[
        ...
        ('cudatoolkit', EXTERNAL_MODULE),
    ]

Sometimes additional environment variables might be required, e. g. CRAY_ACCEL_TARGET, CRAY_TCMALLOC_MEMFS_FORCE, ... In order to set all options and paths required by builds for Pascal GPUs (nvidia60), the following dependency might be used:

    dependencies = [
        ...
        ('craype-accel-nvidia60', EXTERNAL_MODULE),
    ]

Please note that you might get performance issues in some cases using this dependency, so use it only after testing it carefully. As a matter of fact, the default version of cudatoolkit at the time of the build will be used during the build, whereas the craype-accel-nvidia60 dependency will load the default versions of the following modules at runtime:

  • craype-accel-nvidia60
  • cray-libsci_acc
  • cudatoolkit Therefore, if your build takes place before a change of the default modules, you will end up running with a different version of cudatoolkit with respect to the build.

For minor changes, e.g. when a new revision of the same cudaversion is installed, this should work in most of the cases. Should you absolutely require a specific version of cudatoolkit, you can change the 'cudatoolkit' entry from builddependencies -> dependencies and include the specific version, as shown in the following example:

    version = ...
    cudaversion = 9.1
    versionsuffix = '-cuda-%s' % cudaversion

    ...
    dependencies=[
        ...
        ('craype-accel-nvidia60', EXTERNAL_MODULE),
        ('cudatoolkit/9.1.85_3.18-6.0.7.0_5.1__g2eb7c52', EXTERNAL_MODULE),
    ]

NB: This script will fail if the specific cudatoolkit module is not available on the system any longer. Please also note that hard-coding CUDA versions might break the automated update workflows of the software stack.

Since EasyBuild 4.2.2, the template parameters cudaver, cudashortver, cudamajver and cudaminver are available when you have CUDA/cudatoolkit in the dependencies or builddependencies. Ideally use these variables and hardcode the version of cuda only in the dependency.

Python

As of August 2020, the Cray Programming Environment (cdt/20.08) provides module only for Python 3. When you need the default version of the cdt, you can include the dependency as shown below:

dependencies = [
    ('cray-python', EXTERNAL_MODULE),
    ...
]

If you need a different version of Python include the full version in the dependencies like this:

dependencies = [
    ('cray-python/3.8.2.1', EXTERNAL_MODULE),
    ...
]

and use the templates pyver, pyshortver, pymajver and pyminver whenever needed. The template parameters should work as long as Python or cray-python are included in the direct dependencies/builddependencies of the recipe.