Compilation issue with nvc version 24.09 and newer (OpenACC)

Hi all,

I have an interesting issue that seems to have arisen with NVHPC between versions 24.07 and 24.09 and is still around, I have started getting a compilation error triggered by this warning/info output:
Accelerator restriction: unsupported operation: DCMPLXABS

A c-code that triggers the problem can be found here
(Sorry for the size, not exactly ‘minimal’),

The file may be compiled with:
nvc -o ./MAXIV_Bloch.out ./MAXIV_Bloch.c -Wl,-O2 -Minfo=accel -acc=gpu -gpu=managed -DOPENACC

With nvc from 24.07 and earlier the code compiles OK, 24.09 and later fail with

nvvmCompileProgram: failed with error 9: NVVM_ERROR_COMPILATION nvnvvmd: error: /tmp/nvaccuiGDd85BX0TtZ.gpu (95719, 14): parse use of undefined value '@class_Mirror_toroid_trace'

I’ve compiled a small overview for various compiler versions and a couple of different versions of my own code. (Clicking any of the red “! Compile error !” links in that page will take you to the compiler output…)

Best,
Peter

Hi Peter and thanks for the report.

From what I can tell, the “cabs” routine isn’t supported on the device. Hence, the compiler maps it to the equivalent “hypot” routine. While I still see this mapping in the compiler code, the mapping seems to have gotten broken in 24.9 for some reason.

I added a problem report, TPR #37341, and sent it to engineering for investigation.

The link error is a direct result of the cabs problem. Since it’s not supported, the device routine doesn’t get generated and hence the linker error since it can’t be found.

Note the actual error is coming from the “reflecq” routine, which gets inlined into “class_Mirror_toroid_trace”.

Unfortunately, I don’t have a work around for you, other than to see if you can remove or replace the calls to “cabs”.

Also, I found a second unrelated code generation issue when not inlining and filed this as TPR #37342. The problem occurs at line 9749 when using a char function result as part of an if evaluation. Using auto-inlining (which is part of -O2) works around the error. But if you hit this one as well, the work around is to save the return value into a temp and then use the temp in the evaluation.

#ifdef  ERROR_HERE
        if (sg1!=off_sign(off_F(vertPi.x,vertPi.y,vertPi.z,A2,B2,C2,D2)))//if the plane intersect the polygon
          break;
#else
// Work-around code
        char sg2 = off_sign(off_F(vertPi.x,vertPi.y,vertPi.z,A2,B2,C2,D2));//if the plane intersect the polygon
        if (sg1!=sg2)
          break;
#endif

-Mat

1 Like