当前位置:网站首页>Compiling opencv4.5.5 with CUDA (4.2.0+cuda11.1+cudnn8.0.5 failed)
Compiling opencv4.5.5 with CUDA (4.2.0+cuda11.1+cudnn8.0.5 failed)
2022-06-09 07:33:00 【Ferry companion】

I haven't won a prize for living so big , Never hit more than 20 A $lottery , I won a prize in this place , Very sharp !!
Finally change to 4.5.5 The version succeeded :
cmake The content of :
cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_C_COMPILER=/usr/bin/gcc \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ \
-D CUDA_CUDA_LIBRARY=/usr/lib/x86_64-linux-gnu/libcuda.so \
-D CUDA_ARCH_BIN=7.5 \
-D CUDA_ARCH_PTX="" \
-D WITH_CUDA=ON \
-D WITH_TBB=ON \
-D WITH_FFMPEG=ON \
-D BUILD_PYTHON_SUPPORT=ON \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D BUILD_OPENCV_PYTHON3=ON \
-D PYTHON_INCLUDE_DIR=(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON_PACKAGES_PATH=(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D WITH_V4L=ON \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D WITH_QT=ON \
-D WITH_GSTREAMER=ON \
-D WITH_OPENGL=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
-D CMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
-D WITH_CUBLAS=ON \
-D WITH_NVCUVID=ON \
-D BUILD_opencv_cudacodec=ON \
-D OPENCV_DNN_CUDA=ON \
-D WITH_CUDNN=ON \
-D OPENCV_ENABLE_NONFREE=ON\
-D WITH_GSTREAMER=ON \
-D BUILD_EXAMPLES=ON ..
brothers , The benefits have been paid , Trampling on numerous pits .cache file :
link : https://pan.baidu.com/s/1Eq2U6WD3AL6lAaHLMqed9w Extraction code : 6avj
– From Baidu network disk super member v5 The share of
Permanent validity !
Cry , In memory of my dead brain cells !
Test whether the compilation is correct :
Code :
#include <iostream>
#include<opencv2/opencv.hpp>
int main(int argc, char* argv[])
{
cv::cuda::GpuMat img(400, 600, CV_8UC3, cv::Scalar(255, 0, 0));
cv::Mat cpuImg;
img.download(cpuImg);
cv::imshow("test", cpuImg);
cv::waitKey(0);
return 0;
}
I don't trust you, but I made a match again 
after work , after work !!
When I left yesterday g++ Compile successfully , however vscode Call failed , Mainly cv::cuda:cvtColor function , Today is OK 
stay task.json Medium plus lib library , current task.json Long like this
{
"tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "g++",
"args": [
"-g",
"-std=c++11",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.out",
"`pkg-config", "--cflags", "--libs", "opencv`", "-I", "/usr/local/include/opencv4", "-I", "/usr/local/include/opencv4/opencv2", "-I", "/usr/local/include", "-L", "/usr/local/lib", "-l", "opencv_core", "-l", "opencv_imgproc", "-l", "opencv_imgcodecs", "-l", "opencv_video", "-l", "opencv_ml", "-l", "opencv_highgui", "-l", "opencv_objdetect", "-l", "opencv_flann", "-l", "opencv_imgcodecs", "-l", "opencv_photo", "-l", "opencv_videoio" ], "options": { "cwd": "/usr/bin" }, "group": { "kind": "build", "isDefault": true } } ], "version": "2.0.0"
}
Reference link :
True knowledge comes from practice ——Ubuntu 18.04 VSCODE To configure OpenCV4.5 function YOLO4 Model
边栏推荐
- 100 code structure and how to avoid them (4)
- Common interview questions: Browser input domain name and open the completed process
- [NewOJ Week 1]---CDE
- JS regular expression matching span tag
- 2022 hydrogenation process question bank and simulation test
- 2022 Chinese cook (elementary) examination question bank and online simulation examination
- Which software design documents are most easily ignored?
- UML summary
- PostgreSQL database replication - background first-class citizen process walreceiver extracts information
- [path of system analyst] Chapter 18 security analysis and design of double disk system (encryption and decryption)
猜你喜欢

Thread scheduling and thread priority

MySQL: single table query

2022年全国最新消防设施操作员(中级消防设施操作员)考试模拟题库及答案

ftp服务

Use postman to simulate a request to carry a token

Oracle: Foundation

Squid代理服务器应用

Distributed message middleware -- Introduction to message queue

Peripheral driver library development notes 42:dac8552 DAC driver

政务大厅导航系统功能解读
随机推荐
浅谈数据库优化(以mysql为例)
多线程重点知识归纳总结。
Push related summary
容器部署和无服务器部署那些事儿
Google browser F12 (developer tool) -- function introduction
How to solve security problems in low code platforms?
JS regular expression matching span tag
Code of conduct for industrial control safety
pushmall推贴共享电商2022年5月份计划更新完成
2022 national latest Fire Facility operator (Intermediate Fire Facility operator) test Simulated question base and Answers
A collection of common test terms
2022年7月2日下午,济南IT技术聚会,感兴趣的朋友扫码报名并入群交流
Robot_ Framework: Keywords
Epoll series system call
2022 examination questions and mock examination for the third batch of Guangdong Provincial Safety Officer C certificate (full-time safety production management personnel)
政务大厅导航系统功能解读
Realization of C 2~36 hexadecimal number conversion
Boot Black apple with OpenCORE
朴素贝叶斯分类器
Error (119013): current license file does not support the ep4ce10f17c8 device solution