Can't use CUDA in Visual Fortran

The build failed when I compiled a very simple CUDA fortran code (in .cuf). The compiler suggest:“pgnvd-Error-CUDADIR value is not a directory: f:\program files\pgi\win32/2010/cuda/2.3/bin” and “D:\ProgramsII\CUDA\Loop1\PVFProject3\Test2b.cuf(6) : error F0000 : Internal compiler error. pgnvd job exited with nonzero status code 0”.

What does this mean?

My GPU is NVidia Geforce GTX460. Installed items are CUDA toolkit 3.1, NVidia GPU Computing SDK, and PGI Accelerator Visual Fortran 32-bit for VS2008 (release 10.8). The SDK samples are running correctly.

Anybody know this problem?

Thanks,
Bingray.

Hi,

How do you set your property in Visual Fortran? Did you choose from Project property page -> Fortran -> Language -> Enable Cuda Fortran and set CUDA Fortran Toolkit to 3.1?

Did you set any other property or flags? What OS do you have? Please try our matmul.CUF at http://www.pgroup.com/lit/samples/matmul.CUF and let us know it still fails. If you can post a simple program, we can try it here.

Thank you,
Hongyon

Hi, Hongyon. Thanks a lot.

I did not set any of the property or flags. All properties are by default. After setting “Enable Cuda Fortran” to “Yes” and “CUDA Fortran Toolkit” to “3.1”, the same problem still exists. I tried matmul.CUF and it fails with the same problem:

“pgnvd-Error-CUDADIR value is not a directory: f:\program files\pgi\win32/2010/cuda/3.1/bin”
“D:\ProgramsII\CUDA\Matmul\matmul.CUF(147) : error F0000 : Internal compiler error. pgnvd job exited with nonzero status code 0”

My OS is Microsoft Windows XP Professional Service Pack 3. VS2008 version is Microsoft Visual Studio Team System 2008 9.0.21022.8 RTM.

I installed CUDA and PGI CUDA Fortran in disk (F:). Will it be better if I install them in (C:)?

My simple program:
!=====================================
module allvar
real, constant :: dte,nstep
end module allvar

program prog
use cudafor
implicit none
integer,parameter :: im=800000
real, device :: a(im)
call a05<<<im/256,256>>>(a,im)
end program prog

! Kernel definition
attributes(global) subroutine a05( a, n)
implicit none
real, dimension(*) :: a
integer, value :: n,i
i = (blockidx%x-1) * blockdim%x + threadidx%x
if( i <= n ) a(i) = float(i)*0.5
end subroutine
!=====================================

Thank you very much.
Bingray

Hi,

Does this fail if you invoke from command line? I just want to narrow down if this is PVF issue or something else.

To try from command line,
Open up PGI Visual Fortran->Command Shells->PVF 208 Cmds(64), then type following at command prompt.

%pgfortran -Mcuda matmul.CUF

I will let you know asap if install on F disk might cause a problem.

Thank you,
Hongyon

Hi, Hongyon:

In PGI Visual Fortran->Command Shells->PVF 208 Cmds, it still fails:

===============================================
D:\ProgramsII\CUDA\Matmul>“f:\program files\pgi\win32\10.8\bin\pgfortran.exe” -Mcuda matmul.CUF
NOTE: your trial license will expire in 2 days, 11.4 hours.
NOTE: your trial license will expire in 2 days, 11.4 hours.
pgnvd-Error-CUDADIR value is not a directory: f:\program files\pgi\win32/2010/cuda/2.3/bin
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 <matmul.CUF: 147>
PGF90/x86 Windows 10.8-0: compilation aborted

D:\ProgramsII\CUDA\Matmul>

Thank you again,
Bingray

Hello again,

I uninstalled and reinstalled CUDA and PGI CUDA Fortran to Drive C: by default. Yet when I compiled matmul.CUF again, the compiled still said “pgnvd-Error-CUDADIR value is not a directory: f:\program files\pgi\win32/2010/cuda/3.1/bin”. Why is it still related to “F:”?

Under the directory “C:\Program Files\PGI\win32\2010\cuda\3.1”, I found 3 directories: bin, include, and open64. The bin\ is just what I need. Under “F:\Program Files\PGI\win32\2010\cuda\3.1”, there are 2 dirs: lib\ and open64, just like before.

It seems that there are something wrong with the pgnvd-Error-CUDADIR value settings.

Thanks a lot,
Bingray

Hi,

You will also need to uninstall and reinstall PGI Visual Fortran 10.8 too OR PGI Workstation 10.8, whichever 10. 8 you have installed. Sorry. That will reset all variables correctly. The compiler expects to have CUDA in the same directory(disk).

Let me know if this works.
Hongyon

Hi,

I did uninstall and reinstall PGI Visual Fortran 10.8 too. But it doesn’t work. Not all of the variables could be reset correctly. The system seems to remember the directory of 1st time installation. How to uninstall it completely?

Thanks a lot,
Bingray

Hi again,

Today my classmate installed the very same CUDA toolkit 3.1, SDK, and PGI Visual Fortran 10.8 on his computer. All directories were set on C: by default. Now he can compile matmul.f successfully. But his linking fails. Error messages are:

Linking…
matmul.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function _MMUL_MOD_MMUL_KERNEL__ENTRY@24
matmul.obj : error LNK2019: unresolved external symbol _cudaLaunch@4 referenced in function _MMUL_MOD_MMUL_KERNEL__ENTRY@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_alloc03 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_copyin referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_configure_call referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _CUDATHREADSYNCHRONIZE@0 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_copyout referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_dealloc03 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _pgf90_dev_allocated referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol ___cudaRegisterFatBinary@4 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol ___cudaRegisterFunction@40 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function _MMUL_MOD_MMUL@24
matmul.obj : error LNK2019: unresolved external symbol _CUDASETDEVICE@4 referenced in function MAIN
matmul.obj : error LNK2001: unresolved external symbol _CUDAFOR
F:\CUDA_Test\PVFProject1\Win32\Debug\PVFProject1.exe : fatal error LNK1120: 14 unresolved externals
PVFProject1 build failed.

On my computer, compiling still fails. And my lisence will expire in 1 day and 3.81 hours. I wish I could figure it out soon.

Thank you,
Bingray

Hi,

He will need to make sure the file name ending with .cuf , not .f.

Regarding the license, please contact trs@pgroup.com and explain your situation. They might be able to do something with it.

Hongyon

Hi, Hongyon

It is definitely a .CUF file, not .f file. I reported a wrong filename suffix last time, sorry. The matmul.CUF was directly downloaded from your website.

Many thanks,
Bingray

Hi,

My classmate’s linking errors are still there. By now, the power of CUDA has never been revealed here. How do we fix it?


Thanks a lot,
Bingray

Hi,


You will neet to set your property in Visual Fortran.
From Project property page -> Fortran -> Language -> Enable Cuda Fortran.

This should solve the linking problem.

Hongyon

Hi, Hongyon.


CUDA fortran works on my classmate’s computer now. Thank you!

Last time he had set file property page before setting project property page, which causes lingking errors. Now only the project property page is set, and it works.

We are very glad to see the CUDA code running.


Thank you very much!
Bingray