Arrayfire/openCV 4.2 Problem

36 views
Skip to first unread message

matthieu debailleul

unread,
Apr 25, 2022, 8:45:30 AM4/25/22
to ArrayFire Users
Hello,
i'm using Arrayfire 3.8 and everything is fine with arrayfire alone, but I get an error when i try to use openCV 4.2 :

af::setDevice(device);
af::info();    
cv::Mat img=cv::imread("/home/mat/i017.bmp",CV_8UC1);
//<- this line causes the error

Arrayfire give me the following error :

 ArrayFire Exception (Unknown error:999):

In function setDevice
In file src/api/cpp/device.cpp:77

Am i missing something ?

Umar Arshad

unread,
May 12, 2022, 1:58:45 PM5/12/22
to ArrayFire Users
Hey Matthieu,

I don't have enough information here to debug this issue. You could get more information regarding the
error details by setting the AF_PRINT_ERRORS=1 environment variable. I suspect there is an issue
with the standard c++ library incompatibilities of the two projects. How did you install the two libraries?
Which system are you running this on?

You could LD_PRELOAD the system libstdc++ and see if that fixes the issue. If not then I would need
more information about how you installed the libraries and the OS you are running this on.

Umar

Matthieu Debailleul

unread,
May 16, 2022, 9:22:14 AM5/16/22
to Umar Arshad, ArrayFire Users
Hi Umar,
thank you for this answer :)
Actualy l solved the problem with a workaround. At first, I manually installed arrayfire 3.8.1  and linked to the libraries/includes files (typically in /opt/arrayfire/ on Linux).
For an unknown reason, this causes a crash with openCV.
After some testing, i noticed that OpenCL backend (from ubuntu repositories) was ok, but this repo had no Cuda backend. So i installed arrayfire from the regular PPA (repo.arrayfire.com, with Cuda 10.2), and everything is fine  now.

Anyway, thanks again for your time :)

Matthieu

De: "Umar Arshad" <um...@arrayfire.com>
À: "ArrayFire Users" <arrayfi...@googlegroups.com>
Envoyé: Jeudi 12 Mai 2022 19:58:45
Objet: Re: Arrayfire/openCV 4.2 Problem

--
You received this message because you are subscribed to a topic in the Google Groups "ArrayFire Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/arrayfire-users/4C98jbQo2RU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to arrayfire-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/21f66f9c-572e-4e89-9d86-5e6888eee9f5n%40googlegroups.com.

--
logo de l'UHA
Debailleul Matthieu
Laboratoire MIPS,
IUT Mulhouse
Université de Haute-Alsace
61 rue A. Camus - 68093 Mulhouse Cedex

Téléphone : +33 (0)3.89.33.76.66 
Télécopie : +33 (0)3.89.33.76.05.



Reply all
Reply to author
Forward
0 new messages