Cuda Fortran Ivalid write errors

I have some Cuda Fortran code that I’m trying to run. It compiles fine but I get the following error when I run:

DEV_MKDESC: allocate FAILED:74(misaligned address)

When I run with cuda-memchk I get a bunch of erros of this type:

======== Invalid global write of size 8
========= at 0x000162e8 in /home/mhl105/Projects/SPHear/rhs.cuf:249:rhs_
========= by thread (75,0,0) in block (2,0,0)
========= Address 0x4207294fec is misaligned
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/…/…/…/…/lib64/ (cuLaunchKernel + 0x2cd) [0x24c3ad]
========= Host Frame:/opt/pgi/linux86-64/2017/cuda/7.5/lib64/ [0x14355]
========= Host Frame:/opt/pgi/linux86-64/2017/cuda/7.5/lib64/ [0x143e7]
========= Host Frame:/opt/pgi/linux86-64/2017/cuda/7.5/lib64/ (cudaLaunchKernel + 0x1e1) [0x41fb1]
========= Host Frame:/opt/pgi/linux86-64/17.10/lib/ (__pgiLaunchKernel + 0xa2) [0x6b44b]
========= Host Frame:./sph [0xc8ba]
========= Host Frame:./sph [0x4484]
========= Host Frame:/usr/lib/gcc/x86_64-redhat-linux/4.8.5/…/…/…/…/lib64/ (__libc_start_main + 0xf5) [0x223d5]
========= Host Frame:./sph [0x4349]

Followed by some errors like:

DEV_MKDESC: allocate FAILED:4(unspecified launch failure)

which I assume are a result of the previous invalid writes.

I’m fairly new to Cuda Fortran so any help would be appreciated.


Hi Matt Lear,

“DEV_MKDESC” is when the compiler is trying to make a F90 descriptor for a device array, though I’ve not seen it ever give an “misaligned address” error before, so I’m not sure what’s wrong.

Are you trying to allocate an array on the device or are you using automatics?

Can you post, or send to PGI Customer Service ( the kernel in rhs.cuf that’s getting the error?



Sorry for the delayed reply–I never got any notification that I received a response.

I got past that error but now I get a new one. I’m going to create a new issue and I’ll email a zip with the code to the support address.