CUDA runtime crashes silently

I’ve got one strange problem with CUDA runtime functions.
When I call cudaGetDeviceCount() to determine if there are CUDA devices on the system it just kills active thread silently. No error return codes, no exceptions.

I’m seeing this problem only on one PC and only with one program (out of 3, all using same initialization code), so I guess this is a compatibility issue.

Any ideas how to hunt it down? =)

Okay, it seems that it’s better not to call CUDA functions from DllMain(),
as this may create someties not-so-easy to find problems :)

It is best not to do much of anything in DllMain(). :-)

Even malloc() is suspect.

See Michael Grier’s blog at [url=“mgrier's WebLog | Microsoft Docs”][/url]

Actually my problem isn’t solved yet. I’ve moved it from DllMain(), but it still silently kills thread on first CUDA function. I’ve seen this problem only on one PC, so I still think that this is compatibility issue.