无法在VS 2015中编译CUDA代码 [英] Cannot compile CUDA code in VS 2015

查看:265
本文介绍了无法在VS 2015中编译CUDA代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Windows 10桌面上安装了 Cuda 8.0工具包(删除了所有v7之后)。 5个组件)。尽管以前的版本与Visual Studio 2015不兼容,但我很高兴看到 Nsight 实际上可以创建一个CUDA项目,并且示例随附 .sln 文件的VS 2015版本。

I recently installed the Cuda 8.0 toolkit in my windows 10 desktop (after removing all v7.5 components). Despite previous versions being incompatible with Visual Studio 2015 I was happy to see that Nsight could actually create a CUDA project and samples came with VS 2015 versions of the .sln files.

问题是,在编译样本时,我会遇到这样的错误:

The problem is that when compiling the samples I get errors like this one:


1> C:\程序文件(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(168,9):错误MSB4062 :无法从程序集C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations加载 Nvda.Build.CudaTasks.SanitizePaths任务vNvda.Build.CudaTasks.v8.0.dll。无法加载文件或程序集 Microsoft.Build.Utilities.v3.5,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a或其依赖项之一。该系统找不到指定的文件。确认声明正确无误,并确保程序集及其所有依赖项都可用,并且任务包含实现Microsoft.Build.Framework.ITask的公共类。

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(168,9): error MSB4062: The "Nvda.Build.CudaTasks.SanitizePaths" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\Nvda.Build.CudaTasks.v8.0.dll. Could not load file or assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

另一个奇怪的事情是,今天早些时候,我能够在我的笔记本电脑中编译CUDA示例,不同之处仅在于它安装了VS2015 Community Edition。 有什么建议吗?

The other strange thing is that earlier today I was able to compile the CUDA samples in my laptop that differs only in that it has VS2015 Community Edition installed. Any suggestions?

包含cuda标头的deviceQuery示例:

The deviceQuery sample that contains the cuda headers :

#include <cuda_runtime.h>
#include <helper_cuda.h>

在其单个 cpp 文件中(但没有实际的 .cu 文件)是唯一可以编译并运行良好的文件(如果您想知道的话,我确实拥有CUDA兼容的图形卡,事实上,遵循了安装指南中描述的所有预安装操作) 。

in its single cpp file (but no actual .cu files) is the only one that compiles and runs fine (I do have a CUDA compatible graphics card if that's what you're wondering, as matter of fact all the pre-install actions described in the installation guide were followed).


  • Windows 10 Pro

  • Cuda编译工具,版本8.0,V8.0.44

  • MS Visual Studio Enterprise 2015 /版本14.0.25431.01更新3

  • Microsoft Visual Studio企业版2015 /版本14.0.25431.01更新3 / Microsoft .NET Framework /版本4.6.01586

  • NVIDIA CUDA 8.0 Wizards 8.0

  • 创建新向导NVIDIA CUDA项目和源文件。

  • NVIDIA Nsight Visual Studio Edition 5.2.0.16223

  • Windows 10 Pro
  • Cuda compilation tools, release 8.0, V8.0.44
  • MS Visual Studio Enterprise 2015 / Version 14.0.25431.01 Update 3
  • Microsoft Visual Studio Enterprise 2015 / Version 14.0.25431.01 Update 3 / Microsoft .NET Framework / Version 4.6.01586
  • NVIDIA CUDA 8.0 Wizards 8.0
  • Wizards to create new NVIDIA CUDA projects and source files.
  • NVIDIA Nsight Visual Studio Edition 5.2.0.16223

。 ..即使使用相同设置成功/失败的人的报告也将有所帮助

... even a report from someone succeeding / failing with the same setup would be helpful

推荐答案

Nvda。依赖于 MS .NET Framework 3.5 的Build.CudaTasks.v8.0.dll 程序集,它是 Microsoft.Build.Utilities.v3.5。 dll Microsoft.Build.Framework.dll 进行组装。

Nvda.Build.CudaTasks.v8.0.dll assembly dependent on MS .NET Framework 3.5, on it's Microsoft.Build.Utilities.v3.5.dll and Microsoft.Build.Framework.dll assembles.


无法加载文件或程序集'Microsoft.Build.Utilities.v3.5,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一。该系统找不到指定的文件。

Could not load file or assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

错误表示您没有安装 MS .NET Framework 3.5 或安装已损坏。

Error means you don't have MS .NET Framework 3.5 installed or installation is corrupted.

要检查其是否已安装,请在开始菜单中键入打开或关闭Windows功能 或转到控制面板->程序和功能->打开或关闭Windows功能。如果未选中 .NET Framework 3.5 ,请安装它。

To check is it installed or not type "Turn Windows features on or off" in Start menu or go to Control Panel -> Programs and Features -> Turn Windows features on or off. If .NET Framework 3.5 is not checked, install it.

否则,应验证并修复安装。使用 .NET Framework设置验证工具。它验证 MS .NET Framework 的一个或多个版本的安装状态。如果发现错误,请使用 .NET Framework Cleanup Tool 删除 MS .NET Framework 3.5 并重新安装。

Otherwise you should verify and repair installation. Use .NET Framework Setup Verification tool. It verifies the installation state of one or more versions of the MS .NET Framework. If errors found use .NET Framework Cleanup Tool to remove MS .NET Framework 3.5 and install it again.

这篇关于无法在VS 2015中编译CUDA代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆