Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

FFTW from MKL seems to conflict with icv from opencv 4.1.2

$
0
0

Hi All,

It seems there is a conflict between icv and MKL. 

It is very stracge to see MKL calling icv_l9_commit function from opencv

Steps to reproduce

Operating system ubuntu 18.04 (same on ubuntu 16.04)
Libraries 
 opencv 4.1.2 (on cmake configuration it recognised presence of MKL)
 MKL 2019.3  (2018.0 works, 2018.2 and up give segfault)
Compiler gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Source code
---------

#include <fftw3.h>

#include <iostream>

#include <opencv2/core/core.hpp>

int main(int argc, char** argv)
{
    int m_iWidth = 64;
    int m_iHeight = 64;
    int iDirection = -1;
    float fMotionValue = 0.5;

    cv::Mat  m_tmpMat;

std::cerr << "---------- try alloc1\n";
    auto m_ptInputData = fftw_alloc_complex(m_iWidth * m_iHeight);
std::cerr << "---------- try alloc2\n";
    auto m_ptOutputData = fftw_alloc_complex(m_iWidth * m_iHeight);

    // Construct the FFT plan.
std::cerr << "---------- try to plan\n";

    auto tFFTPlan = fftw_plan_dft_2d(m_iWidth, m_iHeight, m_ptInputData, m_ptOutputData, iDirection, FFTW_ESTIMATE);
std::cerr << "---------- plan ok\n";

    return 0;
}

----

Build command line

/usr/bin/c++ fftw_test3.cpp -L/opt/intel/mkl/lib/intel64 /buf/libs/opencv-4.1.2/lib/libopencv_core.so.4.1.2 -lmkl_intel_lp64 -lmkl_core  -lmkl_intel_thread  /opt/intel/compilers_and_libraries/linux/lib/intel64_lin/libiomp5.so -Wl,-rpath,/buf/libs/opencv-4.1.2/lib:/opt/intel/mkl/lib/intel64:/opt/intel/compilers_and_libraries/linux/lib/intel64_lin

Output
$ ./a.out 
---------- try alloc1
---------- try alloc2
---------- try to plan
Segmentation fault (core dumped)

GDB run

(gdb) run
Starting program: /buf/test/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
---------- try alloc1
---------- try alloc2
---------- try to plan

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff704f70f in icv_l9_commit () from /buf/libs/opencv-4.1.2/lib/libopencv_core.so.4.1
(gdb) bt
#0  0x00007ffff704f70f in icv_l9_commit () from /buf/libs/opencv-4.1.2/lib/libopencv_core.so.4.1
#1  0x00007fffeb689f1f in static_dfti_commit () from /opt/intel/mkl/lib/intel64/libmkl_avx2.so
#2  0x00007fffeb151cab in commit () from /opt/intel/mkl/lib/intel64/libmkl_avx2.so
#3  0x00007fffeb689f1f in static_dfti_commit () from /opt/intel/mkl/lib/intel64/libmkl_avx2.so
#4  0x00007ffff63f4cd0 in DftiCommitDescriptor () from /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so
#5  0x00007ffff63fc651 in fftw_plan_guru64_dft () from /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so
#6  0x00007ffff63fb945 in fftw_plan_dft () from /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so
#7  0x00007ffff63fb996 in fftw_plan_dft_2d () from /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.so
#8  0x0000555555554de1 in main ()

 

Viewing all articles
Browse latest Browse all 2652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>