How to use nvcc?

Hi all,

I have written some C++ code, and I wish to compile it using nvcc, so that it will run on my GPU. My operating system is win 7 x64 (no win 7 forum). I have downloaded and installed the win 7 CUDA drivers and CUDA toolkit, but everytime I try and run nvcc.exe, it closes almost instantly. I managed to get a printscreen of it and it says:

nvcc fatal: no input files specified; use option --help for more information.

nvcc is a command line driven program, even under Windows. You will need to open a command prompt and run it from there, or using scripting or an automated build sytem (like cygwin make or visual studio). The cuda toolkit ships with a PDF which describes how nvcc works and what arguments it takes.

Ok, i’ve tried looking for this PDF, skimmed through the programming pdf and it just said that nvcc is done in more detail in a seperate document that they don’t name. Reference Manual doesnt look like it has anything on nvcc. As you might of guessed, I’m new to programming, and GPGPU is pretty much what I’m doing for my project. Please explain in a way a newb would understand.

There is a document in the same directory as all the other toolkit documentation called “nvcc_2.3.pdf”, formally titled “The CUDA Compiler Driver NVCC”. It contains 39 pages, including everything you want to know.

Im using a laptop. I don’t think the CUDA 190.38 drivers work for laptops. Sorry I forgot to mention this before. I’ll try installing 2.3 and see what happens.

It also exists in the CUDA 2.2 distribution, where it is called nvcc_2.2.pdf. I don’t have any older versions lying around, but it has shipped with every CUDA version I have also installed. You can also download the 2.1 version (and tonnes of other useful stuff) from here:

http://sites.google.com/site/cudaiap2009/m…nline-resources

Thanks, I think i know what I’m meant to do.

I go into command prompt and type in:

C:\CUDA\bin\nvcc.exe -c file directory

and i got an error stating that cl.exe was not in path.

So i searched and found cl.exe in Visual c++ 2008 express edition folder and copy into the same directory that nvcc is in.

Now it says that:

“nvcc fatal: nvcc cannot find a supported cl.exe version. Only MSVC 8.0 and MSVc 9.0 are supported”

Is MSCV microsoft visual c?

I’ve got the same problem. Anyone?

I’ve managed to find this.

http://forums.nvidia.com/index.php?showtopic=73711

Am trying to get it to work for me.

Ok, with help from a PhD student I have managed to use nvcc.exe to compile.

What I have done is replace all the CUDA stuff that was 64 bit with the 32 bit equivalents.

Then the PhD student told me to run the following commands in command propt:

set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0

set VCINSTALLDIR=%VSINSTALLDIR%\VC

set PATH=%VCINSTALLDIR%\BIN;%VSINSTALLDIR%\Common7\IDE;%VSINSTALLDIR%\Common7\Tools;%VSINSTALLDIR%\Common7\Tools\bin;%VCINSTALLDIR%\VCPackages;%PATH%

This works, but as soon as you close cmd it loses all of this. To do it so that it doesn’t lose all of the above you go into environmental variables in advances systems settings and set it up there.

Now I just got to get the object code into a .exe :wallbash: .