opencv安装时找不到cuda的错误解决方式

2023-05-16

编译环境 ubuntu1604+opencv3.2+cuda8.0

编译opencv时碰到如下是错误

Scanning dependencies of target example_gpu_alpha_comp
CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: In function `destroyContexts()':
driver_api_multi.cpp:(.text._Z15destroyContextsv+0xc): undefined reference to `cuCtxDestroy_v2'
driver_api_multi.cpp:(.text._Z15destroyContextsv+0x1c): undefined reference to `cuCtxDestroy_v2'
CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: In function `Worker::operator()(int) const':
driver_api_multi.cpp:(.text._ZNK6WorkerclEi+0x37): undefined reference to `cuCtxPushCurrent_v2'
driver_api_multi.cpp:(.text._ZNK6WorkerclEi+0x893): undefined reference to `cuCtxPopCurrent_v2'
CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: In function `main':
driver_api_multi.cpp:(.text.startup.main+0x11c): undefined reference to `cuInit'
driver_api_multi.cpp:(.text.startup.main+0x133): undefined reference to `cuDeviceGet'
driver_api_multi.cpp:(.text.startup.main+0x14d): undefined reference to `cuCtxCreate_v2'
driver_api_multi.cpp:(.text.startup.main+0x15d): undefined reference to `cuCtxPopCurrent_v2'
driver_api_multi.cpp:(.text.startup.main+0x172): undefined reference to `cuDeviceGet'
driver_api_multi.cpp:(.text.startup.main+0x18c): undefined reference to `cuCtxCreate_v2'
driver_api_multi.cpp:(.text.startup.main+0x19c): undefined reference to `cuCtxPopCurrent_v2'
collect2: error: ld returned 1 exit status
samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/build.make:125: recipe for target 'bin/example_gpu_driver_api_multi' failed
make[2]: *** [bin/example_gpu_driver_api_multi] Error 1
CMakeFiles/Makefile2:39358: recipe for target 'samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all' failed
make[1]: *** [samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....


cmake命令参数如下

cmake -D CMAKE_BUILD_TYPE=RELEASE       -D CMAKE_INSTALL_PREFIX=/usr/local       -D INSTALL_C_EXAMPLES=ON       -D INSTALL_PYTHON_EXAMPLES=ON       -D WITH_TBB=ON       -D WITH_V4L=ON       -D WITH_QT=ON       -D WITH_OPENGL=ON       -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules       -D BUILD_EXAMPLES=ON -D CMAKE_LIBRARY_PATH=/usr/local/cuda-8.0/lib64/stubs -D CUDA_CUDA_LIBRARY=/usr/local/cuda-8.0/lib64/stubs/libcuda.so ..


原因是找不到cuda库,解决方式如下(红色为新添加)

https://github.com/opencv/opencv/pull/10954/commits/5c66ce7f29976bc6307b5a7191f040fa7337e437

https://github.com/opencv/opencv/pull/10954/files

3  samples/gpu/CMakeLists.txt
@@ -50,6 +50,9 @@ endif()
 foreach(sample_filename ${all_samples})
   ocv_define_sample(tgt ${sample_filename} gpu)
   ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_CUDA_SAMPLES_REQUIRED_DEPS})
  if(HAVE_CUDA AND NOT ANDROID)
    ocv_target_link_libraries(${tgt} ${CUDA_CUDA_LIBRARY})
  endif()

   if(HAVE_opencv_xfeatures2d)
     ocv_target_link_libraries(${tgt} opencv_xfeatures2d)
   endif()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

opencv安装时找不到cuda的错误解决方式 的相关文章

  • iOS-UICollectionViewCell自适应文字宽度

    自定义cell pragma mark 自定义cell import 34 SelfSizingCollectCell h 34 import 34 Masonry h 34 define itemHeight 60 64 implemen
  • Linux - Linux下Java安装路径查找;配置Java环境变量

    一 查看Java的安装路径 1 已经安装好了JDK xff0c 也配置了环境变量 1 执行 java version java version 出现了版本号 xff0c 表示安装过了JDK xff0c 配置了环境变量 2 在配置过jdk的情
  • String 转 Enum 对象关键字 Java

    java中 String 字符转成 Enum对象关键字的方法 xff1a 使用valueOf转换
  • 利用select函数实现在Linux环境下实现一个聊天室程序

    C写的 要求 xff1a 用户默认处于广播模式 xff0c 一个客户在其客户端发送的消息 xff0c 其它客户端用户全部可以收到 xff1b 程序支持下列命令 help 显示帮助信息 xff08 思考 xff1a 信息是放在客户端还是服务器
  • 使用UICollectionView做tag显示的时候的对齐方式

    span class token keyword import span span class token builtin UIKit span span class token keyword enum span span class t
  • 字符串切片练习

    获取字符串中汉字的个数 去掉字符串中所有的空格 将字母全部转换为大写和小写 根据标点符号对字符串进行分行 a 61 input 34 请输一串字符 xff1a 34 for i in range 0 len a if a i 61 61 3
  • AngularJs Type error : Cannot read property 'childNodes' of undefined

    一 在AngularJs和JQuery插件共存咋项目中经常会遇到如下异常 html view plain copy Type error Cannot read property 39 childNodes 39 of undefined
  • Go基础入门

    Go vscode配置go开发环境 1 下载vscode https code visualstudio com 2 安装sdk https golang google cn dl 进入这个界面后找到对应版本 go版本 windows am
  • oracle12c常用命令整理

    1 oracle备份方式了解 Oracle的常规备份无非是exp imp expdp impdp rman三种方式 exp imp简单方便 xff0c 适用于跨db版本 跨os平台 异地备份等情况 xff0c 是大家最常用的一种备份方式 e
  • 简述Android手机常用的设备ID

    一 简介 1 设备ID xff1a 简单来说就是一串符号 xff08 或者数字 xff09 类似于我们的身份证号 xff0c 映射现实中硬件设备 排除特殊情况 xff08 模拟器等 xff09 xff0c 设备ID和设备是一一对应的 xff
  • Nuitka将Python源代码编译成可执行文件,注意的地方

    Nuitka的GitHub地址 在Nuitka之前我们最常用的打包工具就是Pyinstaller了 xff0c 但是经过反复考虑 xff0c 我觉得Nuitka也还是很有必要了解记录一下 xff0c 它可以直接将Python源码打包成dll
  • java操作zip压缩文件加密码和解密工具类

    java操作zip压缩文件加密码和解密工具类 lt zip压缩文件工具类 gt lt dependency gt lt groupId gt net lingala zip4j lt groupId gt lt artifactId gt
  • 在CentOS7虚拟机中安装mysql5.7

    写在前面 xff1a 安装环境 xff1a CentOS7虚拟机 xff1b 安装软件 xff1a mysql5 7版本 xff1b 安装时需要切换为root用户权限 安装步骤 xff1a 1 添加官方的yum源 xff0c 创建并编辑my
  • wsl报0x80040326

    今天 开始 运行 wsl 跳出来一个窗口一闪没了 开始 运行 cmd wsl 看到2行报错信息 xff1a Error 0x80040326 Error code Wsl Service CreateInstance 0x80040326
  • VTK笔记——vtkCamera的理解和用法

    其实 xff0c 网上有不少介绍VTK Camera的内容 在3D图形学中 xff0c 相机对于渲染对象来说是必不可少的 我们可以通过它来观察物体 xff0c 包括执行放大缩小 移动相机等操作 xff0c 所以它是我们需要了解的基础和重要的
  • 树莓派4安装Ubuntu20.10桌面版记录(64位系统arm架构desktop版)

    前言 xff1a 这是我在树莓派4上安装Ubuntu20 10桌面版 xff08 64位arm xff09 总结的一些坑 xff0c 欢迎互相交流 xff01 我的博客 xff1a https www 515code com 一 准备 下载
  • 计算机二级C语言基础选择易错题及答案解析(四)

    1 设有定义 char s 81 int i 61 0 以下不能将一行 不超过80个字符带有空格的字符串正确读入的语句或语句组是 解析 xff1a 字符串的输入不能用 span class token function scanf span
  • Ubuntu解决无线被禁用的方法

    查看当前wifi开关的状态 xff0c 有可能是软件block xff0c 也有可能是硬件block 终端输入命令 xff1a rfkill list all 返回电脑目前安装的所有网卡驱动 xff1a 0 ideapad wlan Wir
  • UITabBarController with hidden UITabBar

    None of these solutions I 39 ve been able to find here or elsewhere to hide a UITabBar as part of a UITabBarController w
  • debian9.12的硬盘安装过程一

    下载debian旧版网址 首先 xff0c 找旧版就是一路搜 xff0c 官网只有10 3 xff0c 所以把搜的结果给大家看看 xff0c 减少小白搜索的时间 http cdimage debian org cdimage archive

随机推荐