Hello,
I have a problem accelerating a code. I managed to reproduce the strange behaviour:
program strange_behaviour
implicit none
integer, parameter :: nx=4,ny=4,nz=2
integer :: i,j,k
real, dimension(nx,ny,nz) :: a,b
a=10
call random_number(b)
!$acc kernels
do j=1,ny
do i=1,nx
!$acc do seq
do k=1,nz
a(i,j,k) = 3.
enddo
! IT DOES NOT WORK ON GPU
b(i,j,1) = a(i,j,1)
! WORKAROUND
!!$acc do seq
! do k=1,1
! b(i,j,k) = a(i,j,k)
! enddo
enddo
enddo
!$acc end kernels
print*,'b: ',b
end program strange_behaviour
I can fix the problem using the given workaround but It would be very appreciated to avoid to use it, if possibile. Is there anything I do not understand? I am using PGI 12.6
What CUDA Driver version do you have? (see the output from pgaccelinfo) In 12.6 we switched to using CUDA 4.2 by default so if your driver is old it may cause problems.
You can also try switching back to using CUDA 4.0 by compiling with “-ta=nvidia,cuda4.0”.
When move systems, I’m now able to recreate the error. Interestingly, the failure is intermittent suggesting a synchronisation issue within the kernel. I have sent a report to our engineers (TPR#18854). I’ll continue to look for a work-around.