CUDA-GDB + CUDA-Fortran + Shared Memory

Hello,

I am working with CUDA-Fortran and am trying to debug some code containing arrays in shared memory. I read that values of shared memory variables are printed in CUDA-GDB as in the following example:

(cuda-gdb) print &array
$1 = (@shared int (*)[0]) 0x20
(cuda-gdb) print *(@shared int*)0x20

However, when trying to invoke the address of any shared memory variable I get the message “No symbol ‘’ in current context.”

Is this happening because I use CUDA-Fortran? Is there any other way to access shared memory variables?

-Nils

Hi Nils,

Could you tell me more information? Like

  1. which version of cuda you used.
  2. which version of PGI you used.
  3. according to Using Shared Memory in CUDA Fortran | NVIDIA Technical Blog, there are several ways to use shared memory, which one you used.
  4. If you can show me more your src, it will be easier for me to reproduce this issue.

PS: As I know, you can just simply use “print array(index)” to view the variable in array, no matter it’s shared or not.

I got the same error, “No symbol “a_s” in current context” when I tried “print a_s” in cuda-gdb.

It’s a very simple CUDA FORTRAN program. I am using CUDA 8.0 and pgfortran 17.4-0 64-bit target on x86-64 Linux -tp haswell.

I have exactly the same problem. No idea how to print the shared memory in cuda-fortran code using cuda-gdb. Has anybody figured it out?

Hi, @huberytao

I can reproduce the issue and have filed an internal ticket for dev tracking.
Will let you know if there is any update. Thanks for using cuda-gdb !