mamba icon indicating copy to clipboard operation
mamba copied to clipboard

ImportError: libcudart.so.12: cannot open shared object file: No such file or directory

Open AsifAhamed3720 opened this issue 10 months ago • 2 comments

Hi iam using ubuntu 20.04 WSL, python 3.10.6 and torch 2.0.1+cu118 causal_conv1d 1.2.0 and i get the following error when just trying to import mamba_ssm.

(umamba) bounty@LAPTOP-TISOQDL3:/mnt/c/UNM/Year 3/FYP/Umambaliver/U-Mamba/umamba$ python
Python 3.10.16 (main, Dec 11 2024, 16:24:50) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import mamba_ssm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bounty/miniconda3/envs/umamba/lib/python3.10/site-packages/mamba_ssm/__init__.py", line 3, in <module>
    from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn
  File "/home/bounty/miniconda3/envs/umamba/lib/python3.10/site-packages/mamba_ssm/ops/selective_scan_interface.py", line 18, in <module>
    import selective_scan_cuda
ImportError: libcudart.so.12: cannot open shared object file: No such file or directory
>>> exit()
(umamba) bounty@LAPTOP-TISOQDL3:/mnt/c/UNM/Year 3/FYP/Umambaliver/U-Mamba/umamba$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
(umamba) bounty@LAPTOP-TISOQDL3:/mnt/c/UNM/Year 3/FYP/Umambaliver/U-Mamba/umamba$

What is the problem exactly? Does it require CUDA 12x? I have the 11.8 installed because its a requisite for https://github.com/bowang-lab/U-Mamba?tab=readme-ov-file#installation. Any insight would be appreciated. Thanks!

AsifAhamed3720 avatar Mar 12 '25 20:03 AsifAhamed3720

I encountered the same problem with Python 3.11.11, torch==2.5.0+cu118 and causal-conv1d==1.5.0.post8. I solved the problem by downloading the needed .whl file from the release page. Then you can install it with pip install xxxx.whl. The file I use is mamba_ssm-2.2.4+cu11torch2.5cxx11abiFALSE-cp311-cp311-linux_x86_64.whl, you should use the one match your environment.

exhyy avatar Mar 14 '25 04:03 exhyy

I encountered the same problem with Python 3.11.11, torch==2.5.0+cu118 and causal-conv1d==1.5.0.post8. I solved the problem by downloading the needed .whl file from the release page. Then you can install it with pip install xxxx.whl. The file I use is mamba_ssm-2.2.4+cu11torch2.5cxx11abiFALSE-cp311-cp311-linux_x86_64.whl, you should use the one match your environment.

I followed your instruction by downloading .whl file, but I encountered another problem: "ImportError: /home/msdl/anaconda3/envs/mamba2/lib/python3.10/site-packages/selective_scan_cuda.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN3c107WarningC1ESt7variantIJNS0_11UserWarningENS0_18DeprecationWarningEEERKNS_14SourceLocationENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb " do you know any solution for this ? thanks a lot

poult-lab avatar Apr 16 '25 04:04 poult-lab