PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

cuda malloc use CPU memory

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



Joined: 09 Jan 2013
Posts: 9

PostPosted: Wed Aug 21, 2013 2:32 pm    Post subject: cuda malloc use CPU memory Reply with quote

Hi,

I have a cuda fortran code within a large fortran code which uses significant cpu memory. When the array size increases, cuda malloc returns this error message:

1040 bytes requested; not enough memory 2(out of memory)

With a simpler driver with less cpu memory, this cuda fortran code can run with a much larger array size. So I am curious whether the memory on cpu side causes the problem. Any suggestion?

Thanks,

sjz
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Aug 21, 2013 4:10 pm    Post subject: Reply with quote

Quote:
So I am curious whether the memory on cpu side causes the problem.
I would not think so. The two memories are separate. If you have the pinned attribute on the host array then that memory is managed by the CUDA driver, but that still shouldn't cause an out of memory error on the device.

Is the larger host array the only change? Is the host array larger then 2GB? If so, are you compiling with "-Mlarge_arrays"?


- Mat


Last edited by mkcolg on Thu Aug 22, 2013 4:16 pm; edited 1 time in total
Back to top
View user's profile
sjz



Joined: 09 Jan 2013
Posts: 9

PostPosted: Thu Aug 22, 2013 8:11 am    Post subject: Reply with quote

The original error message:

in so0: cudaMallocPitch: 1040 bytes requested; not enough memory 2(out of memory)


The relevant code:

cudaMallocPitch(dev_asytob, dev_pitch, m, np)

where

real, device, allocatable, dimension(:,:) :: dev_asytob
dev_pitch = 64
m = 130
np=43


I do not believe that array is larger than 2GB.

m is the number of columns to be processed in the driver as well as in
this gpu code.

Do you think that pitch causes problem?

Thanks,


Shujia
Back to top
View user's profile
sjz



Joined: 09 Jan 2013
Posts: 9

PostPosted: Thu Aug 22, 2013 2:39 pm    Post subject: Reply with quote

The problem solved. It is due to a bug in memory allocation. SJZ
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