NVHPC / CUDA compatibility

Hello,

I was trying out the latest CUDA versions with several NVHPC compiler versions. To do so, I install NVHPC and CUDA separately, and load NVHPC first then CUDA (by exporting PATH & other variables, see reproducer).

Since NVHPC 26.3, some header changed, and I cannot build simple CUDA kernels. Even when I follow the host compiler support policy (see CUDA Installation Guide for Linux — Installation Guide for Linux 13.3 documentation for instance) : NVHPC 26.5 should be compatible with CUDA 13.4 and NVHPC 26.3 compatib le with CUDA 13.3. Still, when trying to build a simple kernel, I face the following error :

+ nvcc -cuda -maxrregcount 32 -ccbin nvc++ -I/software/.bmorvana-tests/nvhpc-cuda-repro/cuda_13.4.3_linux.prefix/include /software/.bmorvana-tests/nvhpc-cuda-repro/kernel.nvc-26.3.cuda-13.4.3.build/kernel.cu --output-file /software/.bmorvana-tests/nvhpc-cuda-repro/kernel.nvc-26.3.cuda-13.4.3.build/kernel.cpp
+ nvc++ -c /software/.bmorvana-tests/nvhpc-cuda-repro/kernel.nvc-26.3.cuda-13.4.3.build/kernel.cpp -o /dev/null
"/software/.bmorvana-tests/nvhpc-cuda-repro/nvhpc_2026_263_Linux_x86_64_cuda_multi.prefix/Linux_x86_64/26.3/compilers/include/_cplus_nvcc.h", line 17: error: invalid redeclaration of type name "__pgi_va_list_helper" (declared at line 17)
  typedef __va_list_tag __pgi_va_list_helper[1]; 
                        ^

1 error detected in the compilation of "/software/.bmorvana-tests/nvhpc-cuda-repro/kernel.nvc-26.3.cuda-13.4.3.build/kernel.cpp".

I tried several couple of versions :

NVHPC 26.9 does not fix the issue.

Reproducer is available here : antoine-morvan/nvhpc-cuda-repro

Note that the example kernel code is taken directly from OSU benchmarks source code, without modification. (cat osu-micro-benchmarks-7.5.2/c/util/kernel.cu)

Am I missing some information about NVHPC / CUDA compatibility ? or am I using the combination in a wrong way ?

Best,

Antoine

Hi Antoine,

It looks like the definitions from “_cplus_nvcc.h” are getting included in the post-process file twice, once from nvcc and again from nvc++ when nvcc invokes it pre-processing step. Looks like as part of an update to the C++ front-end in 26.3, the guard to prevent this was removed.

I filed a report, TPR #39136, and sent it to engineering for investigation.

-Mat