NVIDIA HPC SDK Compiler

Version Module file Name SystemA System B/C System G Cloud System Notes
23.9 (default) nvhpc/23.9 - - + - Introduced in April 2024
23.5 nvhpc/23.5 - - + - Introduced in August 2023
22.9 nvhpc/22.9 - - + - Introduced in January 2023

+ : Available for all users
- : Not available

In the system G, the NVIDIA HPC SDK compiler is set by default when you log into the system. The NVIDIA HPC SDK compiler is not available in the system B, C and Cloud.

If you want to set the environment settings automatically at login, write the necessary module commands in the startup file of the login shell. Please refer to Setup of the login node for details. Please refer to Modules for details on the module command.

Version Module file Name SystemA System B/C System G Cloud System Notes
12.2.2 (default) cuda/12.2.2 - - + - Introduced in April 2024
12.1.1 cuda/12.1.1 - - + - Introduced in August 2023
11.7.1 cuda/11.7.1 - - + - Introduced in January 2023
9.2 cuda/9.2 - - + - Introduced in January 2023

+ : Available for all users
- : Not available

When you download the module file of the NVIDIA HPC SDK compiler, cuda is loaded at the same time. The default version of cuda is 11.7, however if you want to switch the versions, execute the module command as follows while PrgEnvNvidia is loaded.

$ module load cuda/9.2

Language Command Executable form
Fortran nvfortran nvfortran [Option] File Name
C nvc nvc [Option] File Name
C++ nvc++ nvc++ [Option] File Name

  • Main options (parallelization, optimization, etc.)
Option Purpose
-o FILENAME Specifies the name of the object file.
-mcmodel=medium Enable to use memory in excess of 2 GB.
-mp Enable OpenMP directive and compile.
-Mconcur Performs automatic parallelization.
-O0/-O1/-O2/-O3/-O4 Specifies the level of optimization.
-fast Enable general optimization features.
-Mipa=fast Optimizes the analysis process between procedures. (NOTE) No longer available in the current version.
  • Message output and debugging options
Option Purpose
-Mlist Create a listing file.
-Minform=inform Displays all error messages.
-Minfo[=OPTION] Displays information on standard error output.
Specify the information to be displayed with option.
-Mneginfo[=OPTION] Displays information about optimizations that were not performed.
  • Fortran language-specific options
Option Purpose
-Mfixed Specifies that the program is written in a fixed format.
-Mfree Specifies that the program is written in free form.
-Mstandard Warns against non-ANSI compliant syntax.
-Mdclchk Warns against implicit type declarations.
-C Detects out-of-area references to arrays at program execution.
  • GPU-related options
Option Purpose
-gpu Specify settings related to GPU. Use in conjunction with -acc, -cuda, -mp and -stdpar options.
(e.g.)-gpu=cc80 -acc
※cc means compute capability. The GPU in system G is A100, so specify cc80 for cc.
-acc Enable OpenACC.
-cuda Enable CUDA.
-Minfo=accel Output GPU-related compilation information.

$ nvfortran test.f90    # For Fortran
$ nvc test.c       # For C
$ nvc++ test.cpp     # For C++
$ tssrun ./a.out    # Execution

$ nvfortran -Mconcur test.f90
$ tssrun --rsc p=1:t=4:c=4 ./a.out # Execute with the number of parallels specified as 4.

OpenMP is an open standard for parallelizing programs. You can have the compiler automatically perform parallelization only by writing instructions starting with #pragma omp (C/C++) or $omp and compile with the given options.

To compile the source code with instructions to OpenMP, use the -mp option.

$ nvc -mp test.c

When executing a compiled program, if you specify the number of parallelisms for t and c with --rsc option, the program will be executed with that number of parallelisms.

$ tssrun --rsc p=1:t=8:c=8 ./a.out # Execute with the number of parallels specified as 8.

OpenACC is an open standard for parallelizing programs. You can generate executable code that will run on a GPU only by writing instructions starting with #pragma acc(C/C++) or $acc and compile with the given options.

To compile the source code with instructions to OpenACC, use the -acc option.

$ nvfortran -acc test.f90

The Open MPI library is available. Please refer to Open MPI Library on how to compile, link and execute MPI programs.