cuda-gdb gets "The CUDA driver has hit an internal error." at first CUDA usage.

The program runs properly under regular gdb and under valgrind. (The kernel just doesn’t produce the values I expect.)

But cuda-gdb fails on the very first cuda call:

#0  0x00007ffff41e4440 in cudbgReportDriverInternalError () from /usr/lib64/nvidia/
#1  0x00007ffff41e8743 in cudbgReportDriverInternalError () from /usr/lib64/nvidia/
#2  0x00007ffff42769c4 in cuEGLApiInit () from /usr/lib64/nvidia/
#3  0x00007ffff42c556e in cuInit () from /usr/lib64/nvidia/
#4  0x00007ffff7b8a19a in __cudaInitModule () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/
#5  0x00007ffff7b8a1f1 in __cudaInitModule () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/
#6  0x00007ffff753ce20 in pthread_once () from /lib64/
#7  0x00007ffff7bc2389 in cudaVDPAUSetVDPAUDevice () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/
#8  0x00007ffff7b8645a in __cudaInitModule () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/
#9  0x00007ffff7b8b67b in __cudaInitModule () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/
#10 0x00007ffff7baf37a in cudaFree () from /usr/local/cuda-9.1/targets/x86_64-linux/lib/

(I have a cudaFree(0) call up front to force initialization.)

CentOS 7, CUDA 9.1.85, gcc 4.8
Driver version is 390.12

There are two GPU cards, the program uses device 0. deviceQuery reports:
Device 0: “GeForce GTX 1080 Ti”
Device 1: “Quadro P400”

Hi, dlevi

Is this specific to your application?

If yes, please provide us the app you used and list your usage of cuda-gdb.

Thanks !

It appears the first CUDA call must come from the main thread.