PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

managed memory : seg fault with pointer on host

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
escj



Joined: 30 Sep 2009
Posts: 65
Location: Laboratoire d'Aérologie, Toulouse, FRANCE

PostPosted: Mon Jun 20, 2016 2:40 am    Post subject: managed memory : seg fault with pointer on host Reply with quote

Hello .

I'm using pgi/16.5 ( or 16.1 & cuda7.5 or 8.0RC ) and testing managed memory in fortran on MESONH , a big Frecnh Fortran90 Weather Model .
A present time the code compile with managed memory , run incorrectly ( Nan ) on nvidia , and "seg fault" on host .

Here is a sample test case with fortran pointer showing/doing the "seg faut" on the host part , but not in the nvidia part ( Maxwell/K620 or Kepler/Titan or K40 )

I've no seen in the doc on managed memory any limitation on using pointer with managed memory .
One of the big advantage/goal of this one been precisely to simplify derive-type management & pointer usage !

Code:
PROGRAM MANAG_POINTER
 
  IMPLICIT NONE

  REAL , DIMENSION(:), POINTER , CONTIGUOUS :: ZTAB
  !REAL , DIMENSION(:), ALLOCATABLE          :: ZTAB
 
  ALLOCATE(ZTAB(1000000))
 
  !$acc kernels copyout(ZTAB)
  ZTAB = 10.767867868
  !$acc end kernels
 
  print*,'ZTAB=',ZTAB(123456)
 
END PROGRAM MANAG_POINTER


Compiled with managed memory
Code:
pgf90 -Mcuda -ta=host,tesla:managed -Minfo=acc manag_pointer.f90 -o manag_pointer
manag_pointer:
     10, Generating copyout(ztab(:))
     11, Loop is parallelizable
         Accelerator kernel generated
         Generating Tesla code
         11, !$acc loop gang, vector(128) ! blockidx%x threadidx%x


Running it on nvidia kepler/maxwell , no problem
Code:
CUDA_VISIBLE_DEVICES=1 ACC_DEVICE=NVIDIA ./manag_pointer
 ZTAB=    10.76787


Running on the host = Seg Fault
Code:
CUDA_VISIBLE_DEVICES=1 ACC_DEVICE=HOST ./manag_pointer
Erreur de segmentation



Changing the pointer to allocatable ( or removing the managed otion ) solve the problem but it is not applicable for us ( big code with lot of derive type + pointer ) .

For our big code it very important to have in the same executable the double target host/tesla:managed at the same time to track 'bit reproducible' problems .

REM : with the allocatable , I got also a "seg fault" without the '-Mcuda' option

Bye

Juan
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6636
Location: The Portland Group Inc.

PostPosted: Mon Jun 20, 2016 10:56 am    Post subject: Reply with quote

Hi Juan,

I talked with our compiler engineers and this is something that think they can support in a future release. I've added TPR#22656 to track it.

Thanks!
Mat
Back to top
View user's profile
escj



Joined: 30 Sep 2009
Posts: 65
Location: Laboratoire d'Aérologie, Toulouse, FRANCE

PostPosted: Tue Jun 21, 2016 5:41 am    Post subject: Reply with quote

Hello Mat .

Think you for the rapid answers .

-> So for the host part , it's not supported yet , but will be .

-> But and the device part , are the fortran pointer actually working
like it the case for all the linked lists case found on the net in C or C++
( I'm testing it with the driver CUDA8.0RC a present time )

Bye

Juan
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group