alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.43k stars 1.04k forks source link

Trouble with OpenBLAS threading #1385

Closed johngebbie closed 1 year ago

johngebbie commented 1 year ago

Hello, I'm sorry to nag again.

I'm trying to package vosk for Alpine Linux. My test currently segfaults because Alpine's openblas package isn't compiled with USE_LOCKING=1 USE_THREAD=0. The test works if I set the environment variable OPENBLAS_NUM_THREADS=1 but I'm not sure how to do it properly from vosk/kaldi (which I can apply patches to) so it can be packaged.

I see openblas has an openblas_set_num_threads function. Do you know where I could add openblas_set_num_threads(1) to vosk/kaldi to make it work?

johngebbie commented 1 year ago

I've asked on kaldi-help: https://groups.google.com/g/kaldi-help/c/tcaxZiVZly8 Sorry asking here first, I thought messaging kaldi-help required a google account.

nshmyrev commented 1 year ago

Hey, sorry, I missed this one. You can add here:

https://github.com/alphacep/vosk-api/blob/master/src/model.cc#L117

there is already a statement for MKL

johngebbie commented 1 year ago

Oh that's great! I don't know how I missed that, apparently my greping isn't what it used to be. Thank you!