Unable to install vllm and flash-attn - Technical Help - DeepTalk - Deep Learning Community

Unable to install vllm and flash-attn

post by buptxiaofeng on Feb 19, 2025

I am trying to install flash-attn and vllm, and got the following message. So I install CUDA from scratch and set CUDA_HOME accordingly with the following commands:

export CUDA_HOME=/usr/local/cuda

export PATH=$CUDA_HOME/bin:$PATH

export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH

But the still the same error. Any ideas on this?

fatal: not a git repository (or any of the parent directories): .git
/tmp/pip-install-ypuzmh5m/flash-attn_118d4bac4f6c49b19894f5fa57835b99/setup.py:78: UserWarning: flash_attn 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.

warnings.warn(

Traceback (most recent call last):
  File "", line 2, in
  File "", line 34, in
  File "/tmp/pip-install-ypuzmh5m/flash-attn_118d4bac4f6c49b19894f5fa57835b99/setup.py", line 133, in
  CUDAExtension(
  File "/home/ubuntu/R1-V/py311_env/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1130, in CUDAExtension
  library_dirs += library_paths(device_type="cuda")
  File "/home/ubuntu/R1-V/py311_env/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1264, in library_paths
  if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/home/ubuntu/R1-V/py311_env/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2525, in _join_cuda_home
  raise OSError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
  torch.__version__  = 2.6.0+cpu