Internal Compiler error in nvfortran with OMP-GPU offloading

Hi,

please consider the following test code:

MODULE testmod
   IMPLICIT NONE
   REAL, DIMENSION(:,:), ALLOCATABLE ::  arr
   INTEGER :: nxl, nxr, nyn, nys
   !$omp declare target(arr)
   !$omp declare target(nxl,nxr,nyn,nys)
CONTAINS
   SUBROUTINE testsub
      IMPLICIT NONE
      INTEGER ::  i, j
      !$omp target
      !$omp parallel do 
      DO  j = nys, nyn
         !$omp parallel do
         DO  i = nxl, nxr
            arr(i,j) = arr(i,j)
         ENDDO
      ENDDO
      !$omp end target
   END SUBROUTINE testsub
END MODULE testmod

Upon compilation the nvfortran throws an internal compiler error:

$ module source /home/fuhl/software/nvhpc_2022_223/modulefiles/nvhpc/22.3
$ nvfortran -c -mp=gpu test.f90
NVFORTRAN-F-0000-Internal compiler error. 
[Developers Only OpenMP Compiler Error]
"symbol .nxl_392(392) is team-private but we are returning false" 
[Debug here: File:../src/ompaccel.c Line 3242, Function:ompac...  (test.f90: 15)
NVFORTRAN/x86-64 Linux 22.3-0: compilation aborted

The error is not triggered, if either the omp target pragma is removed, or if the code is compiled like this:

nvfortran -c -mp test.f90

Thanks felix.uhl.

I checked our pre-release version of 22.5 and no longer see the ICE, but it will still fail to offload the section of code due to the missing “teams” construct. Adding “teams” will also fix the ICE in 22.3. I’d also recommend adding “distribute” to the “parallel do” so the work is distributed across both the teams and threads. Alternatively, these can be replaced with a “loop” construct instead.

Example:

% cat test.F90
MODULE testmod
   IMPLICIT NONE
   REAL, DIMENSION(:,:), ALLOCATABLE ::  arr
   INTEGER :: nxl, nxr, nyn, nys
   !$omp declare target(arr)
   !$omp declare target(nxl,nxr,nyn,nys)
CONTAINS
   SUBROUTINE testsub
      IMPLICIT NONE
      INTEGER ::  i, j
      !$omp target teams
      !$omp distribute
! or use "loop" in place of distribute/parallel do
      !omp loop
      DO  j = nys, nyn
         !$omp parallel do
         !omp loop
         DO  i = nxl, nxr
            arr(i,j) = arr(i,j)
         ENDDO
      ENDDO
      !$omp end target teams
   END SUBROUTINE testsub
END MODULE testmod
% nvfortran -mp=gpu test.F90 -V22.3 -c

Hope this helps,
Mat

Thank you.
That helped a lot.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.