"CUDA Video Decoder D3D9 sample" crash issue


I downloaded the CUDA Video Decoder D3D9 sample, built a Visual Studio 2010 project, run it plays video, everything is great.

However, when I integrate it into my DirectX11 code base, it crashes when calling “cuDeviceGetCount(&device_count)” in the InitD3D9 function. If I skip the call to that it just fails at the next cuda function call.

My question is: Is there something about creating and initializing a DirectX11 device (and all the other things that go with it) somehow making it not play nice with this CUDA example? I could be incorrect, but as far as I know, I should be able to create a DX11 and a DX9 device simultaneously. Of course, the code hasn’t even tried to create the DX9 device yet when it crashes. Basically, all it has really done with CUDA at the point of the crash is call cuInit(0) which returns CUDA_SUCCESS. Any tips on how I can dig into this crash better?

Assuming I solve this first issue, my second question is: Do I need to use DirectX9 for the CUDA video decoding sample or can I change all of the code to use directX11? I’m not sure if there might be a reason that this video decoding needs DX9?

Thanks for the help in advance!

I have “solved” this issue by recreating my project from scratch. I have no idea what was wrong.