gpu4pyscf icon indicating copy to clipboard operation
gpu4pyscf copied to clipboard

OSError: libcusolver.so: cannot open shared object file: No such file or directory

Open JunboLu opened this issue 10 months ago • 4 comments

Dear all, I am new user in using gpu4pyscf. I run a small test, but I get an error:

/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/gpu4pyscf/lib/cutensor.py:139: UserWarning: using cupy as the tensor contraction engine. warnings.warn(f'using {contract_engine} as the tensor contraction engine.') Traceback (most recent call last): File "/home/gengzi/WORK/Ln_EMBEDDING/PYSCF/input.py", line 379, in mf.to_gpu().run(dm) ^^^^^^^^^^^ File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/pyscf/df/df_jk.py", line 232, in to_gpu obj = self.undo_df().to_gpu().density_fit() ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/pyscf/lib/misc.py", line 1513, in to_gpu import gpu4pyscf File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/gpu4pyscf/init.py", line 17, in from . import lib, grad, hessian, solvent, scf, dft File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/gpu4pyscf/lib/init.py", line 18, in from gpu4pyscf.lib import cupy_helper File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/gpu4pyscf/lib/cupy_helper.py", line 25, in from gpu4pyscf.lib.cusolver import eigh, cholesky #NOQA ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/site-packages/gpu4pyscf/lib/cusolver.py", line 23, in libcusolver = ctypes.CDLL('libcusolver.so') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/gengzi/bin/deepmd-kit-3.0.0-cuda/lib/python3.12/ctypes/init.py", line 379, in init self._handle = _dlopen(self._name, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: libcusolver.so: cannot open shared object file: No such file or directory

I have installed cuda-12.6. How could I solve this problem? With my best regards, Junbo

JunboLu avatar Jan 17 '25 15:01 JunboLu

Can you check if the installed cuda-toolkit is added to LD_LIBRARY_PATH? GPU4PySCF is based on cupy. You can check if cuda-toolkit can be found through some simple cupy tests.

wxj6000 avatar Jan 18 '25 04:01 wxj6000

From my experience, this error can also happen if you're inside a Conda environment where cuda-toolkit provides only something like libcusolver.so.11 and not libcusolver.so (hard-coded in ctypes.CDLL('libcusolver.so')).

ghost avatar Jan 23 '25 07:01 ghost

Thank you very much! Yes, I use the Conda environment. How could I solve this problem?

On Thu, 23 Jan 2025 at 15:41, Maximilian Scheurer @.***> wrote:

From my experience, this error can also happen if you're inside a Conda environment where cuda-toolkit provides only something like libcusolver.so.11 and not libcusolver.so (hard-coded in ctypes.CDLL('libcusolver.so')).

— Reply to this email directly, view it on GitHub https://github.com/pyscf/gpu4pyscf/issues/308#issuecomment-2609065912, or unsubscribe https://github.com/notifications/unsubscribe-auth/AESCXEPPJDHYQRHXMKUK47T2MCMJ3AVCNFSM6AAAAABVME7PFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBZGA3DKOJRGI . You are receiving this because you authored the thread.Message ID: @.***>

JunboLu avatar Feb 06 '25 12:02 JunboLu

@JunboLu The issue has been fixed in v1.3.1.

wxj6000 avatar Feb 06 '25 17:02 wxj6000