Open BEE1214 opened 1 year ago
I'm having the same issue
I am also experiencing this issue
I haven't tried compiling it for cuda 12.x but my best bet is that you need to correctly link and include libcu++
. I.e., see breaking changes of thrust 2.x. https://github.com/NVIDIA/thrust/releases/tag/2.0.0
I've also encountered that problem. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
I've managed to install it by fixing all errors by adding some headers to 4 files. So you need to download this repo and modify the source code.
1 - .../MinkowskiEngine/src/convolution_kernel.cuh
Add header:
#include <thrust/execution_policy.h>
2 - .../MinkowskiEngine/src/coordinate_map_gpu.cu
Add headers:
#include <thrust/unique.h>
#include <thrust/remove.h>
3 - .../MinkowskiEngine/src/spmm.cu
Add headers:
#include <thrust/execution_policy.h>
#include <thrust/reduce.h>
#include <thrust/sort.h>
4 - .../MinkowskiEngine/src/3rdparty/concurrent_unordered_map.cuh
Add header:
#include <thrust/execution_policy.h>
I'm installing it in venv through python setup.py install
If it is the correct solution may be better to add it to the main readme file about CUDA 12.1+ installation
I've also encountered that problem. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
It doesn't work in Ubuntu20.04, cuda 12.1, pytorch 2.2.2+cu121
I've also encountered that problem. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
I've managed to install it by fixing all errors by adding some headers to 4 files. So you need to download this repo and modify the source code.
1 - .../MinkowskiEngine/src/convolution_kernel.cuh
Add header:
#include <thrust/execution_policy.h>
2 - .../MinkowskiEngine/src/coordinate_map_gpu.cu
Add headers:
#include <thrust/unique.h> #include <thrust/remove.h>
3 - .../MinkowskiEngine/src/spmm.cu
Add headers:
#include <thrust/execution_policy.h> #include <thrust/reduce.h> #include <thrust/sort.h>
4 - .../MinkowskiEngine/src/3rdparty/concurrent_unordered_map.cuh
Add header:
#include <thrust/execution_policy.h>
I'm installing it in venv through
python setup.py install
If it is the correct solution may be better to add it to the main readme file about CUDA 12.1+ installation
It works for me,my environment is Ubuntu20.04, cuda 12.2, torchvision 0.13,pytorch_lightning 1.6.0, and so on.
J'ai également rencontré ce problème. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
Cela ne fonctionne pas dans Ubuntu20.04, cuda 12.1, pytorch 2.2.2+cu121
The same thing didn't work for me. Have you found a solution?
J'ai également rencontré ce problème. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0 J'ai réussi à l'installer en corrigeant toutes les erreurs en ajoutant des en-têtes à 4 fichiers. Vous devez donc télécharger ce dépôt et modifier le code source. 1 - .../MinkowskiEngine/src/convolution_kernel.cuh Ajouter un en-tête :
#include <thrust/execution_policy.h>
2 - .../MinkowskiEngine/src/coordonnée_map_gpu.cu Ajouter des en-têtes :#include <thrust/unique.h> #include <thrust/remove.h>
3 - .../MinkowskiEngine/src/spmm.cu Ajouter des en-têtes :
#include <thrust/execution_policy.h> #include <thrust/reduce.h> #include <thrust/sort.h>
4 - .../MinkowskiEngine/src/3rdparty/concurrent_unordered_map.cuh Ajouter un en-tête :
#include <thrust/execution_policy.h>
Je l'installe dans venv viapython setup.py install
Si c'est la bonne solution, il est peut-être préférable de l'ajouter au fichier Lisez-moi principal sur l'installation de CUDA 12.1+.Cela fonctionne pour moi, mon environnement est Ubuntu20.04, cuda 12.2, torchvision 0.13,pytorch_lightning 1.6.0, etc.
Does this work on Google Colab? because ti don't work for me it give me the error: Does this work on Google Colab? Because it doesn't work for me; it gives me an error:
/content/drive/MyDrive/MinkowskiEngine-master/setup.py:201: 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
Using BLAS=openblas Using the default compiler running install /usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer, pypa/build or
other standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!! self.initialize_options() /usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated. !!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer, pypa/build or
other standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!! self.initialize_options() running bdist_egg running egg_info writing MinkowskiEngine.egg-info/PKG-INFO writing dependency_links to MinkowskiEngine.egg-info/dependency_links.txt writing requirements to MinkowskiEngine.egg-info/requires.txt writing top-level names to MinkowskiEngine.egg-info/top_level.txt /usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:499: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'MinkowskiEngine.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'MinkowskiEngine.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib.linux-x86_64-cpython-310 creating build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiPruning.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiNetwork.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiSparseTensor.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiCoordinateManager.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/sparse_matrix_functions.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiFunctional.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiBroadcast.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiCommon.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiOps.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiPooling.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiNormalization.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiKernelGenerator.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiConvolution.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiTensor.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiInterpolation.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiChannelwiseConvolution.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiTensorField.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/init.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/diagnostics.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiNonlinearity.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine copying ./MinkowskiEngine/MinkowskiUnion.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine creating build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/coords.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/init.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/summary.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/quantization.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/gradcheck.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/init.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils copying ./MinkowskiEngine/utils/collation.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/utils creating build/lib.linux-x86_64-cpython-310/MinkowskiEngine/modules copying ./MinkowskiEngine/modules/init.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/modules copying ./MinkowskiEngine/modules/senet_block.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/modules copying ./MinkowskiEngine/modules/resnet_block.py -> build/lib.linux-x86_64-cpython-310/MinkowskiEngine/modules running build_ext /usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:418: UserWarning: The detected CUDA version (12.2) has a minor version mismatch with the version that was used to compile PyTorch (12.1). Most likely this shouldn't be a problem. warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda)) /usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:428: UserWarning: There are no x86_64-linux-gnu-g++ version bounds defined for CUDA version 12.2 warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}') building 'MinkowskiEngineBackend._C' extension INFO: C compiler: x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC
creating build/temp.linux-x86_64-cpython-310 creating build/temp.linux-x86_64-cpython-310/content creating build/temp.linux-x86_64-cpython-310/content/drive creating build/temp.linux-x86_64-cpython-310/content/drive/MyDrive creating build/temp.linux-x86_64-cpython-310/content/drive/MyDrive/MinkowskiEngine-master creating build/temp.linux-x86_64-cpython-310/content/drive/MyDrive/MinkowskiEngine-master/src creating build/temp.linux-x86_64-cpython-310/pybind INFO: compile options: '-I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/content/drive/MyDrive/MinkowskiEngine-master/src -I/content/drive/MyDrive/MinkowskiEngine-master/src/3rdparty -I/usr/include/python3.10 -c' extra options: 'cxx nvcc' /usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/broadcast_gpu.cu INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/broadcast_kernel.cu INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/convolution_gpu.cu INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/convolution_kernel.cu /content/drive/MyDrive/MinkowskiEngine-master/src/convolution_kernel.cu(334): warning #68-D: integer conversion resulted in a change of sign size_t n_active_in_volume, shared_mem_size = -1; ^
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/convolution_kernel.cu(573): warning #68-D: integer conversion resulted in a change of sign size_t n_active_in_volume, shared_mem_size = -1; ^
/content/drive/MyDrive/MinkowskiEngine-master/src/convolution_kernel.cu(334): warning #68-D: integer conversion resulted in a change of sign size_t n_active_in_volume, shared_mem_size = -1; ^
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/convolution_kernel.cu(573): warning #68-D: integer conversion resulted in a change of sign size_t n_active_in_volume, shared_mem_size = -1; ^
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/convolution_transpose_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_gpu.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cu /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, bool, bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=std::allocator, CoordinateMapType=minkowski::CoordinateMapCPU]" at line 1451
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, bool, bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=minkowski::detail::default_allocator, CoordinateMapType=minkowski::CoordinateMapGPU]" at line 401 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, bool, bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=minkowski::detail::c10_allocator, CoordinateMapType=minkowski::CoordinateMapGPU]" at line 404 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(429): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(429): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(430): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(431): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_cpu.hpp(58): warning #177-D: variable "float_type" was declared but never referenced at::ScalarType const float_type = ^ detected during: instantiation of "std::pair<at::Tensor, at::Tensor> minkowski::CoordinateMapCPU<coordinate_type, TemplatedAllocator>::field_map(const coordinate_field_type , minkowski::CoordinateMapCPU<coordinate_type, TemplatedAllocator>::size_type) const [with coordinate_type=int32_t, TemplatedAllocator=std::allocator, coordinate_field_type=float]" at line 329 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp instantiation of "std::pair<at::Tensor, at::Tensor> minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::field_to_sparse_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey *) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=std::allocator, CoordinateMapType=minkowski::CoordinateMapCPU]" at line 1451 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, __nv_bool, __nv_bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=std::allocator, CoordinateMapType=minkowski::CoordinateMapCPU]" at line 1451
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, __nv_bool, __nv_bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=minkowski::detail::default_allocator, CoordinateMapType=minkowski::CoordinateMapGPU]" at line 401 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(428): warning #20014-D: calling a host function from a host device function is not allowed
: base_type{other.region_type(), other.coordinate_size(),
^
detected during:
instantiation of "minkowski::gpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp(717): warning #430-D: returning reference to local temporary return detail::empty_map_functor<coordinate_type, TemplatedAllocator, ^ detected during instantiation of "const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type &minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey , const minkowski::CoordinateMapKey , const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, const minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type &, minkowski::RegionType::Type, const at::Tensor &, __nv_bool, __nv_bool) [with coordinate_type=int32_t, coordinate_field_type=float, TemplatedAllocator=minkowski::detail::c10_allocator, CoordinateMapType=minkowski::CoordinateMapGPU]" at line 404 of /content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(429): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(429): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(430): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
/content/drive/MyDrive/MinkowskiEngine-master/src/kernel_region.hpp(431): warning #20011-D: calling a host function("minkowski::cpu_kernel_region
INFO: x86_64-linux-gnu-gcc: /content/drive/MyDrive/MinkowskiEngine-master/src/direct_max_pool.cpp
/content/drive/MyDrive/MinkowskiEngine-master/src/coordinate_map_manager.cpp: In instantiation of ‘const kernel_map_type& minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map(const minkowski::CoordinateMapKey, const minkowski::CoordinateMapKey, const stride_type&, const stride_type&, const stride_type&, minkowski::RegionType::Type, const at::Tensor&, bool, bool) [with coordinate_type = int; coordinate_field_type = float; TemplatedAllocator = std::allocator; CoordinateMapType = minkowski::CoordinateMapCPU; minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::kernel_map_type = minkowski::cpu_kernel_map; minkowski::CoordinateMapManager<coordinate_type, coordinate_field_type, TemplatedAllocator, CoordinateMapType>::stride_type = std::vector<unsigned int, std::allocator
Remark: The warnings can be suppressed with "-diag-suppress
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/interpolation_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/local_pooling_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/local_pooling_transpose_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_cpu.cpp
nvcc fatal : Unknown option '-fopenmp'
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/pooling_avg_kernel.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu: In function ‘void minkowski::sort_coo_gpu(cusparseHandle_t, int, int, int, int, int, allocator_type&)’:
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu:181:69: warning: ‘cusparseStatus_t cusparseCreateIdentityPermutation(cusparseHandle_t, int, int)’ is deprecated: The routine will be removed in the next major release [-Wdeprecated-declarations]
181 | CUSPARSE_CHECK(cusparseCreateIdentityPermutation(handle, nnz, P));
| ~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu: In instantiation of ‘void minkowski::sort_coo_gpu(cusparseHandle_t, int, int, int, int, int, allocator_type&) [with allocator_type = minkowski::detail::default_allocator~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu:181:69: warning: ‘cusparseStatus_t cusparseCreateIdentityPermutation(cusparseHandle_t, int, int)’ is deprecated: The routine will be removed in the next major release [-Wdeprecated-declarations]
181 | CUSPARSE_CHECK(cusparseCreateIdentityPermutation(handle, nnz, P));
| ~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu:181:69: warning: ‘cusparseStatus_t cusparseCreateIdentityPermutation(cusparseHandle_t, int, int)’ is deprecated: The routine will be removed in the next major release [-Wdeprecated-declarations]
181 | CUSPARSE_CHECK(cusparseCreateIdentityPermutation(handle, nnz, P));
| ~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu: In instantiation of ‘void minkowski::sort_coo_gpu(cusparseHandle_t, int, int, int, int, int, allocator_type&) [with allocator_type = minkowski::detail::c10_allocator~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu:181:69: warning: ‘cusparseStatus_t cusparseCreateIdentityPermutation(cusparseHandle_t, int, int)’ is deprecated: The routine will be removed in the next major release [-Wdeprecated-declarations]
181 | CUSPARSE_CHECK(cusparseCreateIdentityPermutation(handle, nnz, P));
| ~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_gpu.cu:181:69: warning: ‘cusparseStatus_t cusparseCreateIdentityPermutation(cusparseHandle_t, int, int*)’ is deprecated: The routine will be removed in the next major release [-Wdeprecated-declarations]
181 | CUSPARSE_CHECK(cusparseCreateIdentityPermutation(handle, nnz, P));
| ~~~~~~~~~^
/usr/local/cuda/include/cusparse.h:4060:1: note: declared here
4060 | cusparseCreateIdentityPermutation(cusparseHandle_t handle,
| ^~~~~~~~~
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/pooling_max_kernel.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/pruning_gpu.cu
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/quantization.cpp
nvcc fatal : Unknown option '-fopenmp'
INFO: nvcc: /content/drive/MyDrive/MinkowskiEngine-master/src/spmm.cu
/content/drive/MyDrive/MinkowskiEngine-master/src/spmm.cu(96): warning #177-D: variable "is_int64" was declared but never referenced
constexpr bool is_int64 = std::is_same<th_int_type, int64_t>::value;
^
Remark: The warnings can be suppressed with "-diag-suppress
/content/drive/MyDrive/MinkowskiEngine-master/src/spmm.cu(358): warning #177-D: variable "is_int64" was declared but never referenced constexpr bool is_int64 = std::is_same<th_int_type, int64_t>::value; ^
INFO: nvcc: pybind/minkowski.cu error: Command "/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/content/drive/MyDrive/MinkowskiEngine-master/src -I/content/drive/MyDrive/MinkowskiEngine-master/src/3rdparty -I/usr/include/python3.10 -c /content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_cpu.cpp -o build/temp.linux-x86_64-cpython-310/content/drive/MyDrive/MinkowskiEngine-master/src/math_functions_cpu.o -fopenmp -O3 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17" failed with exit status 1
J'ai également rencontré ce problème. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
Cela ne fonctionne pas dans Ubuntu20.04, cuda 12.1, pytorch 2.2.2+cu121
The same thing didn't work for me. Have you found a solution?
install libopenblas-dev before install MinkowskiEngine, and then the solution works for me.
sudo apt install libopenblas-dev
Thanks for your reply. It works successfully on CUDA12.2 Pytorch2.2!
I've also encountered that problem. Ubuntu 22.04, CUDA 12.2, nvcc cuda_12.2.r12.2, PyTorch 2.1.0
I've managed to install it by fixing all errors by adding some headers to 4 files. So you need to download this repo and modify the source code.
1 - .../MinkowskiEngine/src/convolution_kernel.cuh
Add header:
#include <thrust/execution_policy.h>
2 - .../MinkowskiEngine/src/coordinate_map_gpu.cu
Add headers:
#include <thrust/unique.h> #include <thrust/remove.h>
3 - .../MinkowskiEngine/src/spmm.cu
Add headers:
#include <thrust/execution_policy.h> #include <thrust/reduce.h> #include <thrust/sort.h>
4 - .../MinkowskiEngine/src/3rdparty/concurrent_unordered_map.cuh
Add header:
#include <thrust/execution_policy.h>
I'm installing it in venv through
python setup.py install
If it is the correct solution may be better to add it to the main readme file about CUDA 12.1+ installation
This also worked for me. I'm installing this in a Docker container, so I use the following to insert the appropriate headers into the right files in place, and then I install the Python bindings. In my Dockerfile, I do:
ENV CUDA_HOME=/usr/local/cuda
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6 8.9"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
RUN git clone https://github.com/NVIDIA/MinkowskiEngine.git /tmp/MinkowskiEngine \
&& cd /tmp/MinkowskiEngine \
&& sed -i '31i #include <thrust/execution_policy.h>' ./src/convolution_kernel.cuh \
&& sed -i '39i #include <thrust/unique.h>\n#include <thrust/remove.h>' ./src/coordinate_map_gpu.cu \
&& sed -i '38i #include <thrust/execution_policy.h>\n#include <thrust/reduce.h>\n#include <thrust/sort.h>' ./src/spmm.cu \
&& sed -i '38i #include <thrust/execution_policy.h>' ./src/3rdparty/concurrent_unordered_map.cuh \
&& python setup.py install --force_cuda --blas=openblas \
&& cd - \
&& rm -rf /tmp/MinkowskiEngine
I am sharing this here in case someone else is trying to build and install the Python bindings in a Docker container. The base image I use is nvidia/cuda:12.1.1-devel-ubuntu20.04
with PyTorch 2.3.1 and CUDA 12.1.
Take special care that if you are using a GPU from the Ada generation (i.e. A6000), the architecture list needs to include 8.9 as 8.9 is specifically for Ada architectures. If you don't want to use Docker, this should work by just removing RUN
and doing this in your native environment, and also replacing ENV
with export
. Thanks!
Thanks again!
@rayryeng , can you share your whole Dockerfile? I'm getting various dependency issues when I copy and pasted your code above and made sure to pull the base image from FROM nvidia/cuda:12.1.1-devel-ubuntu20.04
I'm getting a new error
4.269 In file included from /usr/local/lib/python3.10/dist-packages/torch/include/pybind11/detail/../attr.h:13,
4.269 from /usr/local/lib/python3.10/dist-packages/torch/include/pybind11/detail/class.h:12,
4.269 from /usr/local/lib/python3.10/dist-packages/torch/include/pybind11/pybind11.h:13,
4.269 from /tmp/MinkowskiEngine/src/types.hpp:32,
4.269 from /tmp/MinkowskiEngine/src/kernel_region.hpp:36,
4.269 from /tmp/MinkowskiEngine/src/coordinate_map.hpp:30,
4.269 from /tmp/MinkowskiEngine/src/broadcast_gpu.cu:28:
4.269 /usr/local/lib/python3.10/dist-packages/torch/include/pybind11/detail/../detail/common.h:274:10: fatal error: Python.h: No such file or directory
4.269 /usr/local/lib/python3.10/dist-packages/torch/include/pybind11/detail/../detail/common.h:274:10: fatal error: Python.h: No such file or directory
4.269 274 | #include <Python.h>
4.269 | ^~~~~~~~~~
4.269 compilation terminated.
4.269 error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1
Here's my Dockerfile:
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
git make build-essential libopenblas-dev python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN pip install torch==2.3.1+cu121 torchvision torchaudio -f https://download.pytorch.org/whl/torch_stable.html
ENV CUDA_HOME=/usr/local/cuda
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6 8.9"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
RUN git clone https://github.com/NVIDIA/MinkowskiEngine.git /tmp/MinkowskiEngine \
&& cd /tmp/MinkowskiEngine \
&& sed -i '31i #include <thrust/execution_policy.h>' ./src/convolution_kernel.cuh \
&& sed -i '39i #include <thrust/unique.h>\n#include <thrust/remove.h>' ./src/coordinate_map_gpu.cu \
&& sed -i '38i #include <thrust/execution_policy.h>\n#include <thrust/reduce.h>\n#include <thrust/sort.h>' ./src/spmm.cu \
&& sed -i '38i #include <thrust/execution_policy.h>' ./src/3rdparty/concurrent_unordered_map.cuh \
&& python3 setup.py install --force_cuda --blas=openblas \
&& cd - \
&& rm -rf /tmp/MinkowskiEngine
I added in python-dev
into my install scripts and that seemed to fix it. The Dockerfile is now:
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
git make build-essential libopenblas-dev python3-dev python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN pip install torch==2.3.1+cu121 torchvision torchaudio -f https://download.pytorch.org/whl/torch_stable.html
ENV CUDA_HOME=/usr/local/cuda
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6 8.9"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
RUN git clone https://github.com/NVIDIA/MinkowskiEngine.git /tmp/MinkowskiEngine \
&& cd /tmp/MinkowskiEngine \
&& sed -i '31i #include <thrust/execution_policy.h>' ./src/convolution_kernel.cuh \
&& sed -i '39i #include <thrust/unique.h>\n#include <thrust/remove.h>' ./src/coordinate_map_gpu.cu \
&& sed -i '38i #include <thrust/execution_policy.h>\n#include <thrust/reduce.h>\n#include <thrust/sort.h>' ./src/spmm.cu \
&& sed -i '38i #include <thrust/execution_policy.h>' ./src/3rdparty/concurrent_unordered_map.cuh \
&& python3 setup.py install --force_cuda --blas=openblas \
&& cd - \
&& rm -rf /tmp/MinkowskiEngine
@chadrs2 I'm sorry for not getting back to you sooner. I did not install python3-dev
, but I used Miniconda and set the environment to Python 3.10 as I need that specific version of Python for my work.
So:
FROM nvidia/cuda:12.1.1-devel-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
# Remove any third-party apt sources to avoid issues with expiring keys.
RUN rm -f /etc/apt/sources.list.d/*.list
# Install some basic utilities, useful tools and other required libraries
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
ninja-build \
build-essential \
libopenblas-dev \
libglib2.0-0 \
libgl1-mesa-glx \
libsm6 \
libxext6 \
libxrender1 \
libxi6 \
libxkbcommon-x11-0 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install miniconda - Install in root /miniconda directory and make it accessible
ENV CONDA_AUTO_UPDATE_CONDA=false \
PATH=/miniconda/bin:$PATH
RUN curl -sLo /tmp/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py310_24.7.1-0-Linux-x86_64.sh \
&& chmod +x /tmp/miniconda.sh \
&& /tmp/miniconda.sh -b -p /miniconda \
&& rm /tmp/miniconda.sh
RUN pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121 --no-cache-dir
ENV CUDA_HOME=/usr/local/cuda
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6 8.9"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
RUN git clone https://github.com/NVIDIA/MinkowskiEngine.git /tmp/MinkowskiEngine \
&& cd /tmp/MinkowskiEngine \
&& sed -i '31i #include <thrust/execution_policy.h>' ./src/convolution_kernel.cuh \
&& sed -i '39i #include <thrust/unique.h>\n#include <thrust/remove.h>' ./src/coordinate_map_gpu.cu \
&& sed -i '38i #include <thrust/execution_policy.h>\n#include <thrust/reduce.h>\n#include <thrust/sort.h>' ./src/spmm.cu \
&& sed -i '38i #include <thrust/execution_policy.h>' ./src/3rdparty/concurrent_unordered_map.cuh \
&& python3 setup.py install --force_cuda --blas=openblas \
&& cd - \
&& rm -rf /tmp/MinkowskiEngine
@rayryeng, thank you! This finally works! Do you run into the line of installing MinkowskiEngine (i.e. python3 setup.py install --force_cuda --blas=openblas
) taking a really long time?
@rayryeng, thank you! This finally works! Do you run into the line of installing MinkowskiEngine (i.e.
python3 setup.py install --force_cuda --blas=openblas
) taking a really long time?
Hi! From what I understand, there are various CUDA kernels that are being compiled before the files are copied over to your Python packages directory. The kernel building took approximately 15 minutes and I have a very heavy compute machine... It will definitely take some time. For my image, end to end it took about 20 minutes to build. I have other dependencies I didn't list for brevity.
I have two docker containers based on ubuntu 20.04.
And simple pip installation:
But I always get error with thrust
#include <thrust/execution_policy.h>
inconcurrent_unordered_map.cuh
but then i ended up with error.I do have installed libtorch 2.0.1 in 2nd container.