How to compile CUDA in VC++6.0?

Hi all,

My question is as stated in the title. It may be a very simple question for you guys or you may have seen this question for millions of times. Sorry about that. I am a newbie in CUDA.

I have installed CUDA in my laptop. I would like to compile it first in my laptop and run it in other computers which have the  right graphics cards. I am using VC++6.0. Do I need to do any settings before I can build? 


There are several ways to do so.

  1. Compile your kernel into .cubin and use CUDA Driver API to load that .cubin, initialize device etc. This way may be a bit harder to learn than using Runtime API but it allows you to use CUDA with almost any compiler. And you don’t need to redistribute anything with your application.

  2. VC6 is not supported AFAIK, but I belive it is possible to tweak nvcc to work. Just expect some troubles :) Another option is to download VC++ 2005 Express (it’s free) for use with nvcc and perform final link with VC6. I believe I’ve seen thread on this forum about such setup.

Yah, I tried in vc++ 2005 and download JaredHoberock’s build rule. But I got an error: 1>‘nvcc.exe’ is not recognized as an internal or external command,

1>operable program or batch file.

Could anyone tell me how to fix it?


I found out what the problem is. In the rule file, it specifies the path of nvcc.exe is VC’s installation path under VS. So after the above steps, we need to copy the bin folder from CUDA to the VC’s bin folder under VS.