mamba icon indicating copy to clipboard operation
mamba copied to clipboard

mamba-ssm complaining nvcc not found while cuda is installed

Open chengmarc opened this issue 11 months ago • 13 comments

Main Complaint

C:\Users\marcc\AppData\Local\Temp\pip-build-env-3vuoamb7\overlay\Lib\site-packages\torch\_subclasses\functional_tensor.py:295:  
UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_numpy.cpp:84.)
        cpu = _conversion_method_template(device=torch.device("cpu"))

<string>:118: UserWarning: mamba_ssm was requested, but nvcc was not found.  Are you sure your environment has nvcc available?  If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc. 

note: I am in a conda environment with the following:

python - v3.10.11 cuda - v11.8 torch - v2.5.1

I have causal-conv1d==1.4.0, NumPy is installed, too.

More Info

 Traceback (most recent call last):
        File "C:\Users\marcc\miniconda3\envs\default\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\marcc\miniconda3\envs\default\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\marcc\miniconda3\envs\default\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\marcc\AppData\Local\Temp\pip-build-env-7smda003\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "C:\Users\marcc\AppData\Local\Temp\pip-build-env-7smda003\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "C:\Users\marcc\AppData\Local\Temp\pip-build-env-7smda003\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 188, in <module>
      NameError: name 'bare_metal_version' is not defined
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

chengmarc avatar Jan 12 '25 21:01 chengmarc

Is nvcc installed?

tridao avatar Jan 13 '25 02:01 tridao

C:\Users\marcc>nvcc --version

gives

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0

chengmarc avatar Jan 13 '25 03:01 chengmarc

Likely setup.py can't find the right path to nvcc. We rely on CUDA_HOME from torch.utils.cpp_extension What does from torch.utils.cpp_extension import CUDA_HOME give?

tridao avatar Jan 15 '25 06:01 tridao

>>> from torch.utils.cpp_extension import CUDA_HOME and CUDA_HOME gives: C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.1

chengmarc avatar Jan 15 '25 21:01 chengmarc

Hello,have you solved your problem?I met it too.

jq-Qin avatar Jan 26 '25 09:01 jq-Qin

this problem hasn't been solved

Hello,have you solved your problem?I met it too.

chengmarc avatar Jan 27 '25 20:01 chengmarc

same problem

So-cean avatar May 26 '25 14:05 So-cean

Anyone solved this issue yet?

bishnukhadka avatar May 27 '25 06:05 bishnukhadka

Same problem on windows, using venv. CUDA_HOME returns the expected path.

matkara avatar May 28 '25 22:05 matkara

I ran into the same error.

As I understand it, the builder couldn't find the right toolы in an isolated environment, so I just added the --no-build-isolation flag and it helped!

So, try to install it with python -m pip install mamba-ssm --no-build-isolation

setday avatar Jun 04 '25 20:06 setday

I ran into the same error.

As I understand it, the builder couldn't find the right toolы in an isolated environment, so I just added the flag and it helped!--no-build-isolation

So, try to install it with python -m pip install mamba-ssm --no-build-isolation

don't work(╥﹏╥)

zhoujy1321 avatar Jun 13 '25 04:06 zhoujy1321

I ran into the same error.

As I understand it, the builder couldn't find the right toolы in an isolated environment, so I just added the --no-build-isolation flag and it helped!

So, try to install it with python -m pip install mamba-ssm --no-build-isolation

For me I used the Windows Subsystem for Linux (WSL) and used the --no-build-isolation. It did install properly. If you are using a Windows system, then consider using WSL.

However, I am not able to use either Mamba1 or Mamba2.

bishnukhadka avatar Jun 22 '25 06:06 bishnukhadka

On AWS Sagemaker jupyter lab I had to run conda install -c nvidia cuda-nvcc to install the compatible nvcc compiler with the cuda version I was using, the default image didn't have the right one.

alarv avatar Aug 26 '25 12:08 alarv