在cmake的编译过程中,可能会报找不到cuda编译器的错误,如下

-- The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:3 (enable_language):No CMAKE_CUDA_COMPILER could be found.Tell CMake where to find the compiler by setting either the environmentvariable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the fullpath to the compiler, or to the compiler name if it is in the PATH.-- Configuring incomplete, errors occurred!
See also "/home/aaeon/work/yolo-tensorrt/build/CMakeFiles/CMakeOutput.log".
See also "/home/aaeon/work/yolo-tensorrt/build/CMakeFiles/CMakeError.log".

解决办法就是找到cuda编译器所在位置,然后指定给cmake。

1、找到cuda安装所在位置

查看/usr/local,该文件夹下一般保存有你下载的cuda文件以及一个cuda软连接文件,如图

其中的cuda-10.2就是我自己下载的cuda,版本是10.2;而cuda则是指向cuda-10.2的软连接文件。

当你下载多个版本的cuda时,cuda软连接文件指向其中一个你指定的cuda版本,具体哪个版本,可以输入nvcc --version查看。

2、指定cuda编译器

cmake -D CMAKE_CUDA_COMPILER="/usr/local/cuda/bin/nvcc" CMmakeLists.txt

报错 The CUDA compiler identification is unknown;No CMAKE_CUDA_COMPILER could be found.相关推荐

  1. 在aarch64-himix100-linux-gcc下cmake报错(The C compiler identification is unknown)

    项目场景: 华为好望角AI摄像头C系列的算法移植过程中,遇到cmake报错 问题描述: gcc: aarch64-himix100-linux-gcc CMakeLists.txt文档: cmake_ ...

  2. 命令行mvn打包的时候报错:No compiler is provided in this environment. Perhaps you are running on a JRE

    一.前言 这部分是安装Elasticsearch-ik中文分词的时候,用mvn打包报错: No compiler is provided in this environment. Perhaps yo ...

  3. php7链接数据库报错The server requested authentication method unknown to the client

    php7链接数据库报错The server requested authentication method unknown to the client 主要原因 是因为 mysql 8.0 升级了密码 ...

  4. DeepFaceLab报错,CUDA driver is insufficient 解决方法!

    DeepFaceLab报错,CUDA driver is insufficient 解决方法! 参考文章: (1)DeepFaceLab报错,CUDA driver is insufficient 解 ...

  5. CMake问题:The CXX compiler identification is unknown

    CMake问题:The CXX compiler identification is unknown CMake version: 3.7.0rc1 or high Visual Studio 201 ...

  6. 解决禅道升级报错:Column not found: 1054 Unknown column 'readme' in 'zt_im_client'

    解决禅道升级报错:Column not found: 1054 Unknown column 'readme' in 'zt_im_client' The sql is: ALTER TABLE zt ...

  7. 在yolo训练的时候又去测试就会报错:cuda error: out of memory

    在yolo训练的时候又去测试就会报错:cuda error: out of memory, cuda.c  Assertion '0' failed. 不过,如果是用的yolo-tiny.cfg的话是 ...

  8. colaboratory报错:CUDA status Error: file: ./src/blas_kernels.cu : ()

    一直使用colaboratory进行训练,突然有一天报错: CUDA status Error: file: ./src/blas_[kernels.cu](http://kernels.cu) : ...

  9. 报错`RuntimeError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 9.78 GiB total capaci

    报错RuntimeError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 9.78 GiB total capacity; 8. ...

最新文章

  1. [Swust OJ 566]--开N方数(牛顿切线法解高次方程)
  2. 计算机桌面颜色如何设置标准,电脑调整桌面颜色设置_电脑桌面颜色设置
  3. SRAM与SDRAM的区别
  4. C# 跨设备前后端开发探索
  5. python运算符中用来计算整商的是什么_零基础学python,看完这篇文章,你的python基础就差不多了...
  6. Written English-书面-现在完成时
  7. 大数据分析必须要会的统计分析!!!
  8. Python数据分析扩展库pandas的DataFrame排序方法小结
  9. 阿里面试官常问的TCP和UDP,你真的弄懂了吗?
  10. Bailian2980 大整数乘法【大数】
  11. Oracle行转列、列转行的Sql语句总结
  12. 如何解决GBK的编码的文件中的中文转换成为UTF-8编码的文件而且不乱码
  13. 基于SSD目标检测模型的人脸口罩识别
  14. 电脑IE打开慢的主要原因
  15. 背单词的方法:抗遗忘超自然语境记单词01
  16. Linux最最最常用命令!
  17. 以图搜图 - Google 相似图片搜索原理 - Java实现
  18. Node.js项目中动态加载环境变量配置
  19. java 仿qq登陆界面
  20. python类和对象基础详解

热门文章

  1. hnu 暑期实训之愚人节的礼物
  2. 轻量化网络:MobileNets
  3. 目标检测——夏侯南溪目标检测模型之输出信息显示
  4. 模型加速——卷积通道裁剪的学习笔记
  5. 基于阿里云服务器使用宝塔面板搭建 Typecho 博客
  6. JDK10、JDK11、JDK12新特性
  7. 【转】Java 项目UML反向工程转化工具
  8. 树莓派教程 - 1.0 树莓派GPIO库wiringPi 点亮LED
  9. 【Java】Java命名规范
  10. c++右值引用以及使用