cuda-memcheck/6.5 & pgi/15.1 error ?

Hello .

A new strange error with pgi/15.1 detected with cuda-memcheck/6.5
( when searching for an other bug with derived type ) .

REM : I’ve used cuda-memcheck in previous version of cuda/pgi with zero error/warning

A sample acc program give the error :

cuda-memcheck simple_acc_1501
========= Program hit CUDA_ERROR_INVALID_CONTEXT (error 201) due to “invalid device context” on CUDA API call to cuCtxAttach.
========= Saved host backtrace up to driver entry point at error
========= Host Frame:/usr/lib64/ (cuCtxAttach + 0x156) [0x13fc36]
========= Host Frame:/home/escj/dir_PGF/PGI_HOME/linux86-64/15.1/lib/ (__pgi_uacc_cuda_initdev + 0x71d) [0xe70d]
========= Host Frame:/home/escj/dir_PGF/PGI_HOME/linux86-64/15.1/lib/ (__pgi_uacc_enumerate + 0x152) [0x10112]
========= Host Frame:/home/escj/dir_PGF/PGI_HOME/linux86-64/15.1/lib/ (__pgi_uacc_initialize + 0x45) [0x10565]
========= Host Frame:/home/escj/dir_PGF/PGI_HOME/linux86-64/15.1/lib/ (__pgi_uacc_enter + 0x5d) [0xedad]
========= Host Frame:simple_acc_1501 [0x1349]

a= 1.000000
========= ERROR SUMMARY: 1 error

Here is the test case ( but it doesn’t matter) :

REAL :: a(10000)
!$acc kernels
a(:) = 1.0
!$acc end kernels
print*,‘a=’, a(1)

compiled with :

pgf90 -g -ta=nvidia simple_acc.f90 -o simple_acc_1501

The error is present on Opensuse/13.1 & 12.3



Hi Juan,

This isn’t new so I’m not sure why you haven’t seen it before. At the start of the first openACC construct, we check if there’s already a CUDA context created. However, this test can trigger this cuda-memcheck error. The error is benign and can be ignored.

  • Mat