CUDA9.1 Visual Studio Integration 安裝失敗問題,如何解決?

最近更新微軟2018.4的更新,也更新過397.31的NVIDIA顯卡驅動,VS的cuda程序可編譯但是找不到CUDA,並報錯。重裝cuda後發現一直卡在Visual Studio Integration Fail。如何解決呢


  1. 用 zip 打開,解壓到一個文件夾中
  2. 打開setup.exe,執行 自定義安裝
  3. 取消勾選 VS integration
  4. 安裝完成後,找到 CUDAVisualStudioIntegrationextrasvisual_studio_integrationMSBuildExtensions 複製裡面的所有文件
  5. 打開自己的 VS2017 的安裝目錄,比如 C:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7IDEVCVCTargetsBuildCustomizations,把第四步中選中的文件複製進來即可


這個問題在Nvidia的devtalk論壇里討論過。

https://devtalk.nvidia.com/default/topic/1033111/cuda-setup-and-installation/cuda-9-1-cannot-install-due-to-failed-visual-studio-integration/?

devtalk.nvidia.com

https://devtalk.nvidia.com/default/topic/1027299/cuda-setup-and-installation/cuda-9-failed-to-support-the-latest-visual-studio-2017-version-15-5/post/5225807/#5225807?

devtalk.nvidia.com

當時管理員給出的解決方案有兩種:

  1. 卸載當前的VS 2017。下載安裝15.4.5版本的VS 2017,再安裝CUDA 9。Installing an Earlier Release of Visual Studio 2017
  2. 不卸載當前的VS 2017,安裝140工具集,之後所有CUDA項目都是用140工具集,而不是141工具集。

Using the latest VS2017 Community (15.6.6) and CUDA 9.1 on Windows 10 x64 with a GTX 1050 Ti. Upon following the instructions in this thread I was able to succesfully build all the samples.

Steps (nothing new, just confirming what was already indicated above):

- Install/Add "VC++ 2015.3 v140 toolset for desktop (x86,x64)" using the VS Installer;

- Install CUDA 9.1 Toolkit;

- Reboot;

- Open "Samples_vs2017.sln" in VS2017;

- For each project do update settings to Platform Toolset = "Visual Studio 2015 (v140)"; you cand select multiple projects;

- Rebuild all.

https://devtalk.nvidia.com/default/topic/1027299/cuda-setup-and-installation/cuda-9-failed-to-support-the-latest-visual-studio-2017-version-15-5/post/5251105/#5251105?

devtalk.nvidia.com


可以改環境變數試試

其他東西不用重灌 重點是CUDA要用自訂安裝

這裡有細節 :

http://markjong001.pixnet.net/blog?

markjong001.pixnet.net


推薦閱讀:

函數指針的轉換,調用轉換後的指針的結果如何,請問Visual Studio是如何實現的?
為什麼很多公司還在用 Visual Studio 2003、2005 等老版本?
對於一個visual studio重度依賴者,有什麼推薦的代碼閱讀工具嗎?
用什麼技術開發一個無依賴的windows桌面開發最為高效?

TAG:NVIDIA英偉達 | MicrosoftVisualStudio | CUDA |