Problem in Dynamic Library

Nvcc likely does more than just that. You could try compiling it with gcc only to see whether the autoinits work with dynamic libraries. In face of mysterious issues like that, it is highly advisable to simplify things and add complexity bit-by-bit until you reproduce the issue.