-- The CUDA compiler identification is unknown
CMake Error at /home/zkst/libtorch/libtorch11.1/share/cmake/Caffe2/public/cuda.cmake:41 (enable_language):
No CMAKE_CUDA_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
解决:
修改cmake默认指令:
例如在clion中,setting-Cmake-CMake options,填入
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc