luigifreda / plvs

PLVS is a real-time SLAM system with points, lines, volumetric mapping and 3D unsupervised incremental segmentation.
GNU General Public License v3.0
453 stars 67 forks source link

An error occurred while building the PLVS framework #28

Closed Cmomo1113 closed 5 months ago

Cmomo1113 commented 5 months ago

CMake Error at /home/cyl/opt/cmake-3.23.2/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find CUDA: Found unsuitable version "12.0", but required is exact version "11.0" (found /usr/local/cuda) Call Stack (most recent call first): /home/cyl/opt/cmake-3.23.2/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:592 (_FPHSA_FAILURE_MESSAGE) /home/cyl/opt/cmake-3.23.2/share/cmake-3.23/Modules/FindCUDA.cmake:1264 (find_package_handle_standard_args) /home/cyl/plvs-master/Thirdparty/opencv/install/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package) /home/cyl/plvs-master/Thirdparty/opencv/install/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package) CMakeLists.txt:40 (find_package) I have tried switching cuda versions and still get the same error. cuda version:11.0

Cmomo1113 commented 5 months ago

config.sh parameter settings

CUDA Settings

====================================================

N.B: if you do not have installed opencv with CUDA support you must set above:

USE_LOCAL_OPENCV=1

1: ON, 0: OFF

export USE_CUDA=0 # use CUDA in PLVS sparse SLAM
export CUDA_VERSION="cuda-11.6" # must be an installed CUDA path in "/usr/local";

if available, you can use the simple path "/usr/local/cuda" which should be a symbolic link to the last installed cuda version

if [ ! -d /usr/local/$CUDA_VERSION ]; then CUDA_VERSION="cuda" # use last installed CUDA path in standard path as a fallback fi

export PATH=/usr/local/$CUDA_VERSION/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/$CUDA_VERSION/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export CUDADIR=/usr/local/$CUDA_VERSION

Cmomo1113 commented 5 months ago

QQ20240320-201131

luigifreda commented 5 months ago

Hi, thanks for your feedback. Could you please share the full config.sh file or your modifications? I am not sure if you are using export USE_LOCAL_OPENCV=1 or not. In your case, since you are getting those errors, I suggest letting the build script install a local opencv (if you didn't do that).

Let me know.

Cmomo1113 commented 5 months ago

!/usr/bin/env bash

source bash_utils.sh

CONFIG_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) CONFIG_DIR=$(readlink -f $CONFIG_DIR) # this reads the actual path if a symbolic directory is used cd $CONFIG_DIR # this brings us in the actual folder of this config script (not the symbolic one)

echo "current dir: $CONFIG_DIR"

====================================================

C++ standard

====================================================

export CPP_STANDARD_VERSION=17 # we need c++17 since nvcc does not support c++20 yet (probably we can try mixing c++ standards and just let nvcc use c++17 ... not sure this is the best choice)

====================================================

OpenCV Settings

====================================================

1: ON, 0: OFF

export USE_LOCAL_OPENCV=1 # use a local installation of OpenCV

or you can set manullay OpenCV_DIR

export OpenCV_DIR="path to my OpenCV folder"

export OpenCV_DIR # here not set

export OPENCV_VERSION=4

====================================================

CUDA Settings

====================================================

N.B: if you do not have installed opencv with CUDA support you must set above:

USE_LOCAL_OPENCV=1

1: ON, 0: OFF

export USE_CUDA=0 # use CUDA in PLVS sparse SLAM
export CUDA_VERSION="cuda-11.6" # must be an installed CUDA path in "/usr/local";

if available, you can use the simple path "/usr/local/cuda" which should be a symbolic link to the last installed cuda version

if [ ! -d /usr/local/$CUDA_VERSION ]; then CUDA_VERSION="cuda" # use last installed CUDA path in standard path as a fallback fi

export PATH="/usr/local/cuda-11.6/bin:$PATH"

export LD_LIBRARY_PATH="/usr/local/cuda-11.6/lib64:$LD_LIBRARY_PATH"

export CUDADIR=/usr/local/cuda-11.6

export PATH=/usr/local/$CUDA_VERSION/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/$CUDA_VERSION/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export CUDADIR=/usr/local/$CUDA_VERSION

====================================================

Dataset Settings

====================================================

to be used in run/xterm scripts

export DATASETS_FOLDER="~/Work/datasets/rgbd_datasets/tum/"

====================================================

ROS Settings

====================================================

export INSTALL_CATKIN_TOOLS=1 # now this is compulsory

export USE_ELAS_ROS=0

====================================================

DEVICES

====================================================

export USE_ZED_CAMERA=0 # ( you need to install the last zed camera SDK) export USE_REALSENSE_D435=0 export USE_OAK=0

====================================================

Check and Manage Settings

====================================================

auto-managed things below ...

====================================================

SIMD

check SIMD supports

export HAVE_SSE3=$(gcc -march=native -dM -E - </dev/null | grep SSE3 || :) export HAVE_SSE4=$(gcc -march=native -dM -E - </dev/null | grep SSE4 || :) export HAVE_AVX=$(gcc -march=native -dM -E - </dev/null | grep AVX || : )

====================================================

CUDA

export CUDA_FOUND=0 if [ -f /usr/local/$CUDA_VERSION/bin/nvcc ] || [ -f /usr/bin/nvcc ]; then CUDA_FOUND=1 echo "CUDA found: $CUDA_VERSION" fi

reset env var if CUDA lib is not installed

if [ $CUDA_FOUND -eq 0 ]; then USE_CUDA=0 echo 'CUDA env var reset, check your CUDA installation' fi

====================================================

OPENCV

if [[ -n "$OpenCV_DIR" ]]; then if [ ! -d $OpenCV_DIR ]; then echo OpenCV_DIR does not exist: $OpenCV_DIR exit 1 fi fi

install a local opencv with CUDA support and more

if [ $USE_LOCAL_OPENCV -eq 1 ] && [[ ! -n "$OpenCV_DIR" ]]; then . install_local_opencv.sh # source it in order to run it and get the env var OPENCV_VERSION echo OpenCV version: $OPENCV_VERSION if [[ $OPENCV_VERSION == 4* ]]; then OpenCV_DIR="$CONFIG_DIR/Thirdparty/opencv/install/lib/cmake/opencv4" else OpenCV_DIR="$CONFIG_DIR/Thirdparty/opencv/install/share/OpenCV" fi echo setting OpenCV_DIR: $OpenCV_DIR

export LD_LIBRARY_PATH=$CONFIG_DIR/Thirdparty/opencv/install/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

fi

====================================================

ZED

export ZED_INSTALL_FOUND=0 if [ -d /usr/local/zed ]; then ZED_INSTALL_FOUND=1 echo "ZED found" fi

reset env var if ZED is not installed

if [ $ZED_INSTALL_FOUND -eq 0 ]; then USE_ZED_CAMERA=0 echo 'ZED env var reset, check your ZED installation' fi

I have installed a local opencv,so I don‘t know where the problem is

luigifreda commented 5 months ago

Other questions:

Another kind request. Can you share the full log of the command you are running and what command you are running? It would be great to have that information in a separate log file.

Before running anything else, please run clean.sh in the root folder of PLVS.

Cmomo1113 commented 5 months ago

I used a new computer without CUDA to install this system and the installation was successful. If it comes with CUDA, which version of CUDA needs to be installed? Is there anything I need to pay attention to if I install this system first and then install CUDA?

luigifreda commented 5 months ago

Did you have a chance to run the suggested commands above?

Any CUDA version that is compatible with a local opencv install (see the script install_local_opencv.sh, for instance with opencv 4.8.0) will work (e.g. CUDA 11.6). On my systems, I have installed different CUDA versions without problems. Many other friends successfully install PLVS+CUDA on different laptops and desktop machines. You can even test it with [rosdocker]() (with noetic_cuda or ubuntu20_cudaimages) as I suggested in the README.