Exception calling SetCudaDevice in bare-bones example, other tutorial works ok. Advice please?

Hello all,
I’m trying to build a GVDB application from the ground up so that I understand all the parts.

I have a “Win32 C++ project” in VS 2015 with #include/linker settings to get me gvdb headers/libs.

When I call SetCudaDevice with -1, or GVDB_DEV_FIRST etc, I get:-
“Exception thrown at 0x00007FFEF9E3DEAF (nvcuda.dll) in gvdb_helloworld.exe: 0xC0000005: Access violation reading location 0x0000000000000017.”

The e.g. gSprayDeposit has built and runs ok on the same PC

Any advice?

Thanks,
Dave.

Did you copy “cuda_gvdb_module.ptx” and “cuda_gvdb_cpoydata.ptx” into the project folder as well?

Thanks for your suggestion.
I just tried that and no luck.
Additionally I just tried copying my exe into the same folder as e.g. gSprayDeposit.exe and running from there but have the same errors.
If you have any other ideas I’m happy to give them a go

SetCudaDevice has only a StartCuda and a bunch of LoadFunction calls inside, it is most likely what happens inside “LoadFunction”. It works just fine for me. So you may take another look at it.