-
Notifications
You must be signed in to change notification settings - Fork 47
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
Install Librealsense with CUDA on Jetson Tx2 #12
Comments
nvcc is the CUDA compiler. It is typically located in /usr/local/cuda/bin Are you using a tagged version of these install scripts? |
Yes I am using a tagged version of the script. Right now I'm using the version compatible with 2.13.0. So I am able to get part of the way through the installation if I change the CMake dependency back down to 3.5 and change CMake file in librealsense. However I am getting an issue linking the .so file with the CUDA files. It is telling me that there is an undefined reference to an rscuda:: function that is defined within cuda_conversion.cu from the librealsense2.so shared library. In the librealsense CMakeLists.txt, I modified project(librealsense2 LANGUAGES C CXX CUDA) to just project(librealsense 2). I then added the following lines so the program can find CUDA: find_package(CUDA QUIET REQUIRED)
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
SET(CUDA_HOST_COMPILER /usr/bin/g++)
LIST(APPEND CUDA_NVCC_FLAGS "--compiler-options -fno-strict-aliasing -use_fast_math")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
add_definitions(-DRS2_USE_CUDA) Perhaps it's because I am using CUDA 8.0 instead of CUDA 9.0? I don't see how that would create that much of a difference |
Which version of L4T are you using, and which tag version revision? Did you recompile the kernel? |
This is rather strange. The version of CUDA you should be using is version 9.0 if you are using L4T 28.2. Did you manually install CUDA 8.0? Version 2.13.0 of librealsense requires CMake version 3.8 or above, which may account for this issue. It would appear that it is missing the rscuda CUDA object files. |
Yes I manually installed CUDA 8.0. I was able to install OpenCV and my SLAM algorithm that both use CUDA. I manually changed the librealsense CMake file to be compatible with 3.5.1, which is how I arrived at the second issue, which doesnt link the .cu files correctly to the shared librealsense2.so library. But even if I revert their CMake file back to the original and use your CMake 3.11, I will arrive at the first issue documented above. |
It looks like you set the path, but not the program: I would try: SET(CMAKE_CUDA_COMPILER_ENV_VAR /usr/local/cuda-8.0/bin/nvcc) |
Compiles now with CUDA. Thanks! |
If you prefer to not change CMakeLists.txt, you can set CUDACXX with the environment by editing /etc/environment setting it in .bashrc does not work because you need to run the scripts as sudo, which does not carry over your environment variables. Oddly, running sudo with the -E flag also did not work. But setting it in /etc/environment makes it globally available. |
I have installed CUDA 8.0 on the Jetson Tx2 and am trying to install Librealsense using the jetson hacks script.
I can install the library fine without CUDA, but whenever I enable the CUDA flag, I am getting an issue that the CMAKE_CUDA_COMPILER flag is not found. I can compile other applications using CUDA just fine, but for some reason Librealsense cannot detect my version of CUDA. I've been trying to manually set the CMAKE_CUDA_COMPILER flag to /usr/bin/cc but that just throws another error during build.
I am using jetson hacks install Librealsense package for the installation, and updating the SDK version to 2.14.1 instead of 2.13.0. But both SDK versions return the same error for me.
The text was updated successfully, but these errors were encountered: