Fortran PGI Compiler Copy to Constant Variable failure

Hello all. Wondering if anyone has come across this error before? I think I’m missing some Fortran stuff but I’m not sure. I’m copying a variable to constant memory. What is interesting is that a few things have changed in the meantime. The first version I had was pretty good and worked well. However Ive changed the hardware and the driver.

I’m currently using nvidia docker with Ubuntu 14.04LTS. nvidia-smi reports

+------------------------------------------------------+                       
| NVIDIA-SMI 361.42     Driver Version: 361.42         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960     Off  | 0000:01:00.0      On |                  N/A |
| 30%   26C    P8    10W / 120W |    217MiB /  2039MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

This card is also in use as my display card.

The constant term is defined here:

13   use cudafor
14   integer, constant :: n_flow_vars_OP2

It is set here:

istat = cudaMemcpyToSymbol(c_loc(n_flow_vars_OP2), N_FLOW_VARS, 1, 0, cudaMemcpyHostToDevice)
write(*,*) "ISTAT", cudaGetErrorString(istat)

The output is

ISTAT
invalid device symbol

Interestingly, copying like this gives a different message

istat = cudaMemcpy(N_FLOW_VARS,n_flow_vars_OP2, 1, cudaMemcpyHostToDevice)

gives

0: Get Symbol Address (cmblk=0xa81e60) FAILED: 13(invalid device symbol)

I’ve seen some things about using a string representation vs the actual symbol but I’ve had issues with both. Has anyone seen this sort of thing before?

Cheers

Ben

Hi Ben,

These look like errors that occur when running binaries built for older devices on a Maxwell. What version of the compiler and flags are you using? We didn’t start supporting Maxwell (cc50) devices until the 15.7 release. Also, if you’re using a “cc35” or other sub-option which specifies the compute capability, either remove the flag or use “cc50” instead.

  • Mat
% pgf90 -Mcuda -V15.5 test.cuf ; a.out
0: copyin Symbol Memcpy (dev=0x605f00, host=0x7fff2183f34c, size=4, offset=0) FAILED: 13(invalid device symbol)
% pgf90 -Mcuda -V15.7 test.cuf ; a.out
 a=    6.000000        6.000000        6.000000
 b=    8.000000        8.000000        8.000000        8.000000
    8.000000        8.000000        8.000000        8.000000
    8.000000        8.000000        8.000000        8.000000
    8.000000        8.000000        8.000000        8.000000
    8.000000        8.000000        8.000000        8.000000

Thanks! I think this is definitely the thing. sticking with the defaults of the compiler appears to work. -Mcuda alone appears to work. I need to double check the compiler flags again to figure out which compute capability I should be targeting.

Initially I was using -Mcuda=cuda7.0,cc35 but I suspect this is incorrect.

Cheers

Ben