MinkowskiEngine icon indicating copy to clipboard operation
MinkowskiEngine copied to clipboard

Error when installing MinkowskiEngine on WSL (Windows Subsystem Linux)

Open sambaPython24 opened this issue 3 years ago • 6 comments

Describe the bug I get an error when installing the engine on my Linux subsystem in Windows.

Running command git rev-parse HEAD
  7867296920d055539aec295c0c41d06a4309b876
  Resolved https://github.com/NVIDIA/MinkowskiEngine to commit 7867296920d055539aec295c0c41d06a4309b876
  Running command git rev-parse HEAD
  7867296920d055539aec295c0c41d06a4309b876
  Running command python setup.py egg_info
  WARNING: Skipping MinkowskiEngine as it is not installed.
  /tmp/pip-req-build-fgmmiyyu/setup.py:198: DeprecationWarning:

    `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    of the deprecation of `distutils` itself. It will be removed for
    Python >= 3.12. For older Python versions it will remain present.
    It is recommended to use `setuptools < 60.0` for those Python versions.
    For more details, see:
      https://numpy.org/devdocs/reference/distutils_status_migration.html


    import numpy.distutils.system_info as sysinfo       
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-req-build-fgmmiyyu/setup.py", line 308, in <module>
      Extension(
    File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 983, in CUDAExtension
      library_dirs += library_paths(cuda=True)
    File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1098, in library_paths
      if (not os.path.exists(_join_cuda_home(lib_dir)) and
    File "/home/user/.local/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2125, in _join_cuda_home
      raise EnvironmentError('CUDA_HOME environment variable is not set. '
  OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
  --------------------------------
  | CUDA compilation set         |
  --------------------------------

  Using BLAS=openblas
  Using the default compiler
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.  
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/user/anaconda3/envs/py3-mink/bin/python -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"   
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))        
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-req-build-fgmmiyyu/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-uklkbe3i
  cwd: /tmp/pip-req-build-fgmmiyyu/
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.  
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

To Reproduce I use a linux subsystem and I follow the steps described in the documentation

conda create -n py3-mink python=3.8
conda activate py3-mink

conda install openblas-devel -c anaconda
conda install pytorch=1.9.0 torchvision cudatoolkit=11.1 -c pytorch -c nvidia

# Install MinkowskiEngine

# Uncomment the following line to specify the cuda home. Make sure `$CUDA_HOME/nvcc --version` is 11.X
# export CUDA_HOME=/usr/local/cuda-11.1
pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"

# Or if you want local MinkowskiEngine
git clone https://github.com/NVIDIA/MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
  • a minimally reproducible code.

Expected behavior A clear and concise description of what you expected to happen.


Desktop (please complete the following information):

  • OS: Ubuntu-22.04 in a Windows Subsystem (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.17)
  • Python version: 3.8 according to the this recipe
  • Pytorch version: 1.12.1+cu102
  • CUDA version: 11.7
  • NVIDIA Driver version: 516.94
  • Minkowski Engine version MinkowskiEngine not installed
wget -q https://raw.githubusercontent.com/NVIDIA/MinkowskiEngine/master/MinkowskiEngine/diagnostics.py ; python diagnostics.py

Additional context No additional context

sambaPython24 avatar Oct 14 '22 16:10 sambaPython24

Hey, did you figure it out?

MunzerDw avatar Nov 11 '22 13:11 MunzerDw

@sambaPython24 did you solve the issue?

samanemami avatar Nov 15 '22 12:11 samanemami

hey, did anyone solved the issue???

kxxbeomjun avatar Oct 17 '23 15:10 kxxbeomjun

Maybe try adding export MAX_JOBS=1; before build command ?

boryun avatar Nov 24 '23 10:11 boryun

Maybe try adding export MAX_JOBS=1; before build command ?

It is slow but this worked for me!

EnvirodualSLO avatar Apr 26 '24 17:04 EnvirodualSLO

Try to install cuda in conda (choose the right cuda version).

conda install cuda -c nvidia/label/cuda-11.3.0

see: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#conda-installation

BuckyI avatar Jun 18 '24 03:06 BuckyI