|
【技术讨论】
RK3588开发板 openCV调用openCL运行时失败,Status -11: CL_BUILD_PROGRAM_FAILURE...
发表于 2022-9-26 11:03:32
浏览:5488
|
回复:7
打印
只看该作者
[复制链接]
楼主
问题描述及复现步骤:
本帖最后由 Williamboy 于 2022-9-26 11:06 编辑
RK3588S 开发板,Ubuntu 20.04.5 LTS, 系统信息
- <div>$ cat /proc/version
- </div><div>Linux version 5.10.66 (daijh@8d391e97ab54) (kernel commit id: fa94ece7080f) (sdk version: rk3588_linux_release_20220812_v1.0.1b) (aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621, GNU ld (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 2.36.1.20210621) #155 SMP Fri Aug 12 10:03:43 CST 2022</div>
复制代码 OpenCV4.6
OpenCL 安装/设备/驱动正常OpenCL2.1
- <div>$clinfo
- Number of platforms 1
- Platform Name ARM Platform
- Platform Vendor ARM
- Platform Version OpenCL 2.1 v1.g6p0-01eac0.efb75e2978d783a80fe78be1bfb0efc1
- Platform Profile FULL_PROFILE
- Platform Extensions ...</div><div>.......</div>
复制代码
OpenCV调用OpenCL C++测试代码如下:
- void calcEdgesGPU()
- {
- std::cout << "****** Use GPU imag processing ******" << std::endl;
- cv::ocl::setUseOpenCL(true);
-
- bool ret1 = cv::ocl::haveOpenCL();
- bool ret2 = cv::ocl::useOpenCL();
- std::cout << "haveOpenCL:" << ret1 << std::endl;
- std::cout << "useOpenCL:" << ret2 << std::endl;
-
- double start = cv::getTickCount();
- cv::UMat gpuFrame, gpuGray, gpuBlur, gpuEdges;
- cv::Mat cpuFrame = cv::imread(IMAGE_PATHNAME);
- cpuFrame.copyTo(gpuFrame); //Mat与UMat相互转换
-
- cvtColor(gpuFrame, gpuGray, cv::COLOR_BGR2GRAY);
- cv::GaussianBlur(gpuGray, gpuBlur, cv::Size(3, 3), 15, 15);
- cv::Canny(gpuBlur, gpuEdges, 50, 100, 3);
- std::vector<cv::Vec3f> cir;
- cv::HoughCircles(gpuBlur, cir, cv::HOUGH_GRADIENT_ALT, 1.5, 15, 300, 0.8, 1, 100);
-
- std::cout << "GPU cost time:(s)" << ((cv::getTickCount() - start) / cv::getTickFrequency()) << std::endl;
-
- cv::Mat matResult = gpuEdges.getMat(cv::ACCESS_READ); //Mat与UMat相互转换
- cv::namedWindow("Canny Edges GPU1", cv::WINDOW_NORMAL);
- cv::imshow("Canny Edges GPU1", matResult);
-
- cv::namedWindow("Canny Edges GPU2", cv::WINDOW_NORMAL);
- cv::imshow("Canny Edges GPU2", gpuEdges);
- }
复制代码
编译正常,运行报错:
Status -11: CL_BUILD_PROGRAM_FAILURE
- ****** Use GPU imag processing ******
- haveOpenCL:1
- useOpenCL:1
- OpenCL program build log: imgproc/color_rgb
- <u>Status -11: CL_BUILD_PROGRAM_FAILURE</u>
- -D depth=0 -D scn=3 -D PIX_PER_WI_Y=1 -D dcn=1 -D bidx=0 -D STRIPE_SIZE=1
- <built-in>:167:9: error: expected member name or ';' after declaration specifiers
- int32_t depth; /**< The image depth. */
- ~~~~~~~ ^
- <built-in>:1:15: note: expanded from here
- #define depth 0
- ^
- <built-in>:167:8: error: expected ';' at end of declaration list
- int32_t depth; /**< The image depth. */
- ^
- error: Compiler frontend failed (error code 62)
- GPU cost time:(s)0.350019
复制代码
请问RK3588的GPU支持OPENCL吗?有人有同样的问题吗?
求救!
求救!!
求救!!!
SOS!
SOS!!
SOS!!!
|
|