Idein / qmkl6

BLAS library for VideoCore VI QPU (Raspberry Pi 4)
BSD 3-Clause "New" or "Revised" License
67 stars 7 forks source link

/lib/aarch64-linux-gnu/libqmkl6.so: undefined symbol: drm_v3d_submit_csd #20

Open Hamidreza-Ramezani opened 2 years ago

Hamidreza-Ramezani commented 2 years ago

Hello,

I'm trying to use qmkl6 as numpy backend. I already installed py-videocore6 and libdrm_v3d.

After successfully installing numpy against qmkl6, when I'm importing numpy, I keep getting this error:

/lib/aarch64-linux-gnu/libqmkl6.so: undefined symbol: drm_v3d_submit_csd

Do you possibly have any idea how to fix this?

Terminus-IMRC commented 2 years ago

What if -ldrm_v3d is added when linking your program?

Hamidreza-Ramezani commented 2 years ago

Thanks for the reply. That worked. But I got another error:

undefined symbol: cblas_zgemm

I guess that is because qmkl6 doesn't have all cblas functions. Am I right? Do you know any workaround?

Terminus-IMRC commented 2 years ago

The only workaround is to implement the missing calls, which really is a hard work... c.f. single-precision gemm: src/sgemm_rnn.py. Or, I just came up with the idea to call other BLAS's (e.g. OpenBLAS) function if it is missing from QMKL6.

Hamidreza-Ramezani commented 2 years ago

Hello again,

Thanks for the reply.

Or, I just came up with the idea to call other BLAS's (e.g. OpenBLAS) function if it is missing from QMKL6.

Do you possibly know what is the easiest way to do this? I mean, how to tell numpy to use QMKL in some cases and use OpenBlas in some other.

Terminus-IMRC commented 2 years ago

A lookup table-based approach with dlsym seems feasible.