cuInit returns CUDA_ERROR_OUT_OF_MEMORY (CUresult 2) in 64-bit application

Good day everyone!

I’m developing a Qt-based (dynamic linking) program and using NVidia H.264 h/w decoder for video stream decoding. Everything works perfectly when I’m building 32-bit version of the app. But cuInit behaves strangely when app is compiled for 64-bit architecture: function call returns CUDA_ERROR_OUT_OF_MEMORY.

I’ve tried to build NVDEC D3D11 sample for 64-bit arch and it works.

What am I missing?

Environment:

  • Windows 10 Pro Anniversary x64 with latest updates
  • Visual Studio Professional 2015 with latest updates
  • NVidia driver version 382.53
  • GeForce GTX 860M / GeForce GT 730 (cuInit fails on both adapters).

If you are using Clang/LLVM’s ASAN during build, there’s a known conflict (with possible solution).

See https://github.com/google/sanitizers/issues/629 discussion on the topic.