Runtime error 700: Illegal address during kernel execution

Hi, I found this issue that I was able to isolate in the following reproducible code.
I understand that the code should work fine. Furthermore, if I change the OpenACC directives with OpenMP (target teams distribute parallel do), there is no longer an error.

(tested with nvfortran 22.7 and 23.3):

program tests
implicit none

integer :: ji, jj
integer, parameter :: sz_i = 64 ! it works with other i values
integer, parameter :: sz_j = 64 ! it works with other j values

integer, allocatable, dimension(:,:) :: A,B

allocate(A(sz_i,sz_j))
allocate(B(sz_i,sz_j))

B=1

!$acc parallel loop collapse(2)
    DO jj = 1, sz_j ; DO ji = 1, sz_i
        A(ji,jj) = - SUM(SUM( B(:,:) , dim=2 ), dim=1 )
    END DO ; END DO
!$acc end parallel loop

end program

The output is:

Failing in Thread:1
call to cuStreamSynchronize returned error 700: Illegal address during kernel execution

Thanks Rommel,

I filed a problem report, TPR#35592, and sent it engineering for investigation.

While I’m not sure, I suspect there’s an issue with the implicit temp array that’s needed to hold the results from the return of the SUM intrinsic. With OpenACC and OpenMP “loop”, we try to create the private temp arrays prior to launching the kernel, while with OpenMP “distribute parallel do”, the temp array is allocated dynamically on the device by each thread.

-Mat

Thanks for answering Mat.

BTW, I’ve just found that with the OpenMP target teams loop directive also crashes.

program tests
implicit none

integer :: ji, jj
integer, parameter :: sz_i = 64
integer, parameter :: sz_j = 64

integer, allocatable, dimension(:,:) :: A,B

allocate(A(sz_i,sz_j))
allocate(B(sz_i,sz_j))

B=1

!$omp target teams loop collapse(2)
    DO jj = 1, sz_j ; DO ji = 1, sz_i
        A(ji,jj) = - SUM(SUM( B(:,:) , dim=2 ), dim=1 )
    END DO ; END DO
!$omp end target teams loop

end program

Output:

Segmentation fault

Yes, I saw that as well and included it in the report. As I noted above, OpenACC and OpenMP have a similar strategy.

1 Like