Skip to content

Conversation

@hafeoz
Copy link

@hafeoz hafeoz commented Aug 21, 2025

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

Setting `CUDA_ARCH` in GNUmakefile has no effect. See discussion in AMReX-Codes/amrex#4621
@WeiqunZhang
Copy link
Member

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

@WeiqunZhang
Copy link
Member

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.

@hafeoz
Copy link
Author

hafeoz commented Aug 21, 2025

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``.

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.

3 participants