Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JunboLu opened this issue Jan 17, 2025 · 2 comments

Comments

@JunboLu
Copy link

JunboLu commented Jan 17, 2025

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

@wxj6000
Copy link
Collaborator

wxj6000 commented Jan 18, 2025

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.

@cvsik
Copy link

cvsik commented Jan 23, 2025

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')).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants