NVIDIA / MinkowskiEngine

Minkowski Engine is an auto-diff neural network library for high-dimensional sparse tensors
https://nvidia.github.io/MinkowskiEngine
Other
2.43k stars 360 forks source link

MinkowskiEngine 0.5.4 not finding OpenBLAS library #447

Closed samfux84 closed 2 years ago

samfux84 commented 2 years ago

Hi,

Even though I set $BLAS_INCLUDE_DIRS, $BLAS_LIBRARY_DIRS and use the command line options --blas-include-dirs and--blas-library-dirs, the installation fails, because the OpenBLAS library is not detected:

[sfux@eu-g2-15 ~]$ echo $BLAS_INCLUDE_DIRS
/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/include
[sfux@eu-g2-15 ~]$ echo $BLAS_INCLUDE_DIRS
/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/include
[sfux@eu-g2-15 ~]$ module list

Currently Loaded Modules:
  1) StdEnv   2) gcc/8.2.0   3) openblas/0.2.20   4) cuda/11.3.1   5) cudnn/8.2.1.32   6) nccl/2.7.8-1   7) python_gpu/3.9.9   8) ninja/1.10.2   9) eth_proxy

[sfux@eu-g2-15 ~]$ echo $PATH | grep openblas
/cluster/apps/gcc-8.2.0/ninja-1.10.2-srlrwckbteqj6zlambbfd3ras23rf5cm/bin:/cluster/apps/lsf/10.1/linux2.6-glibc2.3-x86_64/bin:/cluster/apps/gcc-8.2.0/cuda-11.3.1-o54iuxgz6jm4csvkstuj5hjg4tvd44h3/bin:/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/bin:/cluster/apps/nss/gcc-8.2.0/python/3.9.9/x86_64/bin:/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin:/cluster/home/sfux/.local/bin:/cluster/apps/local:/cluster/apps/sfos/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/cluster/home/sfux/bin:/cluster/apps/ansys/v170/fluent/bin:/cluster/home/sfux/shellscript:/cluster/home/sfux/prog/bash
[sfux@eu-g2-15 ~]$ echo $LD_LIBRARY_PATH | grep openblas
/cluster/apps/lsf/10.1/linux2.6-glibc2.3-x86_64/lib:/cluster/apps/lsf/10.1/linux2.6-glibc2.3-x86_64/lib:/cluster/apps/gcc-8.2.0/nccl-2.7.8-1-kncqlwz6hr3v7qeg77nabu5vyzzsbnqz/lib:/cluster/apps/gcc-8.2.0/cudnn-8.2.1.32-yqvbgr3teq3v6xu5eyc75xhbl2ya343j/lib64:/cluster/apps/gcc-8.2.0/cuda-11.3.1-o54iuxgz6jm4csvkstuj5hjg4tvd44h3/lib64:/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/lib:/cluster/apps/nss/gcc-8.2.0/python/3.9.9/x86_64/lib64:/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/lib64:/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/lib
[sfux@eu-g2-15 ~]$ pip install MinkowskiEngine  --install-option="--blas=openblas"  -v --no-deps --install-option="--force_cuda" --install-option="--cuda_home=/cluster/apps/gcc-8.2.0/cuda-11.3.1-o54iuxgz6jm4csvkstuj5hjg4tvd44h3" --install-option="--blas_include_dirs=/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/include" --install-option="--blas_library_dirs=/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/lib"
/cluster/apps/nss/gcc-8.2.0/python/3.9.9/x86_64/lib64/python3.9/site-packages/pip/_internal/commands/install.py:245: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
  cmdoptions.check_install_build_global(options)
Using pip 21.3.1 from /cluster/apps/nss/gcc-8.2.0/python/3.9.9/x86_64/lib64/python3.9/site-packages/pip (python 3.9)
Collecting MinkowskiEngine
  Using cached MinkowskiEngine-0.5.4.tar.gz (246 kB)
  Running command python setup.py egg_info
  WARNING: Skipping MinkowskiEngine as it is not installed.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/scratch/206455079.tmpdir/pip-install-wq42z2wg/minkowskiengine_c12731f9b4dd4bdca6d7e5d251e7f22c/setup.py", line 205, in <module>
      raise ImportError(
  ImportError:
  BLAS not found from numpy.distutils.system_info.get_info.
  Please specify BLAS with: python setup.py install --blas=openblas"
  for more information, please visit https://github.com/NVIDIA/MinkowskiEngine/wiki/Installation
  --------------------------------
  | CUDA compilation set         |
  --------------------------------
  Preparing metadata (setup.py) ... error

I expect that MinkowskiEngine can find the OpenBLAS library as I am using all possible ways to specify the path to it.


Desktop (please complete the following information):

[sfux@eu-g2-15 ~]$ wget -q https://raw.githubusercontent.com/NVIDIA/MinkowskiEngine/master/MinkowskiEngine/diagnostics.py ; python diagnostics.py
==========System==========
Linux-3.10.0-1160.45.1.el7.x86_64-x86_64-with-glibc2.17
cat: /etc/lsb-release: No such file or directory
3.9.9 (main, Dec  8 2021, 15:03:07)
[GCC 8.2.0]
==========Pytorch==========
1.10.0+cu113
torch.cuda.is_available(): True
==========NVIDIA-SMI==========
/usr/bin/nvidia-smi
Driver Version 495.29.05
CUDA Version 11.5
VBIOS Version 90.02.42.00.4F
Image Version G001.0000.02.04
GSP Firmware Version N/A
==========NVCC==========
/cluster/apps/gcc-8.2.0/cuda-11.3.1-o54iuxgz6jm4csvkstuj5hjg4tvd44h3/bin/nvcc
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
==========CC==========
CC=/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/g++
/cluster/spack/apps/linux-centos7-x86_64/gcc-4.8.5/gcc-8.2.0-6xqov2fhvbmehix42slain67vprec3fs/bin/g++
g++ (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

==========MinkowskiEngine==========
MinkowskiEngine not installed
[sfux@eu-g2-15 ~]$

This is a recurring issue that I face almost every time I try to install a new version of MinkowskiEngine. Any help is appreciated, as it seems to be a cool package that we would like to provide to all the users on our HPC cluster.

samfux84 commented 2 years ago

I could fix the issue by downloading the source code of MinkowskiEngine 0.5.4 and replacing

# args with return value
CUDA_HOME, argv = _argparse("--cuda_home", argv, False)
BLAS, argv = _argparse("--blas", argv, False)
BLAS_INCLUDE_DIRS, argv = _argparse("--blas_include_dirs", argv, False, is_list=True)
BLAS_LIBRARY_DIRS, argv = _argparse("--blas_library_dirs", argv, False, is_list=True)
MAX_COMPILATION_THREADS = 12

with

# args with return value
CUDA_HOME, argv = _argparse("--cuda_home", argv, False)
BLAS="openblas"
BLAS_INCLUDE_DIRS = "/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/include"
BLAS_LIBRARY_DIRS =  "/cluster/apps/gcc-8.2.0/openblas-0.2.20-5gatj7a35vypgjekzf3ibbtz54tlbk3m/lib"
MAX_COMPILATION_THREADS = 1

in setup.py and then I compiled it with

pip install --no-binary :all: -v --no-deps --install-option="--force_cuda" --install-option="--cuda_home=/cluster/apps/gcc-8.2.0/cuda-11.3.1-o54iuxgz6jm4csvkstuj5hjg4tvd44h3" .