I’m very new to CUDA, and just installed Visual Studio 17 community and the CUDA toolkit on my windows 10 machine, that runs a Nvidia Geforce GTX 1060 GPU. So far i have managed to run code sample solutions directly in VS 2017, but only samples.
I have a piece of CUDA accelerated cpp code from my colleague that he compiles and runs on a regular basis on his unix based system. If i open a new project in VS17 and replace the kernel.cu with my code, this won’t build. Neither can i seem to compile sample files from either the system terminal or the VS dev terminal, getting the same errors in both prompts.
I have manually added bin, include and lib to my path to get around the “cl.exe not in path” error that I got in the start in the system terminal, and when running sample codes i get “fatal error C1083: Cannot open include file: ‘helper_cuda.h’: No such file or directory”, whilst my colleagues code returns
nvcc RWcuda2.cu RWcuda2.cu RWcuda2.cu(121): error: expression must have a constant value RWcuda2.cu(121): note: the value of variable "Tsub" (119): here cannot be used as a constant 1 error detected in the compilation of "C:/Users/<user>~1/AppData/Local/Temp/tmpxft_00004d0c_00000000-12_RWcuda2.cpp1.ii".
but a whole different set of errors when building from VS17, all of the above which leads me to believe the code isn’t the issue here.
I am calling the code by
in the terminal, and in VS17 i’ve tried to use the build option. I have also tried both reinstalling VS17 and reinstalling the CUDA toolkit several times. Hope you might be able to help me out.