isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.23k stars 2.28k forks source link

How to use cuda in dense RGB-D SLAM on win10 #5256

Open lvkoala opened 2 years ago

lvkoala commented 2 years ago

Checklist

My Question

Hi,

I am trying to run the python dense SLAM example. I worked in using CPU but when I tried to run it using CUDA, such error occur

Traceback (most recent call last):
  File "D:\PyProjects\pyOpen3D\open3d\python\t_reconstruction_system\dense_slam.py", line 121, in <module>
    volume, poses = slam(depth_file_names, color_file_names, intrinsic,
  File "D:\PyProjects\pyOpen3D\open3d\python\t_reconstruction_system\dense_slam.py", line 46, in slam
    model = o3d.t.pipelines.slam.Model(config.voxel_size, 16,
RuntimeError: [Open3D Error] (class std::shared_ptr<class open3d::core::DeviceHashBackend> __cdecl open3d::core::CreateDeviceHashBackend(__int64,const class open3d::core::Dtype &,const class open3d::cor
e::SizeVector &,const class std::vector<class open3d::core::Dtype,class std::allocator<class open3d::core::Dtype> > &,const class std::vector<class open3d::core::SizeVector,class std::allocator<class op
en3d::core::SizeVector> > &,const class open3d::core::Device &,const enum open3d::core::HashBackendType &)) D:\a\Open3D\Open3D\cpp\open3d\core\hashmap\DeviceHashBackend.cpp:57: [CreateDeviceHashBackend]
: Unimplemented device

In addition I tried python -c 'import open3d as o3d; print(o3d.core.cuda.is_available())' and it returned False

Versions currently installed:

I had read the issue and document. I am a bit confused about whether open3d support cuda on windows. Could you please tell me how to do that?

Thanks

yxlao commented 2 years ago

Currently, the released Open3D Windows wheel is not CUDA-enabled. We may enable CPU+CUDA for Windows by default in future releases. The Ubuntu wheel is CUDA-enabled with CUDA 11.x by default, so you may use Ubuntu as well.

Here, we provide experimental wheels for Python 3.7, 3.8, 3.9 on Windows witgh CUDA 11.x.

Usage

conda activate your-env-name
pip install xxx.whl
python -c 'import open3d as o3d; print(o3d.core.cuda.is_available())

Supported Python versions:

Supported devices:

Compile from source

Alternatively, you can compile from source with CUDA enabled. First, get this patch: https://github.com/isl-org/Open3D/pull/5259, and then compile and install with:

conda activate your-env-name

cd Open3D
mkdir build
cd build
cmake -DBUILD_CUDA_MODULE=ON -DDEVELOPER_BUILD=OFF ..
cmake --build . --config Release --parallel $env:NUMBER_OF_PROCESSORS --target install-pip-package

python -c 'import open3d as o3d; print(o3d.core.cuda.is_available())