cuda环境下安装opencv出现nvcc warning : The 'compute_11'

本文介绍了解决在使用OpenCV编译过程中遇到的CUDA架构过时警告的方法,包括修改OpencvConfig.cmake文件和在CMakeLists.txt中调整CUDA相关配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

警告打印:

nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release.

找到cmake后产生的OpencvConfig.cmake文件,找到如下代码:

# Version Compute Capability from which OpenCV has been compiled is remembered
set(OpenCV_COMPUTE_CAPABILITIES -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30)

"-gencode ;arch=compute_11,code=sm_11";-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13; 等删除。

主要因为此架构在CUDA过时~~将来也将不支持


以上若无果:

在cmakelist中关闭cuda~~

或者在cmake时加上参数-D BUILD_opencv_gpu=OFF


-- Try 1 failed CMake Warning at cmake/OpenCVDownload.cmake:248 (message): IPPICV: Download failed: 28;"Timeout was reached" For details please refer to the download log file: /home/charon/Opencv/opencv-4.8.0/build/CMakeDownloadLog.txt Call Stack (most recent call first): 3rdparty/ippicv/ippicv.cmake:37 (ocv_download) cmake/OpenCVFindIPP.cmake:259 (download_ippicv) cmake/OpenCVFindLibsPerf.cmake:12 (include) CMakeLists.txt:756 (include) -- Could NOT find CUDNN: Found unsuitable version "..", but required is at least "7.5" (found /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0) -- CUDA detected: 12.5 -- CUDA: Using CUDA_ARCH_BIN=8.9 -- CUDA NVCC target flags: -gencode;arch=compute_89,code=sm_89;-D_FORCE_INLINES -- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off -- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off -- Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR) -- Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found version "11.0.26") -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) -- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file CMake Error at cmake/OpenCVModule.cmake:274 (message): No modules has been found: /home/ub/opencv-4.8.0/opencv_contrib_4.8.0/modules Call Stack (most recent call first): cmake/OpenCVModule.cmake:356 (_glob_locations) cmake/OpenCVModule.cmake:408 (ocv_glob_modules) CMakeLists.txt:967 (ocv_register_modules) -- Checking for module 'gtk+-2.0' -- No package 'gtk+-2.0' found -- Checking for module 'libavresample' -- No package 'libavresample' found CMake Error at modules/core/CMakeLists.txt:54 (message): CUDA: OpenCV requires enabled 'cudev' module from 'opencv_contrib' repository: https://github.com/opencv/opencv_contrib -- Configuring incomplete, errors occurred! See also "/home/charon/Opencv/opencv-4.8
最新发布
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值