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

[Bug] Unable to install MMCV 2.1.0 The detected CUDA version (11.8) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions. #3104

Open
2 tasks done
Fernando961226 opened this issue May 16, 2024 · 4 comments

Comments

@Fernando961226
Copy link

Prerequisite

Environment

  • pip install torch torchvision torchaudio
  • python -c 'import torch;print(torch.version)'
    2.3.0+cu121
  • nvidia-smi
    Thu May 16 13:52:34 2024
    +---------------------------------------------------------------------------------------+
    | NVIDIA-SMI 535.161.08 Driver Version: 535.161.08 CUDA Version: 12.2 |
    |-----------------------------------------+----------------------+----------------------+

Reproduces the problem - code sample

N/A

Reproduces the problem - command or script

min install mmcv=2.1.0

Reproduces the problem - error message

Looking in links: https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html
Collecting mmcv==2.1.0
Using cached mmcv-2.1.0.tar.gz (471 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: addict in /home/fernando/anaconda3/envs/sea-ice-fm/lib/python3.11/site-packages (from mmcv==2.1.0) (2.4.0)
Collecting mmengine>=0.3.0 (from mmcv==2.1.0)
Using cached mmengine-0.10.4-py3-none-any.whl.metadata (20 kB)
File "/home/fernando/anaconda3/envs/sea-ice-fm/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 522, in build_extensions .....

    File "/home/fernando/anaconda3/envs/sea-ice-fm/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 522, in build_extensions
      _check_cuda_version(compiler_name, compiler_version)
    File "/home/fernando/anaconda3/envs/sea-ice-fm/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 417, in _check_cuda_version
      raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
  RuntimeError:
  The detected CUDA version (11.8) mismatches the version that was used to compile
  PyTorch (12.1). Please make sure to use the same CUDA versions.

Additional information

No response

@zhouzaida
Copy link
Collaborator

Hi, support for torch2.3.0 has only been available since mmcv2.2.0, you can install mmcv2.2.0 to avoid source compilation problems!

@fengduduaaa
Copy link

Hi, support for torch2.3.0 has only been available since mmcv2.2.0, you can install mmcv2.2.0 to avoid source compilation problems!

new bugs:"mmcv==2.2.0 is used but incompatible. Please install mmcv-full>=[2, 0, 0], <[2, 1, 0]."

@smallrookie
Copy link

Hi, support for torch2.3.0 has only been available since mmcv2.2.0, you can install mmcv2.2.0 to avoid source compilation problems!

new bugs:"mmcv==2.2.0 is used but incompatible. Please install mmcv-full>=[2, 0, 0], <[2, 1, 0]."

I had the same problem

@gg22mm
Copy link

gg22mm commented Oct 18, 2024

pip install torch==2.1.2

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

5 participants