接收了师兄的一个项目,其中用到了CUDA。我的VS版本是2015,CUDA版本是9.0,编译后报错,错误代码如下:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 9.0.targets(707,9): error MSB3721: 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe” -gencode=arch=compute_50,code="sm_50,compute_50" --use-local-env --cl-version 2015 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64” -x cu -I"C:\Program Files\opencv\build\include\opencv2" -I"C:\Program Files\opencv\build\include\opencv" -I"C:\Program Files\opencv\build\include" -ID:\SDK\dcamsdk4\inc -ID:\SDK\Sapera\Classes\Basic -ID:\SDK\Sapera\Include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -I.\GeneratedFiles -I. -IE:\Qt\Qt5.13.0\5.13.0\msvc2015_64\include -I.\GeneratedFiles\Debug -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -Xcompiler "/EHsc /W1 /nologo /Od /FS /Zi /MDd " -o x64\Debug\pixelConvert.cu.obj “H:\VS2015\CameraPro\CameraPro\pixelConvert.cu””已退出,返回代码为 1。
但是我运行CUDA例程时就没有报错。想请教一下各位前辈报错的原因及解决方法