0:allocate:copying symbol memcpy failed:13(invalid device symbol)

Hello, I can run programs using TESLA K40c in PVF18.10 and Window7, but when I change to the quad rtx 6000 video card, an error will be reported. Can you explain why? Thank you
module arr
integer,device,allocatable,dimension(:)::a_d
integer,allocatable,dimension(:)::a,b
endmodule

module GPUsubroutine
use cudafor
contains
attributes(glabal) subroutine addarrayongpu(a_d,N,M)
implicit none
integer,value::N,M
integer,intent(inout)::a_d(N)
integer::i
i = (blockidx%x-1)*blockdim%x + threadidx%x
if(i>n) return
a_d(i) = a_d(i) + M
endsubroutine
end module GPUsubroutine

program main
    use GPUsubroutine
    use arr
integer,parameter::N = 100000000,M = 100,BS = 100
integer :: i,t1,t2,t3,t4,t5
real(8) ::cr
allocate(a(N),b(N),a_d(N))
print*,"adsasdas"
do i = 1,n
    a(i) = i
enddo
b=a
call SYSTEM_CLOCK(t1,cr)
a_d = b
call SYSTEM_CLOCK(t2,cr)
call addARRAYONGPU<<<1,1>>>(a_d,N,M)
CALL SYSTEM_CLOCK(t3,cr)

write(*,*)"time of gpu ",t3-t2
end

But if I do not write aLLOTABLE in the module, but in the program, and use RTX6000 to run, why is it that FORTRAN or the compiler version is too old

Likely it is just that a 4 year old Windows compiler does not support newer GPUs, CUDA versions, or Windows versions. Some combination of those. You can try printing out the CUDA errors, from something like cudaGetLastError() and cudaGetErrorString() to see what the issue is.

Hello, I found that the problem seems to be that the module cannot be recognized in the program. According to your instructions, I used CUDAGETERRORSTRING to print an error, displaying “invalid device function”. It seems that ‘use GPUsubroutine’ is not used, and the fact does not conform to the imagined calculation result. However, the same environment and programs can run correctly on TESLA K40c, and ‘MODULE’ cannot be used on the quad rtx 6000. Can I ask if only the compiler can be updated in this case?
I am using PVF18.10, which seems to have stopped production. WINDIOW7. Do you need to use the latest HPC to avoid the above problems?
thank you