PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Initializing the Accelerator

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
THX 1138



Joined: 30 Jun 2011
Posts: 103

PostPosted: Fri Sep 23, 2011 9:16 am    Post subject: Initializing the Accelerator Reply with quote

In one of your early programs in "The PGI Accelerator Programming Model on NVIDIA GPUs Part 1" you comment out the line acc_init which is in the code. You later uncomment the that line and show how much faster the program (or at least thta section of it) runs when the acclerator has been initialzed. This is all true as far as it goes.

But the program as a whole does not run faster. You stll must initialize the accelerator, but now you do it separately from the part that is moves data and calculates on the GPU. It is faster, but the whole prgram is not faster.

Would it not be better to start the accelartor initialization be the program is ever run?


THX 1138
Then that part would never figure in to the execution and time of the program.
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Sep 23, 2011 2:40 pm    Post subject: Reply with quote

Hi THX 1138,

On Linux, the CUDA driver will power down devices when not in use. It takes approximately 1 second per device to bring them back up with this cost being incurred upon first use. "acc_init" was added so that a programmer could separate out this cost. Otherwise it would be incurred upon entry into the first accelerator region.

Quote:
Would it not be better to start the accelartor initialization be the program is ever run?
The utility 'pgcudainit' will hold devices open so they will not be powered down. Running pgcudainit in the background or from another shell will eliminate this initialization cost.

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling 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