sova-asr icon indicating copy to clipboard operation
sova-asr copied to clipboard

Service fails to run on MacBook with M1 (only CPU inference)

Open cryoff opened this issue 2 years ago • 1 comments

I have modified the Dockerfile to be able to build the docker image on M1 (I can also create PR for that). Namely, I added these two steps to build h5py and have no problems with xlocale.h

RUN apt-get install -y pkg-config libhdf5-100 libhdf5-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h

I am looking into using the container only for inference, but the service can't start:

sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/base.py", line 144, in load_wsgi
sova-asr  |     self.wsgi = self.app.wsgi()
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/base.py", line 67, in wsgi
sova-asr  |     self.callable = self.load()
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 49, in load
sova-asr  |     return self.load_wsgiapp()
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
sova-asr  |     return util.import_app(self.app_uri)
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/gunicorn/util.py", line 358, in import_app
sova-asr  |     mod = importlib.import_module(module)
sova-asr  |   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
sova-asr  |     return _bootstrap._gcd_import(name[level:], package, level)
sova-asr  |   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
sova-asr  |   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
sova-asr  |   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
sova-asr  |   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
sova-asr  |   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
sova-asr  |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
sova-asr  |   File "/sova-asr/app.py", line 2, in <module>
sova-asr  |     from file_handler import FileHandler
sova-asr  |   File "/sova-asr/file_handler.py", line 7, in <module>
sova-asr  |     from punctuator import Punctuator
sova-asr  |   File "/sova-asr/punctuator.py", line 4, in <module>
sova-asr  |     from bert_punctuator.bert import BertPunc, BertConfig
sova-asr  |   File "/sova-asr/bert_punctuator/bert.py", line 5, in <module>
sova-asr  |     from bert_punctuator.modules import Embedder, Linear
sova-asr  |   File "/sova-asr/bert_punctuator/modules.py", line 4, in <module>
sova-asr  |     from PuzzleLib.Backend import gpuarray, Blas
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/PuzzleLib/Backend/gpuarray.py", line 201, in <module>
sova-asr  |     autoinit()
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/PuzzleLib/Backend/gpuarray.py", line 40, in autoinit
sova-asr  |     initCuda()
sova-asr  |   File "/usr/local/lib/python3.6/dist-packages/PuzzleLib/Backend/gpuarray.py", line 50, in initCuda
sova-asr  |     from PuzzleLib.Cuda import Backend, Utils
sova-asr  | ModuleNotFoundError: No module named 'PuzzleLib.Cuda'
sova-asr  | [2022-02-21 14:05:12 +0000] [10] [INFO] Worker exiting (pid: 10)
sova-asr  | [2022-02-21 14:05:12 +0000] [1] [INFO] Shutting down: Master
sova-asr  | [2022-02-21 14:05:12 +0000] [1] [INFO] Reason: Worker failed to boot.

Important to mention, I am looking into using only CPU, so in Dockerfile:

FROM ubuntu:18.04
...
RUN pip3 install PuzzleLib

cryoff avatar Feb 21 '22 14:02 cryoff

hi! there are a few more changes, you can checkout cpu branch and modify Dockerfile

sxdxfan avatar Feb 21 '22 14:02 sxdxfan