In the following code the GPU memory is not being freed.
allocate(formMat(1:(2*data_in%Lpmax+1)*grid%nr,1:nchansmax))
istat = cudaMemGetInfo(free, total)
print*,'GPU memory after allocating space for formMat: free, total (GB)'
print*,free/dble(2**30), total/dble(2**30)
!$acc exit data delete(formMat) finalize
deallocate(formMat)
istat = cudaMemGetInfo(free, total)
print*,'GPU memory after deleting formMat: free, total (GB)'
print*,free/dble(2**30), total/dble(2**30)
In one of the previous topics I read the following:
Also, given that device allocation is expensive, the compiler runtime doesn’t actually free the device memory. Rather it adds it back to it’s device memory pool and reuses it later. There’s an environment variable that can be used to disable this, if needed.
Which environment variable can be used to disable this?