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

failed to build mmcv #3228

Open
2 tasks done
soltaninejad opened this issue Jan 10, 2025 · 0 comments
Open
2 tasks done

failed to build mmcv #3228

soltaninejad opened this issue Jan 10, 2025 · 0 comments

Comments

@soltaninejad
Copy link

Prerequisite

Environment

windows
python 3.9.21
pytorch 2.4.0 with cuda 11.8
visual studio 2022

Reproduces the problem - code sample

pip install mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.4/index.html
or
mim install mmcv

Reproduces the problem - command or script

pip install mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.4/index.html
or
mim install mmcv

Reproduces the problem - error message

[21/136] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -DMMCV_WITH_CUDA -IC:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\mmcv\ops\csrc\pytorch -IC:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\mmcv\ops\csrc\common -IC:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\mmcv\ops\csrc\common\cuda -ID:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\include -ID:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\include\torch\csrc\api\include -ID:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\include\TH -ID:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -ID:\Anaconda3\envs\mgldvsr2\include -ID:\Anaconda3\envs\mgldvsr2\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" -c C:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\mmcv\ops\csrc\pytorch\cpu\sparse_indice.cpp /FoC:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\build\temp.win-amd64-3.9\Release\mmcv/ops/csrc/pytorch/cpu\sparse_indice.obj /std:c++17 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\utils\cpp_extension.py", line 2105, in _run_ninja_build
subprocess.run(
File "D:\Anaconda3\envs\mgldvsr2\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '7']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\fahimeh\AppData\Local\Temp\pip-install-h8ze7wqh\mmcv_2aeda58ae5bb414d80002662c249798c\setup.py", line 460, in <module>
      setup(
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\__init__.py", line 155, in setup
      return distutils.core.setup(**attrs)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
      return run_commands(dist)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
      dist.run_commands()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
      self.run_command(cmd)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
      cmd_obj.run()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\wheel\_bdist_wheel.py", line 378, in run
      self.run_command("build")
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
      cmd_obj.run()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
      cmd_obj.run()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
      _build_ext.run(self)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 339, in run
      self.build_extensions()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\utils\cpp_extension.py", line 866, in build_extensions
      build_ext.build_extensions(self)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension
      _build_ext.build_extension(self, ext)
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 528, in build_extension
      objects = self.compiler.compile(sources,
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\utils\cpp_extension.py", line 838, in win_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\utils\cpp_extension.py", line 1785, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "D:\Anaconda3\envs\mgldvsr2\lib\site-packages\torch\utils\cpp_extension.py", line 2121, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mmcv
Running setup.py clean for mmcv
Failed to build mmcv
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mmcv)

Additional information

i tried to install mmcv on my system by different ways but i could not. it seems there is not a pre built package of mmcv for my system(torch 2.4.0 with cuda 11.8 on windows) so i tried to build it from source but i could not an got that error.

@soltaninejad soltaninejad changed the title [Bug] failed to build mmcv failed to build mmcv Jan 10, 2025
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

1 participant