question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

windows 10 install mmcv-full error

See original GitHub issue

following this tutorial https://mmcv.readthedocs.io/en/latest/build.html#option-3-build-mmcv-full-version-with-cuda

Option 3: Build MMCV (full version with CUDA)

already configured and tested cuda 10.2, pytorch 1.7.1, visual studio 2019

in the Anaconda PS show following error:

(env_3_7) PS C:\Users\leewi9\Downloads\mmcv> python setup.py build_ext
running build_ext
building 'mmcv._ext' extension
Emitting ninja build file C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\build.ninja...
Compiling objects...
Using envvar MAX_JOBS (30) as the number of workers...
1.10.1
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\leewi9\.conda\envs\env_3_7\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib/x64" /LIBPATH:C:\Users\leewi9\.conda\envs\env_3_7\libs /LIBPATH:C:\Users\leewi9\.conda\envs\env_3_7\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit__ext C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\bbox_overlaps.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\bbox_overlaps_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated_cpu.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\box_iou_rotated_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\carafe.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\carafe_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\carafe_naive.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\carafe_naive_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\cc_attention.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\cc_attention_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\corner_pool.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\deform_conv.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\deform_conv_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\deform_roi_pool.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\deform_roi_pool_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\focal_loss.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\focal_loss_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\info.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\masked_conv2d.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\masked_conv2d_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\modulated_deform_conv.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\modulated_deform_conv_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\nms.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\nms_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\nms_rotated.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\nms_rotated_cpu.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\nms_rotated_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\psamask.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\psamask_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\pybind.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\roi_align.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\roi_align_cpu.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\roi_align_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\roi_pool.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\roi_pool_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\sync_bn.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\sync_bn_cuda.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\tin_shift.obj C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\tin_shift_cuda.obj /OUT:build\lib.win-amd64-3.7\mmcv\_ext.cp37-win_amd64.pyd /IMPLIB:C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\./mmcv/ops/csrc/pytorch\_ext.cp37-win_amd64.lib
LINK : fatal error LNK1181: 无法打开输入文件“C:\Users\leewi9\Downloads\mmcv\build\temp.win-amd64-3.7\Release\.\mmcv\ops\csrc\pytorch\psamask_cuda.obj”
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\link.exe' failed with exit status 1181

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
roachsinaicommented, Jul 28, 2021

Yes, did found some errors:

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(27): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_im2col_bilinear<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(27): error: identifier "__floorf" is undefined in device code

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(28): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_im2col_bilinear<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(28): error: identifier "__floorf" is undefined in device code

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(78): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_col2im_bilinear<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(78): error: identifier "__floorf" is undefined in device code

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(79): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_col2im_bilinear<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(79): error: identifier "__floorf" is undefined in device code

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(145): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_col2im_bilinear_gm<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(145): error: identifier "__floorf" is undefined in device code

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(146): error: calling a __host__ function("__floorf") from a __device__ function("ms_deform_attn_col2im_bilinear_gm<float> ") is not allowed

E:/code/Git/mmcv/mmcv/ops/csrc\ms_deform_attn_cuda_kernel.cuh(146): error: identifier "__floorf" is undefined in device code

12 errors detected in the compilation of "E:/code/Git/mmcv/mmcv/ops/csrc/pytorch/ms_deform_attn_cuda.cu".

So, I should try what described in post https://www.zywvvd.com/2021/04/20/deep_learning/windows-mmcv-1-2-7-install/windows-mmcv-1-2-7-install/ ?

1reaction
roachsinaicommented, Jul 28, 2021

Thanks a lot for what you did!

The compilation does not start at all.

Maybe this is the reason. What leads to this problem is I changed code below:

def _run_ninja_build(build_directory: str, verbose: bool, error_prefix: str) -> None:
    command = ['ninja', '-v']
    num_workers = _get_num_workers(verbose)

to (check [‘ninja’, ‘-v’])

def _run_ninja_build(build_directory: str, verbose: bool, error_prefix: str) -> None:
    command = ['ninja', '--version']
    num_workers = _get_num_workers(verbose)

following https://www.zywvvd.com/2021/04/20/deep_learning/windows-mmcv-1-2-7-install/windows-mmcv-1-2-7-install/

And If I don’t change it I’ll get the following error:

定义为“已删除”
        with
        [
            T=c10::cuda::impl::CUDAGuardImpl
        ]
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\torch\utils\cpp_extension.py", line 1672, in _run_ninja_build
    env=env)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '8']' returned non-zero exit status 1.

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

Traceback (most recent call last):
  File "setup.py", line 343, in <module>
    zip_safe=False)
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
    _build_ext.run(self)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\torch\utils\cpp_extension.py", line 709, in build_extensions
    build_ext.build_extensions(self)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "c:\users\benbenbj\appdata\local\programs\python\python37\lib\distutils\command\build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\torch\utils\cpp_extension.py", line 691, in win_wrap_ninja_compile
    with_cuda=with_cuda)
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\torch\utils\cpp_extension.py", line 1360, in _write_ninja_file_and_compile_objects
    error_prefix='Error compiling objects for extension')
  File "C:\Users\benbenbj\.envs\mp\lib\site-packages\torch\utils\cpp_extension.py", line 1682, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

after run command python setup.py build_ext. But now the directory show 31 entries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions — mmcv 1.7.0 documentation
This error is because your CUDA environment is not installed correctly. You may try to re-install your CUDA environment and then delete the...
Read more >
mmcv Changelog - pyup.io
Add steps to install mmcv-full on Ascend machine ... Fixed `collec_env()` encoding error on Windows (1905) ... Bug fixes - Fix Python3.10 CI...
Read more >
Message "note: This error originates from a subprocess, and is ...
You have to install the Python 3.9.10 version from python.org and after installation, upgrade your pip and everything will be sorted.
Read more >
Installation — AutoGluon Documentation 0.6.1 documentation
Windows. Version: PIP Source. PIP Release. Install AutoGluon from source. ... via mim install mmcv-full , pip install mmdet and pip install pycocotools...
Read more >
mmcv - PyPI
mmcv 1.7.0. pip install mmcv. Copy PIP instructions. Latest version. Released: Nov 3, 2022. OpenMMLab Computer Vision Foundation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found