cuda_kde_depth_packet_processor.cu:39:10:致命错误:helper_math.h:尝试在 ubuntu 21.10 上编译 libfreenect2 时未找到文件或目录

cuda_kde_depth_packet_processor.cu:39:10:致命错误:helper_math.h:尝试在 ubuntu 21.10 上编译 libfreenect2 时未找到文件或目录

我希望我的 Kinect 2 在 ubuntu 21.10 + nvidia 驱动程序 470.86 + cuda 11.4 上被识别为网络摄像头:

marietto-BHYVE:/home/marietto# nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

marietto-BHYVE:/home/marietto/Scrivania/libfreenect2# nvidia-smi

| NVIDIA-SMI 470.86       Driver Version: 470.86       CUDA Version: 11.4

为了完成任务,我遵循了本教程:

https://www.notaboutmy.life/posts/run-kinect-2-on-ubuntu-20-lts/

我已经发出了以下命令:

git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
mkdir build && cd build
cmake ..

但在某些时候,我遇到了这个错误:

marietto-BHYVE:/home/marietto/Scrivania/libfreenect2/build# make

-- using tinythread as threading library
-- Could NOT find TegraJPEG (missing: TegraJPEG_INCLUDE_DIRS TegraJPEG_WORKS) 
CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindOpenGL.cmake:305 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
  FindOpenGL found both a legacy GL library:
    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
  and GLVND libraries for OpenGL and GLX:
    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so
  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:269 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Linking with these libraries: 
 /usr/lib/x86_64-linux-gnu/libusb-1.0.so
 pthread
 va-drm
 va
 /usr/lib/x86_64-linux-gnu/libjpeg.so
 /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0
 /usr/lib/x86_64-linux-gnu/libglfw.so
 /usr/lib/x86_64-linux-gnu/libGL.so
 /usr/lib/x86_64-linux-gnu/libOpenCL.so
 /usr/lib/x86_64-linux-gnu/libcudart_static.a
 Threads::Threads
 dl
 /usr/lib/x86_64-linux-gnu/librt.a
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Configurating examples
-- Using in-tree freenect2 target
-- Feature list:
--   CUDA    yes
--   CXX11    disabled
--   Examples    yes
--   OpenCL    yes
--   OpenGL    yes
--   OpenNI2    yes
--   TegraJPEG    no
--   Threading    tinythread
--   TurboJPEG    yes
--   VAAPI    yes
--   VideoToolbox    no (Apple only)
--   streamer_recorder    disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marietto/Scrivania/libfreenect2/build
[  4%] Built target generate_resources_tool
[  7%] Building NVCC (Device) object CMakeFiles/cuda_compile_1.dir/src/cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o
/home/marietto/Scrivania/libfreenect2/src/cuda_kde_depth_packet_processor.cu:39:10: fatal error: helper_math.h: File o directory non esistente
   39 | #include <helper_math.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
CMake Error at cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o.RelWithDebInfo.cmake:220 (message):
  Error generating
  /home/marietto/Scrivania/libfreenect2/build/CMakeFiles/cuda_compile_1.dir/src/./cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o
make[2]: *** [CMakeFiles/freenect2.dir/build.make:411: CMakeFiles/cuda_compile_1.dir/src/cuda_compile_1_generated_cuda_kde_depth_packet_processor.cu.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:194: CMakeFiles/freenect2.dir/all] Errore 2
make: *** [Makefile:149: all] Errore 2

它无法继续编译,因为它无法在正确的位置找到文件 helper_math.h。此时我很困惑。我不知道在哪里可以得到那个文件,也不知道应该把它放在哪里。我想我应该安装 cuda 示例,我尝试了,如下所示,获取适用于 ubuntu 20.04 的 cuda 包(我正在运行 21.10,所以我认为 20.04 很好,因为它最接近我的 ubuntu 版本),我取消选择了除示例之外的所有内容,但它不起作用:

marietto-BHYVE:/home/marietto/Scrivania# chmod +x cuda_11.6.0_510.39.01_linux.run

marietto-BHYVE:/home/marietto/Scrivania# ./cuda_11.6.0_510.39.01_linux.run

===========
= Summary =
===========
Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-11.6/
Please make sure that
 -   PATH includes /usr/local/cuda-11.6/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-11.6/lib64, or, add /usr/local/cuda-11.6/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.6/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 510.00 is required for CUDA 11.6 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
    sudo <CudaInstaller>.run --silent --driver
Logfile is /var/log/cuda-installer.log

我还尝试安装以下 cuda 版本的示例:

http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run

但 :

[INFO]: Driver installation detected by command: apt list --installed | grep -e nvidia-driver-[0-9][0-9][0-9] -e >
[INFO]: Cleaning up window
[INFO]: Complete
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 10.3.0 (Ubuntu 10.3.0-11ubuntu1)

[ERROR]: unsupported compiler version: 10.3.0. Use --override to override this check.

经过进一步尝试,我尝试了不同版本的 cuda 11.3 和 11.4 包:

cuda-11-3_11.3.0-1_amd64.deb 4.0KB 2021-03-26 22:54

cuda-11-3_11.3.1-1_amd64.deb 4.0KB 2021-05-14 01:12

cuda-11-4_11.4.0-1_amd64.deb 4.0KB 2021-06-24 02:48

cuda-11-4_11.4.1-1_amd64.deb 4.0KB 2021-07-28 19:46

cuda-11-4_11.4.2-1_amd64.deb 4.0KB 2021-08-30 21:01

cuda-11-4_11.4.3-1_amd64.deb 4.0KB 2021-10-29 16:46

,但每次都无法安装,只有示例程序没有驱动程序。我不想重新安装驱动程序,因为它可以工作;我不想破坏系统;

最后我使用本教程安装了 cuda 示例:

https://snapcraft.io/install/cuda-samples/ubuntu

它们已经正确安装,没有给出任何错误,但仍然找不到 helper_math.h 文件,给出与之前相同的错误。

我该怎么办?谢谢。

相关内容