On Big Red II, why does the CUDA compiler throw an error in the GNU programming environment, and how can I resolve the issue?

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 (e.g., 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

To make permanent changes to your environment, edit your ~/.modules file. For more, see Use a .modules file in your home directory to save your user environment on an IU research supercomputer.

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 2018-07-11 09:19:57.

Contact us

For help or to comment, email the UITS Support Center.