CUDA 与 Visual Studio 2022 版本 17.10 的兼容性

问题描述 投票:0回答:1

我刚刚将 Visual Studio 2022 升级到最新版本 17.10,发现我使用 CUDA v12.0 的程序无法编译,因为

NVIDIA GPU Computing Toolkit\CUDA\v12.0\include\crt\host_config.h
中的错误:

#if _MSC_VER < 1910 || _MSC_VER >= 1940

#error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.

因为

_MSC_VER = 1940
在 Visual Studio 2022 v17.10 中。

在我的情况下使用编译标志

-allow-unsupported-compiler
是否安全,或者只是修补
host_config.h
以允许更高的_MSC_VER,或者Visual Studio 2022 v17.10实际上与CUDA 12.0(及更低版本)不可修复地不兼容?

visual-c++ cuda
1个回答
0
投票

我使用 CUDA 工具包(版本:12.2)测试了 Visual Studio 2022 社区(版本:17.10)。 并有同样的错误。

我将Visual Studio版本回滚到17.9.2后,解决了。

我认为最新的MSVC版本14.40不支持旧版本的CUDA。

© www.soinside.com 2019 - 2024. All rights reserved.