PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Problems with nvcc+PGF with new install - missing "__en

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



Joined: 08 Apr 2010
Posts: 78

PostPosted: Thu Aug 05, 2010 9:27 am    Post subject: Problems with nvcc+PGF with new install - missing "__en Reply with quote

Hi. We've just installed a new machine with all the latest libraries (PGF 10.6 etc.).

We've got an annoying problem. nvcc isn't playing nicely with Portland. Here is what's happening.

If I compile the MersenneTwister kernel example on our old machine, I get this:

Code:
nvcc -c MersenneTwister_kernel.cu -o MersenneTwister_kernel.o
nm MersenneTwister_kernel.o | grep random
[rakers@cuda001 LOCUST-GPU_2.97]$ nm MersenneTwister_kernel.o | grep random
0000000000010028 b _ZZ29__device_stub__Z9randomgpuPfiE3__f
0000000000009298 T __device_stub__Z9randomgpuPfi
0000000000009310 T randomgpu__entry


Fine - everything as it should be.

But if I compile on our new machine, I get this:


Code:
[rakers@cuda002 LOCUST-GPU_2.97]$ rm -rf *.o
[rakers@cuda002 LOCUST-GPU_2.97]$ nvcc -c MersenneTwister_kernel.cu -o MersenneTwister_kernel.o
[rakers@cuda002 LOCUST-GPU_2.97]$ nm MersenneTwister_kernel.o | grep random
0000000000001246 T _Z29__device_stub__Z9randomgpuPfiPfi
0000000000020070 b _ZZ29__device_stub__Z9randomgpuPfiPfiE3__f
00000000000012c7 T randomgpu


Notice how "__entry" is missing off randomgpu. So when I come to link all my code together, pgfortran complains that:

Code:
..../mer_test.cuf:18: undefined reference to `randomgpu__entry'


It looks like nvcc needs to be installed differently. Does anyone have any ideas?

Rob.
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Aug 05, 2010 9:41 am    Post subject: Reply with quote

Hi Rob,

Quote:
It looks like nvcc needs to be installed differently. Does anyone have any ideas?
NVIDIA changed their naming conversion in CUDA 3.0. The fix is to update the CUDA Fortran interface block's C binding name to match the new CUDA C name.

For example:
Code:
    subroutine RandomGPU(d_Rand, n_per_rng) bind(c,name='randomgpu')
        use iso_c_binding
        real(c_float), dimension(:), device :: d_Rand
        integer, value :: n_per_rng  ! pass by value
    end subroutine RandomGPU


Hope this helps,
Mat
Back to top
View user's profile
alfvenwave



Joined: 08 Apr 2010
Posts: 78

PostPosted: Thu Aug 05, 2010 10:07 am    Post subject: Reply with quote

D'OH! I was just staring at my interface blocks when you replied.....

Thanks Matt as always.

Rob.
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