Closed YijinLiu closed 3 years ago
This seems to be a OpenCV issue. Here is a mini program to repro it:
#include <iostream> #include <edgetpu.h> #include <iw++/iw.hpp> int main() { try { ipp::IwiSize size(1920, 1080); ipp::IwiImage image(size, ipp8u, 3); auto status = ipp::iwiSet(128, image); if (status != ippStsNoErr) { std::cout << "Failed to set image!\n"; return 2; } } catch (...) { } auto* edgetpu_mgr = edgetpu::EdgeTpuManager::GetSingleton(); auto edgetpu_ctx = edgetpu_mgr->OpenDevice(edgetpu::DeviceType::kApexPci); if (!edgetpu_ctx) { std::cout << "Failed to open edgetpu!\n"; return 4; } return 0; }
The binary compiled using this command (link with standalone IPP) is fine:
g++ -o verify_edgetpu_with_ipp verify_edgetpu_with_ipp.cc -ledgetpu -I/opt/intel/oneapi/ipp/2021.1.1/include \ -L/opt/intel/oneapi/ipp/2021.1.1/lib/intel64 \ -Wl,-Bstatic -lipp_iw -lippcv -lippi -lipps -lippvm -lippcore -Wl,-Bdynamic
The binary compiled with this command (linked with OpenCV 3.4.3 IPP) is problematic:
g++ -o verify_edgetpu_with_ipp verify_edgetpu_with_ipp.cc -ledgetpu \ -I/opt/intel/oneapi/ipp/2021.1.1/include \ -Wl,-Bstatic -lippiw -lippicv -Wl,-Bdynamic
Anyway, I am still interested in seeing whether edgetpu team has any thoughts on this? This might help OpenCV guys to figure out what's wrong..
In case it might be useful for others: after upgraded the kernel to 5.11.10, it's working well now.
I am testing a m2 edgetpu under ubuntu 18.04. To make it accessible to a non root user. I did this:
Everything works great until I link the binary to OpenCV with Intel IPP. It fails at kernel_registers.cc:101 strace shows
dmesg shows
The same binary (linked with IPP) works if run with root. It looks like IPP does sth. that changes the behavior of this mmap system call. Is it possible that the apex driver tries to use memory claimed by IPP?