Using CUDA Samples in Custom Directories

Hello all,

I’m trying to use one of the CUDA samples in a directory other than the one it comes installed in. The directions here: specify how to edit the samples by copying it to the same directory (so the original isn’t overwritten), but I want to know how to use these samples in an entirely different directory (NOT ProgramData\NVIDIA Corporation\CUDA Samples\v6.0…)

I tried copying the contents of the sample I want to build off of (2_Graphics/simpleGL) to my new directory, and then changed the following properties of my VS2012 solution:

  • CUDA C/C++ -> Additional Include Directories
  • Linker -> Additional Library Include Directories
  • In the samples, these reference relative paths to the OpenGL header files and libraries in the CUDA Samples\v6.0\common… directory, so I changed them to absolute paths, but this didn’t work. If I modify the samples as suggested in the link above and just make a copy in the same samples directory, and change the properties to use absolute paths there, it works, but this is not what I want. Clearly there is something I’m missing, but I’m at a loss as to what. Thanks in advance for any help!