Castro icon indicating copy to clipboard operation
Castro copied to clipboard

Documentation: Clarify that `CUDA_ARCH` can only be overridden from command line

Open hafeoz opened this issue 6 months ago • 3 comments

PR summary

Clarify that CUDA_ARCH can only be overridden from the command line; setting CUDA_ARCH in GNUmakefile will be overridden and has no effect.

PR motivation

Overriding this parameter from the command line will prevent AMReX from changing it, while specifying it in GNUmakefile will be overridden.

I've learned it the hard way in AMReX-Codes/amrex#4621.

PR checklist

  • [ ] test suite needs to be run on this PR
  • [ ] this PR will change answers in the test suite to more than roundoff level
  • [ ] all newly-added functions have docstrings as per the coding conventions
  • [ ] the CHANGES file has been updated, if appropriate
  • [ ] if appropriate, this change is described in the docs

hafeoz avatar Aug 21 '25 01:08 hafeoz

One could still specify it in GNUmakefile with override CUDA_ARCH = 80.

WeiqunZhang avatar Aug 21 '25 01:08 WeiqunZhang

https://www.gnu.org/software/make/manual/html_node/Override-Directive.html

Variable assignments marked with the override flag have a higher priority than all other assignments, except another override.

WeiqunZhang avatar Aug 21 '25 01:08 WeiqunZhang

So maybe suggest using override in GNUmakefile? e.g.:

For recent GPUs, like the NVIDIA RTX 4090, you may need to change
the default CUDA architecture.  This can be done by adding:
.. code::
  CUDA_ARCH=89
to the ``make`` line or by using an override in ``GNUmakefile``.

hafeoz avatar Aug 21 '25 02:08 hafeoz