error Type of argument does not match formal parameter '__pgi_fixuk_param_0'

Hallo. There is a source code in https://github.com/AndStorm/QUESTION.git. It is a small reproducing example of the full code, so it does not do any useful work, but only reproduces the compile error i have.
I use the compile line:

cmake . -DCMAKE_C_COMPILER=pgcc -DCMAKE_CXX_COMPILER=pgc++
-DCMAKE_C_FLAGS="-acc -Minfo=acc -mcmodel=medium -ta=tesla:cc70
-tp=haswell -Mnollvm -Minline -Mcuda=cuda10.1"
-DCMAKE_CXX_FLAGS="-acc -Minfo=acc -mcmodel=medium -ta=tesla:cc70
-tp=haswell -Mnollvm -Minline -Mcuda=cuda10.1" -DCMAKE_CXX_STANDARD=17
-DACC=ON -DCUDA=ON

But when i try to compile the code for launching it on GPU Nvidia Titan V (installed CUDA driver version 418.74) fixed in Intel KNL 64-core PC (OS: Debian Stable, gcc 7.4.0, PGI 19.4) using PGI 19.4 compiler + OpenAcc standard, the compilation immediately fails with:

/opt/pgi/19/u4/linux86-64-nollvm/19.4/include/mmintrin.h", line 27:
catastrophic error: #error directive: “MMX instruction set not
enabled”
#error “MMX instruction set not enabled”
^

1 catastrophic error detected in the compilation of “/data/70-gaa/Desktop/CURRENT_WORK/FIND_COMPILATION_ERROR/nbody.cpp”.
Compilation terminated.
make[2]: *** [CMakeFiles/Test.dir/build.make:63: CMakeFiles/Test.dir/nbody.cpp.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/Test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I found that if to comment the lines 6-7 of nbody.cpp file, the compilation fails with:

ptxas /tmp/pgaccOPUd4Lp3OXUd.ptx, line 586; error : Type of argument does not match formal parameter ‘__pgi_fixuk_param_0’
ptxas /tmp/pgaccOPUd4Lp3OXUd.ptx, line 586; error : Alignment of argument does not match formal parameter ‘__pgi_fixuk_param_0’
ptxas fatal : Ptx assembly aborted due to errors
PGCC-W-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (/data/70-gaa/Desktop/CURRENT_WORK/FIND_COMPILATION_ERROR/management/src/T3ElasticStrongIonIon_DB.cc: 1)
PGCC/x86 Linux 19.4-0: compilation completed with warnings

The same error for the T3Inelasticdd_DB.cc file. And finally:

[100%] Linking CXX executable Test
nvlink error : Undefined reference to ‘_ZNK24T3ElasticStrongIonIon_DB13RandomizeCostERjd’ in ‘CMakeFiles/Test.dir/nbody.cpp.o’
pgacclnk: child process exit status 2: /opt/pgi/19/u4/linux86-64-nollvm/19.4/bin/pgnvd
make[2]: *** [CMakeFiles/Test.dir/build.make:264: Test] Error 2
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/Test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

What causes these errors and how to fix them?

Hi and,

I’m not able to reproduce the mmintrin.h error and don’t see any line commented out in nbody.cpp, so not sure what wrong there.

For the other error, this appears to be a GPU code generation issue with the older nonLLVM compilers. Can you try removing the “-Mnollvm” flag? The code builds correctly for me when I remove the flag.

-Mat

Thank You very much! Really, if to remove the “-Mnollvm” flag, the code builds correctly. But it fails at runtime. I posted this problem as a separate topic https://forums.developer.nvidia.com/t/error-call-to-custreamsynchronize-returned-error-719-launch-failed-often-invalid-pointer-dereference/136440/1