Compiling cuda from command line - win32

2019-04-14 03:14发布

I don't want the whole VS install, especially since it would eat up most of my C space, so I grabbed the SDK. I've also installed the cuda SDK. I'm running into a rather absurd problem though:

d:\cuda\class>nvcc --cubin unit1-1.cu
unit1-1.cu
unit1-1.cu
tmpxft_00001224_00000000-5_unit1-1.cudafe1.gpu
tmpxft_00001224_00000000-11_unit1-1.cudafe2.gpu
'nvopencc' is not recognized as an internal or external command,
operable program or batch file.

d:\cuda\class>nvopencc
nvopencc: no input files
For general help: nvopencc --help
To search help: nvopencc -help:<string>

It's saying that nvopencc isn't a valid command and yet I can run it! Anyone have any idea at all how to fix this?? I found --cubin on a command somewhere and hoped it would work...I have no idea if it's supposed to be there. At any rate, with or without I get the same error.

1条回答
我想做一个坏孩纸
2楼-- · 2019-04-14 04:20

Here's a typical call to nvcc.exe, generated by Visual Studio 2010. Looks like you need to specify the location of the compiler binaries.

nvcc.exe -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -I"\C\common\inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" --keep --keep-dir "Release" -maxrregcount=0 --machine 32 --compile -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MD " -o "Release\kernel.cu.obj" "c:\test_cuda\test_cuda\kernel.cu"

查看更多
登录 后发表回答