0. 环境
Ubuntu20.04
Cuda 11.8
GeForce 3060, 显卡驱动版本535
1. 问题描述
-- The CUDA compiler identification is unknown
CMake Error at /usr/local/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:603 (message):
Failed to detect a default CUDA architecture.
2. 问题解决
CMakeLists.txt
中 添加 CMAKE_CUDA_COMPILER
定义:
set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.8/bin")