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

Pyrealsense2 : Can't able to build from source #12641

Closed
Muthukumar4796 opened this issue Feb 8, 2024 · 8 comments
Closed

Pyrealsense2 : Can't able to build from source #12641

Muthukumar4796 opened this issue Feb 8, 2024 · 8 comments

Comments

@Muthukumar4796
Copy link

Muthukumar4796 commented Feb 8, 2024

| Camera Model | D455 |
| Operating System & Version | Ubuntu 22.04 |
| Language | python |

I'm trying to install Pyrealsense 2 by building it from source. However, during the build process, it keeps showing an error.

I have attached the error for your reference.build_error.txt

@Muthukumar4796 Muthukumar4796 changed the title Can't able to build pyrealsense2 from source Pyrealsense2 : Can't able to build from source Feb 8, 2024
@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 8, 2024

Hi @Muthukumar4796 Are you able to compile the librealsense SDK successfully without the pyrealsense2 wrapper? If so then you could afterwards install the wrapper separately from packages instead of source code with the command pip install pyrealsense2

At the time of writing this, the pip install method of installing the wrapper supports Python 3.7 to 3.11 on computers / computing devices with x86 / x64 architecture (such as laptop and desktop PCs) and Python 3.7 to 3,9 on Arm architectured devices (such as Nvidia Jetson and Raspberry Pi).

@Muthukumar4796
Copy link
Author

My main goal is to fully build the pyrealsense2 library from source with CUDA on my Ubuntu 22.04 PC, and ensure that it only uses the GPU and not the CPU. If you have any ideas on how to accomplish this, please provide step-by-step instructions.

@MartyG-RealSense
Copy link
Collaborator

CUDA support in the librealsense SDK requires an Nvidia GPU and is enabled by including the flag -DBUILD_WITH_CUDA in the CMake build instruction. It is usually only used with the Nvidia GPU on Nvidia Jetson computing boards though and the few attempts made in the past to use it on an Nvidia equipped PC have not worked..

The only operations that librealsense's CUDA support accelerates are YUY to RGB color conversion, depth-color alignment and point clouds. So if you are not using point clouds or alignment in your project then CUDA will not reduce CPU utilization.

@Muthukumar4796
Copy link
Author

I have a laptop with a built-in Nvidia-1650 graphics card that supports CUDA version 12.2. It runs Ubuntu 22.04. However, you mentioned that Nvidia-equipped PCs not work for building pyrealsense2. Therefore, I am unable to build pyrealsense2 for my PC. Could you suggest an alternative method for me to do this?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 8, 2024

PCs with an Nvidia GPU have difficulty enabling librealsense's CUDA support but CUDA is not required for pyrealsense2 and you can build the wrapper on PC without enabling librealsense's CUDA support.

@Muthukumar4796
Copy link
Author

Yes but it consumes CPU, and I have another process that requires CPU power.Thats why I tried to build with GPU.

@MartyG-RealSense
Copy link
Collaborator

The librealsense SDK has an alternative to CUDA for offloading work onto the GPU called GLSL processing blocks, and it is 'vendor neutral' meaning that it can work with any GPU brand and not just Nvidia. However, it is meant for use with C++ and so may not be helpful to you if your project requires Python. Please see #3654 for further details about GLSL.

There are not other options than CUDA and GLSL for offloading RealSense processing to the GPU, unfortunately.

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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