CUDA Fortran samples compilation problem - sgemm.cuf

Hello,

I am trying to compile the sgemm.cuf example in the pgi/…/etc/samples directory.

When compiled with pgfortran sgemm.cuf , it compiles and runs successfully.

When compiled with pgfortran -O2 sgemm.cuf , it compiles, but it throws the following error at runtime:

Device:GeForce 8600M GT, 950.0 MHz clock, 255.3 MB memory.

65536 errors were encountered
256x256 * 256x256: 0.008 ms 3998.612 GFlops/s

When compiled with pgfortran -Mcuda=emu sgemm.cuf, the compilation fails with

/opt/pgi/linux86-64/9.0-4/lib/libpgmp.a(setaff.o): In function _mp_setaff': setaff.c:(.text+0xde): undefined reference to numa_available’
setaff.c:(.text+0xe7): undefined reference to numa_set_localalloc' /opt/pgi/linux86-64/9.0-4/lib/libpgmp.a(setaff.o): In function __pgi_nnodes’:
setaff.c:(.text+0xf6): undefined reference to numa_available' setaff.c:(.text+0xff): undefined reference to numa_max_node’
/opt/pgi/linux86-64/9.0-4/lib/libpgmp.a(setaff.o): In function _mp_malloc_local': setaff.c:(.text+0x123): undefined reference to numa_available’
setaff.c:(.text+0x13e): undefined reference to `numa_alloc_local’

I am running Fedora 10 X86_64, using PGI 9.0-4 and the contents of sitenvrc is

set NVOPEN64DIR=/usr/local/cuda/open64/lib;
set CUDADIR=/usr/local/cuda/bin;
set CUDALIB=/usr/local/cuda/lib;
set GCCVERSION=40301;

CUDA 2.2 and NVIDIA driver version NVIDIA-Linux-x86_64-185.18.14


Thank you for your help

Hi hupca_ovidiu,

Device:GeForce 8600M GT, 950.0 MHz clock, 255.3 MB memory.

65536 errors were encountered
256x256 * 256x256: 0.008 ms 3998.612 GFlops/s

It seems the timing is too low, indicating that the kernel didn’t actually get executed. Try adding a call to “cudaGetLastError” in the code to see what the error is. For example:

  
  ...
  integer cuError
  character*120 errMsg
  ....
  cuError = cudaGetLastError()
  if (cuError .ne. 0) then
     errMsg = cudaGetErrorString(cuError)
     print *, trim(errMsg)
  end if

As for the undefined references, these are references in the Numa library which should be linked automatically. Can you post the “ld” (linker) output from the output of “pgfortran -Mcuda=emu sgemm.cuf -v”?

Thanks,
Mat