You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CUDA 13.x及以上版本GitHub Actions构建时CMake找不到crt/host_config.h

CUDA 13.x + CMake 4.3.2 + VS2022 配置阶段头文件查找失败问题

我在Windows环境下通过GitHub Actions为cuda-api-wrappers库构建示例程序,测试覆盖多个CUDA版本。从CUDA 13.0.x开始,CMake配置阶段出现失败:编译CMakeCUDACompilerId.cu时,无法找到crt/host_config.h头文件,具体报错如下:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_runtime.h(82): fatal error C1083: Cannot open include file: 'crt/host_config.h': No such file or directory
[D:\a\cuda-api-wrappers\cuda-api-wrappers\build\CMakeFiles\4.3.2\CompilerIdCUDA\CompilerIdCUDA.vcxproj]

对应的编译命令为:

#$ cl.exe -D__NV_NO_HOST_COMPILER_CHECK=1 
@"C:\Users\RUNNER~1\AppData\Local\Temp/tmpxft_00001608_00000000-8.res" >
 "C:/Users/RUNNER~1/AppData/Local/Temp/tmpxft_00001608_00000000-6_CMakeCUDACompilerId.cpp4.ii" 
  CMakeCUDACompilerId.cu

补充信息

  • host_config.h确实存在于CUDA 13.0的默认安装路径:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\host_config.h
  • CUDA 13.2版本也出现完全相同的问题
  • 当前使用CMake 4.3.2,主机端编译器为MS Visual Studio 2022

问题

这是已知问题吗?是否需要在CMakeLists.txt中添加CUDA 12.x及更早版本不需要的特殊配置?


内容的提问来源于stack exchange,提问作者einpoklum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.01 23:34:53