Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cuda Cmake with vs2019 #10227

Closed
arothenberg opened this issue Feb 9, 2022 · 4 comments
Closed

Cuda Cmake with vs2019 #10227

arothenberg opened this issue Feb 9, 2022 · 4 comments

Comments

@arothenberg
Copy link

arothenberg commented Feb 9, 2022


Required Info
Camera Model D435
Firmware Version 05.12.02.100
Operating System & Version Win (10)
Platform PC
SDK Version 2.32
Language C++
Segment desktop app

Issue Description

I'm building the sdk with the Cuda flag and I ran into a problem where I had to manually add the
Cuda_toolkit_root_dir -
I downloaded the latest Cuda and the path is
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6

I was also missing(according to cmake) the Cuda sdk location. After some research I found that "samples" was the sdk location so for
Cuda_sdk_root_dir I added
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.6/extras/CUPTI
and also tried it empty with the same result.
I assume the sdk isn't crucial but IDK.

The files generated but I got this warning:

 CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.

I researched further and was suggested
cmake --help-policy CMP0104 - which showed a large text block about deprecation after v3.18... I didn't understand the implications.

Does this warning mean Cuda has not been enabled with realsense?

Thanks.

@MartyG-RealSense
Copy link
Collaborator

Hi @arothenberg CUDA support requires the computer to have an Nvidia graphics chip or video card. Nvidia Jetson boards are an example of a computing device that has a built-in Nvidia GPU. If your computer does not have Nvidia graphics then CUDA support cannot work.

For computers without Nvidia graphics hardware, the RealSense SDK has an alternative system called GLSL Processing Blocks to offload processing from the CPU to the GPU. GLSL is 'vendor neutral' and so can work with any GPU brand, though improvements may not be noticable when used with a low-end device. #3654 has a very good pros and cons analysis of GLSL processing blocks and when it can be used.

There is also a C++ GLSL example program at https://github.com/IntelRealSense/librealsense/tree/master/examples/gl

@arothenberg
Copy link
Author

arothenberg commented Feb 9, 2022

I have nvidea. The problem is that I am getting the above warning in cmake about empty architecture and I need to know the implications or have a way to test if CUDA is in fact being used by the example cpps.
Thanks you.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 9, 2022

It is very rare on this forum to have cases where CUDA is being used with librealsense on a PC instead of an Nvidia Jetson. #4816 is such a case though, where a RealSense team member advises to first follow the CUDA installation instructions in the official Nvidia documentation before building librealsense with CUDA support using the CMake build flag -DBUILD_WITH_CUDA=true

If CUDA and the librealsense SDK's CUDA support are both installed sucessfully then CUDA graphics acceleration should be applied automatically.

The only way I know of to check whether CUDA is being applied during the running of a RealSense application is to check CPU percentage usage to see whether the % usage is very low when pointcloud generation, RGB color conversion or depth-color alignment is being performed, as described at #6302

@arothenberg
Copy link
Author

Ok Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants