ARCHIVED: If the CUDA compiler throws an error in the GNU programming environment on Big Red II

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
Note:

Big Red II was retired from service on December 15, 2019; for more, see ARCHIVED: About Big Red II at Indiana University (Retired).

On Big Red II at Indiana University, the default version of the NVIDIA CUDA Toolkit (7.0) does not support the default version (5.3.0) of the GNU Compiler Collection (GCC). As a result of this incompatibility, when you try to compile a .cu file using the nvcc compiler wrapper, the CUDA runtime header (cuda_runtime.h) will produce an "unsupported GNU version" error.

To resolve the issue, use the module swap command to replace the default gcc module with a version that is compatible with CUDA Toolkit 7.0 (for example, GCC 4.9.3 is the latest version available on Big Red II capable of running CUDA Toolkit 7.0.); for example, on the command line, enter:

  module swap gcc/5.3.0 gcc/4.9.3

For example, to load the modules needed to use the CUDA Toolkit every time you log into Big Red II, add the following lines to your ~/.modules file:

  module swap PrgEnv-cray PrgEnv-gnu
  module swap gcc/5.3.0 gcc/4.9.3
  module load cudatoolkit
Note:
When using the CUDA Toolkit, binaries are built with dynamic linking. To restore the default static behavior for faster execution, unload the cudatoolkit module.

This is document aaph in the Knowledge Base.
Last modified on 2023-04-21 16:55:52.