从命令行编译cuda - win32 [英] Compiling cuda from command line - win32
问题描述
我不想整个VS安装,特别是因为它会吃掉我的大部分C空间,所以我抓住了SDK。我也安装了cuda SDK。我遇到一个相当荒谬的问题:
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>
这是说nvopencc不是一个有效的命令,但我可以运行它!任何人都有任何想法,在所有如何解决这个问题?我发现 - cubin
在某个地方的命令,并希望它会工作...我不知道它是否应该在那里。无论如何,有或没有我得到相同的错误。
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.
推荐答案
这是一个典型的调用nvcc.exe, Studio。您似乎需要指定编译器二进制文件的位置。
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 -ccbinc:\Program文件(x86)\ Microsoft Visual Studio 10.0 \VC\bin
-I\C\common\inc-IC:\Program Files \ NVIDIA GPU计算工具包\CUDA \v5.0 \include-IC: \程序文件\ NVIDIA GPU计算
Toolkit \CUDA \v5.0 \include--keep --keep-dirRelease-maxrregcount = 0
--machine 32 - -compile -D_MBCS -Xcompiler/ EHsc / W3 / nologo / O2 / Zi / MD-oRelease\kernel.cu.objc:\test_cuda\test_cuda\kernel.cu
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"
这篇关于从命令行编译cuda - win32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!