CUDA 安装问题解决

1. 问题:
在win8下安装了最新的cuda5.5,新建了一个工程,尝试编译的时候失败了,错误信息如下:

1>  Compiling CUDA source file kernel.cu...
1>  
1>  C:\Users\某某\Documents\Visual Studio 2012\Projects\matrixAssign\matrixAssign>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd  " -o Debug\kernel.cu.obj "C:\Users\某某\Documents\Visual Studio 2012\Projects\matrixAssign\matrixAssign\kernel.cu" 
1>CUDACOMPILE : Catastrophic error : cannot open generated C file "C:/Users/某某/AppData/Local/Temp/tmpxft_000011b4_00000000-2_kernel.cudafe1.gpu": Permission denied
1>c:\program files\nvidia gpu computing toolkit\cuda\v5.5\include\math_functions.h : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失


然后我百度了一下,说应该是temp文件夹的权限问题,我就把用户环境变量中的temp改成了%SystemRoot%\TEMP,然后再编译就出现了如下问题:

 Compiling CUDA source file kernel.cu...
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB3686: 无法创建 Xaml 任务。编译失败。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB3686: 未能找到源文件“C:\Windows\TEMP\jzfheu3h.0.cs”
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB3686:
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB4036: 未找到“CudaCompile”任务。请检查下列各项: 1.) 项目文件中的任务名称与任务类的名称相同。2.) 任务类为“public”且实现 Microsoft.Build.Framework.ITask 接口。3.) 在项目文件中或位于“C:\Windows\Microsoft.NET\Framework\v4.0.30319”目录的 *.tasks 文件中使用 正确声明了该任务。
解决方法
 以管理员身份运行VS

2. 问题:
warning C4819?
warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss 
解决
打开出现warning的文件,Ctrl+A全选,然后在文件菜单:file->Advanced save options,在弹出的选项中选择新的编码方式为:UNICODE- codepage 1200 ,点确定后编译。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值