Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed. Compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe
时间: 2023-08-24 19:06:40 浏览: 432
根据引用\[1\]中的信息,编译CUDA编译器标识源文件"CMakeCUDACompilerId.cu"失败。根据引用\[2\],CUDA的路径设置为C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2。根据引用\[3\],在CUDA 11.6.props文件的第12行后添加路径C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6。根据您提供的问题,编译器路径为C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin/nvcc.exe。
根据这些信息,可能的原因是您的CUDA版本与CMake配置文件中指定的版本不匹配。您可以尝试更新CMake配置文件中的CUDA路径,将其设置为C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1,以与您的CUDA版本相匹配。这样,CMake将能够找到正确的编译器并成功编译CUDA编译器标识源文件。
#### 引用[.reference_title]
- *1* *3* [CMake编译CUDA项目报错](https://blog.csdn.net/qq_26157437/article/details/129834852)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [nvcc fatal : Cannot find compiler 'cl.exe' in PATH](https://blog.csdn.net/qq_40993412/article/details/81454531)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文