isl-org / isl-org/Open3D

How to build project linking to Open3D with CUDA support

Open
#5,460 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### My Question

I built Open3D with CUDA support and tried to use Open3D in a ROS package but failed.

```
CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
By not providing "FindCUDAToolkit.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"CUDAToolkit", but CMake did not find one.

Could not find a package configuration file provided by "CUDAToolkit" with
any of the following names:

CUDAToolkitConfig.cmake
cudatoolkit-config.cmake

Add the installation prefix of "CUDAToolkit" to CMAKE_PREFIX_PATH or set
"CUDAToolkit_DIR" to a directory containing one of the above files. If
"CUDAToolkit" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
/media/user/libopen3d/lib/cmake/Open3D/Open3DConfig.cmake:25 (find_dependency)
pmdr/CMakeLists.txt:57 (find_package)
```bash

I tried to add the following variables:
```
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-11.6)
set(CMAKE_CUDA_COMPILER /usr/local/cuda-10.2/bin/nvcc)
list(APPEND CMAKE_MODULE_PATH /media/gcc/Data/Downloads/ubuntu/_LIBs/Open3D/build/stdgpu/src/ext_stdgpu/cmake/cuda)
set(STDGPU_CUDART_INCLUDE_DIR /usr/local/cuda-11.6/include)
set(STDGPU_CUDART_LIBRARY /usr/local/cuda-11.6/lib64)
set(STDGPU_CUDART_LIBRARY /usr/local/cuda-11.6/targets/x86_64-linux/lib)
```
But finally failed at
```
/usr/bin/ld: cannot find -lCUDA::cusolver_static
/usr/bin/ld: cannot find -lCUDA::cusparse_static
/usr/bin/ld: cannot find -lCUDA::cublas_static
/usr/bin/ld: cannot find -lCUDA::cublasLt_static
/usr/bin/ld: cannot find -lCUDA::culibos
/usr/bin/ld: cannot find -lCUDA::nppc_static
/usr/bin/ld: cannot find -lCUDA::nppicc_static
/usr/bin/ld: cannot find -lCUDA::nppif_static
/usr/bin/ld: cannot find -lCUDA::nppig_static
/usr/bin/ld: cannot find -lCUDA::nppim_static
/usr/bin/ld: cannot find -lCUDA::nppial_static
collect2: error: ld returned 1 exit status
make[2]: *** [pmdr/CMakeFiles/pmdr.dir/build.make:1915: pmdr/pmdr] Error 1
make[1]: *** [CMakeFiles/Makefile2:752: pmdr/CMakeFiles/pmdr.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
```bash

What is the correct way to use Open3D with CUDA support? I would really appreciate any solution since I've struggled to use Open3D in my project for few days.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.