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 In Modules, how do I save my environment with a .modules file?

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 2016-05-10 00:00:00.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.