PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

error LNK2019: unresolved external symbol __pgi_cu_init

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



Joined: 31 Jan 2011
Posts: 3

PostPosted: Sat Jun 25, 2011 1:20 am    Post subject: error LNK2019: unresolved external symbol __pgi_cu_init Reply with quote

I hve been trying to compile simple do loops using accelerator directive "!$acc region'. but I am getting the following error. I have enabled the target accelerator in properties (-ta=nvidia)

!$acc region
do i= 1,400
do k= 1,5000
do j= 1,1000
j=j+1
end do
end do
end do
!$acc end region

ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cu_init referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_allock referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_uploadk referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_paramsetk referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_launchk referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_downloadk referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_freek referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cu_close referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterFatBinary referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterFunction referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterVar referenced in function MAIN_
ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaUnregisterFatBinary referenced in function MAIN_
C:\Users\INTEL\Documents\Visual Studio 2010\Projects\PVFProject4\PVFProject4\x64\Debug\PVFProject4.exe : fatal error LNK1120: 12 unresolved externals
PVFProject4 build failed.

Can you tell the reason behind this error.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Jun 27, 2011 12:00 pm    Post subject: Reply with quote

Hi Kerry,

Whenever I see these undefined references errors, it's usually because the user forgot to add "-ta=nvidia" to the link. However, by setting target accelerator property in PVF, the -ta=nvidia flag is added to both the compile and link so I'm not sure why you're getting this.

Can you please double check the build log (the link given in the command window after the build) to see if -ta=nvidia is being added? Post the build log or sending it to PGI Customer Sever (support@pgroup.com) might be helpful as well.

- Mat
Back to top
View user's profile
Kerry Black



Joined: 31 Jan 2011
Posts: 3

PostPosted: Mon Jun 27, 2011 10:48 pm    Post subject: Reply with quote

Mat
I am posting the build log for the project here. the -ta= nvidia flag is present in the compiling but it is not in the linking.

PVF Build Log

Compiling Project ...

ConsoleApp.f90

c:\program files\pgi\win64\11.6\bin\pgfortran.exe -Hx,123,8 -Hx,123,0x40000 -Hx,0,0x40000000 -Mx,0,0x40000000 -Hx,0,0x20000000 -V -Mpreprocess -g -Bstatic -Mbackslash -Mextend -mp -Mcuda=fastmath -Mfree -Mbounds -Mchkptr -Mchkstk -Mimsl -Mmkl -I"C:\Program Files\PGI\win64\11.6\include" -I"C:\Program Files\PGI\win64\11.6\lib" -I"C:\Program Files\PGI\win64\11.6\include_acc\OT_10" -I"C:\Program Files\PGI\win64\11.6\include_acc" -I"C:\Program Files\PGI\win64\2011\cuda\3.2\lib64" -I"C:\Program Files\PGI\win64\2011\cuda\3.2\include" -I"C:\Program Files\PGI\win64\2011\cuda\4.0\lib64" -I"C:\Program Files\PGI\win64\2011\cuda\4.0\include" -I"c:\program files\pgi\win64\11.6\include" -I"C:\Program Files\PGI\Microsoft Open Tools 10\include" -I"C:\Program Files\PGI\Microsoft Open Tools 10\PlatformSDK\include" -tp=core2-64 -ta=nvidia,fastmath,mul24,wait -Minform=warn -module "x64\Debug" -Mkeepasm -Manno -Minfo=accel,ccff,ftn,inline,ipa,intensity,loop,lre,mp,opt,par,unified,vect -o "x64\Debug\ConsoleApp.obj" -c "C:\Users\INTEL\Documents\Visual Studio 2010\Projects\test_for_acceleration\PVFProject4\ConsoleApp.f90"

Command exit code: 0

Command output: [PGF90/x86-64 Windows 11.6-0 Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved. Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved. C:\Users\INTEL\Documents\Visual Studio 2010\Projects\test_for_acceleration\PVFProject4\ConsoleApp.f90(16) : warning W0115 : Assignment to DO variable j in loop 0 inform, 1 warnings, 0 severes, 0 fatal for etimetest PGF90/x86-64 Windows 11.6-0 Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved. Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved. etimetest: 13, Intensity = 2002000400.00 Loop is parallelizable Accelerator kernel generated 13, !$acc do parallel, vector(256) ! blockidx%x threadidx%x 19, Sum reduction generated for i 14, Intensity = 5005000.00 Loop is parallelizable 15, Intensity = 1.00 Loop carried scalar dependence for 'j' at line 16 Inner sequential loop scheduled on accelerator pgfortran 11.6-0 64-bit target on x86-64 Windows -tp core2-64 Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved. Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved. ]

Linking...

c:\program files\pgi\win64\11.6\bin\pgfortran.exe -Wl,/libpath:"c:\program files\pgi\win64\11.6\lib" -Wl,/libpath:"C:\Program Files\PGI\Microsoft Open Tools 10\lib\amd64" -Wl,/libpath:"C:\Program Files\PGI\Microsoft Open Tools 10\PlatformSDK\lib\AMD64" -Yl,"C:\Program Files\PGI\Microsoft Open Tools 10\bin\amd64" -g -Bstatic -o "C:\Users\INTEL\Documents\Visual Studio 2010\Projects\test_for_acceleration\PVFProject4\x64\Debug\PVFProject4.exe" "x64\Debug\ConsoleApp.obj"

Command exit code: 2

Command output: [ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cu_init referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_allock referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_uploadk referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_paramsetk referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_launchk referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_downloadk referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cuda_freek referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __pgi_cu_close referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterFatBinary referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterFunction referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaRegisterVar referenced in function MAIN_ ConsoleApp.obj : error LNK2019: unresolved external symbol __cudaUnregisterFatBinary referenced in function MAIN_ C:\Users\INTEL\Documents\Visual Studio 2010\Projects\test_for_acceleration\PVFProject4\x64\Debug\PVFProject4.exe : fatal error LNK1120: 12 unresolved externals ]

PVFProject4 build failed.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jun 28, 2011 9:12 am    Post subject: Reply with quote

Hi Kerry,

Yes, it appears that the "-ta" flag is not being used in the link. It may be that you set the Target NVIDIA Accelerator (-ta=nvidia) and the Enable CUDA Fortran (-Mcuda) properties for the file instead of for the project. Doing so creates a situation where the flags are used for compilation but not linking. If this is the case, you will need to set these properties at the project level.

A note about project vs. file properties. In PVF, project properties are used for all files until a particular file's property or properties are set individually. Once that's been done, the property overridden at the file level must continue to be adjusted at the file level for that property for that file. So if Kerry manually changes the file's property to 'No' and the project's property to 'Yes', the project property will not override the file's property and the file will be compiled without the flag. This issue is a known limitation in PVF.

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



Joined: 31 Jan 2011
Posts: 3

PostPosted: Tue Jun 28, 2011 8:00 pm    Post subject: Reply with quote

Mat
Thanks a lot for your help. You are right, I was using target accelerator just for the source file. Now when I set it ON for whole project, the code is running great.
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