mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
750 stars 131 forks source link

Segmentation requires libcurand and libcufft #633

Closed tarrinw closed 3 months ago

tarrinw commented 3 months ago

Using kraken 4.3.13 segmentation now fails due to dependencies on two nvidia libraries: libcurand and libcufft

Previously all operations could run without gpu and gpu libraries.

Traceback (most recent call last): File "/usr/local/lib64/python3.9/site-packages/torch/init.py", line 168, in _load_global_deps ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) File "/usr/lib64/python3.9/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: libcurand.so.10: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/kraken", line 5, in from kraken.kraken import cli File "/usr/local/lib/python3.9/site-packages/kraken/kraken.py", line 35, in from kraken.lib.progress import KrakenProgressBar, KrakenDownloadProgressBar File "/usr/local/lib/python3.9/site-packages/kraken/lib/progress.py", line 22, in import pytorch_lightning as pl File "/usr/local/lib/python3.9/site-packages/pytorch_lightning/init.py", line 25, in from lightning_fabric.utilities.seed import seed_everything # noqa: E402 File "/usr/local/lib/python3.9/site-packages/lightning_fabric/init.py", line 29, in from lightning_fabric.fabric import Fabric # noqa: E402 File "/usr/local/lib/python3.9/site-packages/lightning_fabric/fabric.py", line 21, in import torch File "/usr/local/lib64/python3.9/site-packages/torch/init.py", line 228, in _load_global_deps() File "/usr/local/lib64/python3.9/site-packages/torch/init.py", line 190, in _load_global_deps ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) File "/usr/lib64/python3.9/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: libcufft.so.10: cannot open shared object file: No such file or directory

tarrinw commented 3 months ago

Something was wrong with the nvidia libraries. Solution: upgrade / force reinstall of these libraries:

pip install nvidia-cufft-cu12 -U
pip install nvidia-cusparse-cu11 -U
pip install nvidia-cusparse-cu12 -U