Install Nvidia HPC C, C++, Fortran compilers

The free-to-use Nvidia HPC SDK offers possible speed improvements over GNU GCC / GFortran. Intel oneAPI binaries can be significantly faster than Nvidia-compiled binaries for CPU-only workloads on Intel CPUs. A typical reason for using Nvidia HPC SDK is the Cuda GPU features. Nvidia HPC compilers support C11, C++20, and partial Fortran 2018 including submodule and error stop.

Download and install Nvidia HPC SDK. Create a script

To use NVIDIA HPC SDK, source the script:

source ~/

For CMake use, set NVIDIA HPC compiler-specific options in CMakeLists.txt like: