Problems on the linking stage

Dear all,
I face the following problem. I have a shared library that uses CUDA. CUDA code is compiled by NVCC and linked with CUDA runtime library. My main program is compiled with gcc and calls functions from the shared library. It works fine. However, once the main application has been split in bunch of shared libraries, when my CUDA functions from the first library are called from other shared library (which is using CUDA runtime library as well) I’m getting the following error: Runtime API error : invalid argument . The error line corresponds to the cudaMemset function. I’m really confused …

Does anybody have any idea? Thanks a lot in advance!


Is there the possibility that one of your shared libraries is using its own context? If that’s the case if you pass the pointer from another context to it you could expect errors.